guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/17: PRELIMINARY: Add celestia.


From: Mark H. Weaver
Subject: 05/17: PRELIMINARY: Add celestia.
Date: Mon, 23 Apr 2018 03:07:27 -0400 (EDT)

mhw pushed a commit to branch reproduce-bug-29774
in repository guix.

commit 17fac5f19f484374530f7677970ef9a7e827d5b1
Author: Mark H Weaver <address@hidden>
Date:   Thu May 28 01:10:39 2015 -0400

    PRELIMINARY: Add celestia.
---
 gnu/local.mk                                       |   7 +
 gnu/packages/astronomy.scm                         |  59 +++++-
 .../patches/celestia-add-missing-includes.patch    | 221 +++++++++++++++++++++
 gnu/packages/patches/celestia-gcc-4.7.patch        |  12 ++
 gnu/packages/patches/celestia-libpng-1.5.patch     |  36 ++++
 gnu/packages/patches/celestia-libpng-1.6.patch     |  25 +++
 gnu/packages/patches/celestia-mips.patch           |  32 +++
 gnu/packages/patches/celestia-use-0-not-NULL.patch |  13 ++
 gnu/packages/patches/celestia-use-stdint.h.patch   |  49 +++++
 9 files changed, 453 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 07fd7cb..4b7612d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -586,6 +586,13 @@ dist_patch_DATA =                                          
\
   %D%/packages/patches/calibre-use-packaged-feedparser.patch   \
   %D%/packages/patches/catdoc-CVE-2017-11110.patch             \
   %D%/packages/patches/cdparanoia-fpic.patch                   \
+  %D%/packages/patches/celestia-add-missing-includes.patch     \
+  %D%/packages/patches/celestia-gcc-4.7.patch                  \
+  %D%/packages/patches/celestia-libpng-1.5.patch               \
+  %D%/packages/patches/celestia-libpng-1.6.patch               \
+  %D%/packages/patches/celestia-mips.patch                     \
+  %D%/packages/patches/celestia-use-0-not-NULL.patch           \
+  %D%/packages/patches/celestia-use-stdint.h.patch             \
   %D%/packages/patches/cdrtools-3.01-mkisofs-isoinfo.patch     \
   %D%/packages/patches/ceph-disable-cpu-optimizations.patch    \
   %D%/packages/patches/ceph-rocksdb-compat.patch               \
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 8cf9d9e..ababe49 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 John Darrington <address@hidden>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <address@hidden>
+;;; Copyright © 2016 Mark H Weaver <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,14 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix download)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages image)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gettext)
@@ -30,7 +39,8 @@
   #:use-module (gnu packages qt)
   #:use-module (gnu packages maths)
   #:use-module (guix build-system cmake)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system glib-or-gtk))
 
 (define-public cfitsio
   (package
@@ -166,3 +176,50 @@ programs for the manipulation and analysis of astronomical 
data.")
 can be used to control telescopes over a serial port for tracking celestial
 objects.")
     (license license:gpl2+)))
+
+(define-public celestia
+  (package
+    (name "celestia")
+    (version "1.6.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name
+                                  "/Celestia-source/" version "/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32 "1i1lvhbgllsh2z8i6jj4mvrjak4a7r69psvk7syw03s4p7670mfk"))
+              (patches (map search-patch '("celestia-libpng-1.5.patch"
+                                           "celestia-libpng-1.6.patch"
+                                           "celestia-use-stdint.h.patch"
+                                           "celestia-use-0-not-NULL.patch"
+                                           
"celestia-add-missing-includes.patch"
+                                           "celestia-gcc-4.7.patch"
+                                           "celestia-mips.patch")))))
+    (build-system glib-or-gtk-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("lua" ,lua-5.1)
+       ("gtk+" ,gtk+-2)
+       ("gtkglext" ,gtkglext)
+       ("mesa" ,mesa)
+       ("glu" ,glu)
+       ("libtheora" ,libtheora)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)))
+    (arguments
+     `(#:configure-flags
+       (let ((lua (assoc-ref %build-inputs "lua")))
+         (list "--with-gtk"
+               (string-append "LUA_CFLAGS=-I" lua "/include")
+               (string-append "LUA_LIBS=-L" lua "/libs -llua")))
+       #:out-of-source? #f))
+    (home-page "http://www.shatters.net/celestia/";)
+    (synopsis "Real-time visual space simulation")
+    (description
+     "Celestia is a free 3D astronomy program.  Based on the Hipparcos
+Catalogue, it allows users to display objects ranging in scale from artificial
+satellites to entire galaxies in three dimensions using OpenGL.  Unlike most
+planetarium software, the user is free to travel about the Universe.")
+    ;; XXX TODO: Investigate licenses of included images and models.
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/celestia-add-missing-includes.patch 
b/gnu/packages/patches/celestia-add-missing-includes.patch
new file mode 100644
index 0000000..4aa7bd0
--- /dev/null
+++ b/gnu/packages/patches/celestia-add-missing-includes.patch
@@ -0,0 +1,221 @@
+Copied from Debian.
+
+--- celestia-1.6.1+dfsg.orig/src/celutil/util.cpp
++++ celestia-1.6.1+dfsg/src/celutil/util.cpp
+@@ -12,6 +12,7 @@
+ #include "util.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <libintl.h>
+ 
+ using namespace std;
+ 
+--- celestia-1.6.1+dfsg.orig/src/celestia/oggtheoracapture.cpp
++++ celestia-1.6.1+dfsg/src/celestia/oggtheoracapture.cpp
+@@ -62,6 +62,9 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <cmath>
++#include <cstring>
++#include <ctime>
++#include <libintl.h>
+ #include <celutil/debug.h>
+ #include <celutil/util.h>
+ #include "../celengine/gl.h"
+--- celestia-1.6.1+dfsg.orig/src/celestia/glutmain.cpp
++++ celestia-1.6.1+dfsg/src/celestia/glutmain.cpp
+@@ -15,6 +15,7 @@
+ #include <cstdlib>
+ #include <cctype>
+ #include <cstring>
++#include <libintl.h>
+ #include <time.h>
+ #include <unistd.h>
+ #include <celengine/gl.h>
+--- celestia-1.6.1+dfsg.orig/src/celestia/celestiacore.cpp
++++ celestia-1.6.1+dfsg/src/celestia/celestiacore.cpp
+@@ -23,6 +23,7 @@
+ #include <cstring>
+ #include <cassert>
+ #include <ctime>
++#include <libintl.h>
+ #include <celengine/gl.h>
+ #include <celmath/vecmath.h>
+ #include <celmath/quaternion.h>
+--- celestia-1.6.1+dfsg.orig/src/celestia/kde/kdeapp.cpp
++++ celestia-1.6.1+dfsg/src/celestia/kde/kdeapp.cpp
+@@ -19,6 +19,7 @@
+ #include <libintl.h>
+ #include <fstream>
+ #include <sstream>
++#include <libintl.h>
+ 
+ #include <qpushbutton.h>
+ #include <qslider.h>
+--- celestia-1.6.1+dfsg.orig/src/celestia/kde/selectionpopup.cpp
++++ celestia-1.6.1+dfsg/src/celestia/kde/selectionpopup.cpp
+@@ -20,6 +20,7 @@
+ #include <sstream>
+ #include <fstream>
+ #include <algorithm>
++#include <libintl.h>
+ 
+ #include "selectionpopup.h"
+ 
+--- celestia-1.6.1+dfsg.orig/src/celestia/kde/kdeuniquecelestia.cpp
++++ celestia-1.6.1+dfsg/src/celestia/kde/kdeuniquecelestia.cpp
+@@ -20,6 +20,7 @@
+ #include <qdir.h>
+ #include <string>
+ #include <vector>
++#include <libintl.h>
+ #include <klocale.h>
+ #include <libintl.h>
+ 
+--- celestia-1.6.1+dfsg.orig/src/celengine/fragmentprog.cpp
++++ celestia-1.6.1+dfsg/src/celengine/fragmentprog.cpp
+@@ -7,6 +7,7 @@
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ 
++#include <libintl.h>
+ #include <iostream>
+ #include <fstream>
+ #include <string>
+--- celestia-1.6.1+dfsg.orig/src/celengine/asterism.cpp
++++ celestia-1.6.1+dfsg/src/celengine/asterism.cpp
+@@ -15,6 +15,7 @@
+ #endif /* TARGET_OS_MAC */
+ #endif /* _WIN32 */
+ 
++#include <libintl.h>
+ #include <celutil/util.h>
+ #include <celutil/debug.h>
+ #include "parser.h"
+--- celestia-1.6.1+dfsg.orig/src/celengine/texture.cpp
++++ celestia-1.6.1+dfsg/src/celengine/texture.cpp
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #include <cmath>
++#include <libintl.h>
+ #include <algorithm>
+ #include <iostream>
+ #include <fstream>
+--- celestia-1.6.1+dfsg.orig/src/celengine/location.cpp
++++ celestia-1.6.1+dfsg/src/celengine/location.cpp
+@@ -7,6 +7,7 @@
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ 
++#include <libintl.h>
+ #include <map>
+ #include <celengine/location.h>
+ #include <celengine/body.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/nebula.cpp
++++ celestia-1.6.1+dfsg/src/celengine/nebula.cpp
+@@ -8,7 +8,8 @@
+ // of the License, or (at your option) any later version.
+ 
+ #include <algorithm>
+-#include <stdio.h>
++#include <cstdio>
++#include <libintl.h>
+ #include "celestia.h"
+ #include <celmath/mathlib.h>
+ #include <celutil/util.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/meshmanager.cpp
++++ celestia-1.6.1+dfsg/src/celengine/meshmanager.cpp
+@@ -13,6 +13,7 @@
+ #include <iostream>
+ #include <fstream>
+ #include <cassert>
++#include <libintl.h>
+ 
+ #include "celestia.h"
+ #include <celutil/debug.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/dsodb.cpp
++++ celestia-1.6.1+dfsg/src/celengine/dsodb.cpp
+@@ -14,6 +14,7 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <cassert>
++#include <libintl.h>
+ #include <algorithm>
+ #include <celmath/mathlib.h>
+ #include <celmath/plane.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/solarsys.cpp
++++ celestia-1.6.1+dfsg/src/celengine/solarsys.cpp
+@@ -19,6 +19,7 @@
+ #endif /* ! TARGET_OS_MAC */
+ #endif /* ! _WIN32 */
+ 
++#include <libintl.h>
+ #include <celutil/debug.h>
+ #include <celmath/mathlib.h>
+ #include <celutil/util.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/overlay.cpp
++++ celestia-1.6.1+dfsg/src/celengine/overlay.cpp
+@@ -10,6 +10,7 @@
+ #include <cstring>
+ #include <cstdarg>
+ #include <cstdio>
++#include <cstring>
+ #include <celutil/utf8.h>
+ #include "gl.h"
+ #include "vecgl.h"
+--- celestia-1.6.1+dfsg.orig/src/celengine/vertexprog.cpp
++++ celestia-1.6.1+dfsg/src/celengine/vertexprog.cpp
+@@ -7,6 +7,7 @@
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ 
++#include <libintl.h>
+ #include <iostream>
+ #include <fstream>
+ #include <string>
+--- celestia-1.6.1+dfsg.orig/src/celengine/galaxy.cpp
++++ celestia-1.6.1+dfsg/src/celengine/galaxy.cpp
+@@ -12,6 +12,8 @@
+ #include <algorithm>
+ #include <cstdio>
+ #include <cassert>
++#include <cstring>
++#include <libintl.h>
+ #include "celestia.h"
+ #include <celmath/mathlib.h>
+ #include <celmath/perlin.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/opencluster.cpp
++++ celestia-1.6.1+dfsg/src/celengine/opencluster.cpp
+@@ -8,7 +8,8 @@
+ // of the License, or (at your option) any later version.
+ 
+ #include <algorithm>
+-#include <stdio.h>
++#include <cstdio>
++#include <libintl.h>
+ #include "celestia.h"
+ #include <celmath/mathlib.h>
+ #include <celutil/util.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/stardb.cpp
++++ celestia-1.6.1+dfsg/src/celengine/stardb.cpp
+@@ -11,7 +11,9 @@
+ #include <cmath>
+ #include <cstdlib>
+ #include <cstdio>
++#include <cstring>
+ #include <cassert>
++#include <libintl.h>
+ #include <algorithm>
+ #include <celmath/mathlib.h>
+ #include <celmath/plane.h>
+--- celestia-1.6.1+dfsg.orig/src/celengine/astro.cpp
++++ celestia-1.6.1+dfsg/src/celengine/astro.cpp
+@@ -11,6 +11,7 @@
+ #include <cmath>
+ #include <iomanip>
+ #include <cstdio>
++#include <cstring>
+ #include <time.h>
+ #include <celutil/basictypes.h>
+ #include <celmath/mathlib.h>
diff --git a/gnu/packages/patches/celestia-gcc-4.7.patch 
b/gnu/packages/patches/celestia-gcc-4.7.patch
new file mode 100644
index 0000000..861e6e0
--- /dev/null
+++ b/gnu/packages/patches/celestia-gcc-4.7.patch
@@ -0,0 +1,12 @@
+Copied from Debian.
+
+--- a/src/celmath/intersect.h
++++ b/src/celmath/intersect.h
+@@ -15,6 +15,7 @@
+ #include "ray.h"
+ #include "sphere.h"
+ #include "ellipsoid.h"
++#include "mathlib.h"
+ 
+ 
+ template<class T> bool testIntersection(const Ray3<T>& ray,
diff --git a/gnu/packages/patches/celestia-libpng-1.5.patch 
b/gnu/packages/patches/celestia-libpng-1.5.patch
new file mode 100644
index 0000000..9343f5e
--- /dev/null
+++ b/gnu/packages/patches/celestia-libpng-1.5.patch
@@ -0,0 +1,36 @@
+Copied from Debian.
+
+Author: Nobuhiro Iwamatsu <address@hidden>
+
+--- a/src/celengine/image.cpp
++++ b/src/celengine/image.cpp
+@@ -63,6 +63,7 @@
+ #include "celestia.h"
+ 
+ #include <cassert>
++#include <libintl.h>
+ #include <iostream>
+ #include <algorithm>
+ #include <cmath>
+@@ -82,6 +83,11 @@
+ #define png_set_tRNS_to_alpha(p)   png_set_expand(p)
+ #endif // PNG_LIBPNG_VER < 10004
+ 
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++#define png_set_gray_1_2_4_to_8(p)    \
++              png_set_expand_gray_1_2_4_to_8(p)
++#endif
++
+ #endif // PNG_SUPPORT
+ 
+ 
+--- a/src/celestia/imagecapture.cpp
++++ b/src/celestia/imagecapture.cpp
+@@ -29,6 +29,7 @@
+ #include "../celestia/Celestia.app.skel/Contents/Frameworks/Headers/png.h"
+ #else
+ #include "png.h"
++#include "zlib.h"
+ #endif
+ 
+ // Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng
diff --git a/gnu/packages/patches/celestia-libpng-1.6.patch 
b/gnu/packages/patches/celestia-libpng-1.6.patch
new file mode 100644
index 0000000..dea151c
--- /dev/null
+++ b/gnu/packages/patches/celestia-libpng-1.6.patch
@@ -0,0 +1,25 @@
+Based on a patch from Gentoo.
+
+https://bugs.gentoo.org/show_bug.cgi?id=464764
+
+Patch written by Lars Wendler <address@hidden>
+--- a/src/celengine/image.cpp
++++ b/src/celengine/image.cpp
+@@ -42,6 +42,7 @@ extern "C" {
+ #include "jpeglib.h"
+ #else
+ #include <cstdio>
++#include <string.h>
+ #include <jpeglib.h>
+ #endif
+ }
+--- a/src/celengine/texture.cpp
++++ b/src/celengine/texture.cpp
+@@ -28,6 +28,7 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <cassert>
++#include <string.h>
+ 
+ #ifndef _WIN32
+ #ifndef TARGET_OS_MAC
diff --git a/gnu/packages/patches/celestia-mips.patch 
b/gnu/packages/patches/celestia-mips.patch
new file mode 100644
index 0000000..670b577
--- /dev/null
+++ b/gnu/packages/patches/celestia-mips.patch
@@ -0,0 +1,32 @@
+Copied from Debian.
+
+Index: celestia-1.6.1+dfsg/src/celengine/image.cpp
+===================================================================
+--- celestia-1.6.1+dfsg.orig/src/celengine/image.cpp   2014-10-16 
18:20:45.000000000 +0800
++++ celestia-1.6.1+dfsg/src/celengine/image.cpp        2014-10-16 
18:25:25.308234608 +0800
+@@ -149,10 +149,10 @@
+ }
+ 
+ 
+-Image::Image(int fmt, int w, int h, int mips) :
++Image::Image(int fmt, int w, int h, int mip) :
+     width(w),
+     height(h),
+-    mipLevels(mips),
++    mipLevels(mip),
+     format(fmt),
+     pixels(NULL)
+ {
+Index: celestia-1.6.1+dfsg/src/celengine/image.h
+===================================================================
+--- celestia-1.6.1+dfsg.orig/src/celengine/image.h     2011-06-06 
00:11:09.000000000 +0800
++++ celestia-1.6.1+dfsg/src/celengine/image.h  2014-10-16 18:25:38.200234942 
+0800
+@@ -22,7 +22,7 @@
+ class Image
+ {
+  public:
+-    Image(int fmt, int w, int h, int mips = 1);
++    Image(int fmt, int w, int h, int mip = 1);
+     ~Image();
+ 
+     int getWidth() const;
diff --git a/gnu/packages/patches/celestia-use-0-not-NULL.patch 
b/gnu/packages/patches/celestia-use-0-not-NULL.patch
new file mode 100644
index 0000000..576a466
--- /dev/null
+++ b/gnu/packages/patches/celestia-use-0-not-NULL.patch
@@ -0,0 +1,13 @@
+Copied from Debian.
+
+--- celestia-1.6.0+dfsg.orig/src/celengine/frametree.h
++++ celestia-1.6.0+dfsg/src/celengine/frametree.h
+@@ -49,7 +49,7 @@ public:
+ 
+     bool isRoot() const
+     {
+-        return bodyParent == NULL;
++        return bodyParent == 0;
+     }
+ 
+     bool updateRequired() const
diff --git a/gnu/packages/patches/celestia-use-stdint.h.patch 
b/gnu/packages/patches/celestia-use-stdint.h.patch
new file mode 100644
index 0000000..0627743
--- /dev/null
+++ b/gnu/packages/patches/celestia-use-stdint.h.patch
@@ -0,0 +1,49 @@
+Copied from Debian.
+
+--- a/src/celutil/basictypes.h
++++ b/src/celutil/basictypes.h
+@@ -10,34 +10,24 @@
+ #ifndef _BASICTYPES_H_
+ #define _BASICTYPES_H_
+ 
++#include <stdint.h>
++
+ typedef unsigned int   uint;
+ 
+ // Fixed size types
+-typedef int            int32;
+-typedef unsigned int   uint32;
+-typedef short          int16;
+-typedef unsigned short uint16;
+-typedef char           int8;
+-typedef unsigned char  uint8;
++typedef int32_t        int32;
++typedef uint32_t       uint32;
++typedef int16_t        int16;
++typedef uint16_t       uint16;
++typedef int8_t         int8;
++typedef uint8_t        uint8;
++typedef int64_t        int64;
++typedef uint64_t       uint64;
+ 
+-#ifdef _MSC_VER
+-// MS Visual C++ does not include stdint.h
+-typedef __int64          int64;
+-typedef unsigned __int64 uint64;
+-#define INT64_MAX  LLONG_MAX
+-#define UINT64_MAX ULLONG_MAX
+-#else
+-#include <stdint.h>
+-#include <limits>
+-typedef          int64_t int64;
+-typedef         uint64_t uint64;
+ #define INT64_MAX 9223372036854775807LL
+ #ifndef UINT64_MAX
+ #define UINT64_MAX 0xffffffffffffffffULL
+ #endif
+-//#define INT64_MAX  std::numeric_limits<int64_t>::max()
+-//#define UINT64_MAX std::numeric_limits<uint64_t>::max()
+-#endif
+ 
+ #endif // _BASICTYPES_H_
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]