guix-devel
[Top][All Lists]
Advanced

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

[PATCH] gnu: Add Celestia.


From: ericbavier
Subject: [PATCH] gnu: Add Celestia.
Date: Wed, 1 Jul 2015 23:29:57 -0500

From: Eric Bavier <address@hidden>

* gnu/packages/education.scm: New file.
* gnu/packages/patches/celestia-includes.patch,
  gnu/packages/patches/celestia-libpng15.patch,
  gnu/packages/patches/celestia-lua-config.patch: New patches.
* gnu-system.am (GNU_SYSTEM_MODULES): Add file.
  (dist_patch_DATA): Add patches.
---
 gnu-system.am                                  |  4 ++
 gnu/packages/education.scm                     | 83 ++++++++++++++++++++++++++
 gnu/packages/patches/celestia-includes.patch   | 23 +++++++
 gnu/packages/patches/celestia-libpng15.patch   | 14 +++++
 gnu/packages/patches/celestia-lua-config.patch | 13 ++++
 5 files changed, 137 insertions(+)
 create mode 100644 gnu/packages/education.scm
 create mode 100644 gnu/packages/patches/celestia-includes.patch
 create mode 100644 gnu/packages/patches/celestia-libpng15.patch
 create mode 100644 gnu/packages/patches/celestia-lua-config.patch

diff --git a/gnu-system.am b/gnu-system.am
index a3c56a8..3cec0d4 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -88,6 +88,7 @@ GNU_SYSTEM_MODULES =                          \
   gnu/packages/doxygen.scm                     \
   gnu/packages/ebook.scm                       \
   gnu/packages/ed.scm                          \
+  gnu/packages/education.scm                   \
   gnu/packages/elf.scm                         \
   gnu/packages/emacs.scm                       \
   gnu/packages/enchant.scm                     \
@@ -394,6 +395,9 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/calibre-drop-unrar.patch                        \
   gnu/packages/patches/calibre-no-updates-dialog.patch         \
   gnu/packages/patches/cdparanoia-fpic.patch                   \
+  gnu/packages/patches/celestia-includes.patch                 \
+  gnu/packages/patches/celestia-libpng15.patch                 \
+  gnu/packages/patches/celestia-lua-config.patch               \
   gnu/packages/patches/chmlib-inttypes.patch                   \
   gnu/packages/patches/clang-libc-search-path.patch            \
   gnu/packages/patches/clucene-pkgconfig.patch                 \
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
new file mode 100644
index 0000000..454e257
--- /dev/null
+++ b/gnu/packages/education.scm
@@ -0,0 +1,83 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Eric Bavier <address@hidden>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages education)
+  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix download)
+  #:use-module (guix packages)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages lua))
+
+(define-public celestia
+  (package
+    (name "celestia")
+    (version "1.6.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/celestia/celestia-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1i1lvhbgllsh2z8i6jj4mvrjak4a7r69psvk7syw03s4p7670mfk"))
+              (patches (list (search-patch "celestia-lua-config.patch")
+                             (search-patch "celestia-includes.patch")
+                             (search-patch "celestia-libpng15.patch")))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Remove 'windows' and 'macosx' directories, as they are not
+               ;; interesting to us and also contain dll's. ~26M
+               '(for-each delete-file-recursively
+                          '("windows" "macosx")))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("glut" ,freeglut)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("zlib" ,zlib)
+       ("lua" ,lua-5.1)))
+    (arguments
+     `(#:tests? #f                      ;no tests
+       #:configure-flags `("--with-glut" "LIBS=-lGL"
+                           "--with-lua" "LUA_LIBS=-llua"
+                           ,(format #f "LUA_VER=0x~{~2,,,'address@hidden" 
;e.g. 0x050102
+                                    (string-split ,(package-version lua-5.1)
+                                                  #\.))
+                           ,(string-append "LUA_CFLAGS=-I"
+                                           (assoc-ref %build-inputs "lua")
+                                           "/include"))))
+    (home-page "http://www.shatters.net/celestia/";)
+    (synopsis "3D astronomy program")
+    (description
+     "Celestia is a real-time visual simulation of space.  Choose a point
+within the Local Group of galaxies, and Celestia will show you an
+approximation of how it would appear to your eyes were you actually there.
+Some of what Celestia shows is necessarily hypothetical--the farther away from
+Earth you get, the less real data there is and the more guesswork is involved.
+Thus Celestia supplements observational data with good guesses based on models
+of stellar and planetary processes.  You can also navigate at an immense range
+of scales, orbit a couple kilometers above the surface of a tiny, irregular
+asteroid, then head off toward Jupiter, watching it grow from a bright point
+of light into a looming sphere filling your field of vision.  Leave our solar
+system entirely and observe the sun as it fades from a brilliant disk to a
+bright star, disappearing almost entirely as you head off toward the Upsilon
+Andromeda system to orbit around its innermost giant planet.")
+    (license gpl2+)))
diff --git a/gnu/packages/patches/celestia-includes.patch 
b/gnu/packages/patches/celestia-includes.patch
new file mode 100644
index 0000000..37b4e44
--- /dev/null
+++ b/gnu/packages/patches/celestia-includes.patch
@@ -0,0 +1,23 @@
+Patches from Archlinux.
+
+http://bugs.gentoo.org/show_bug.cgi?id=366073
+--- 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,
+--- a/src/celengine/frametree.h
++++ b/src/celengine/frametree.h
+@@ -14,6 +14,7 @@
+ #define _CELENGINE_FRAMETREE_H_
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ class Star;
+ class Body;
diff --git a/gnu/packages/patches/celestia-libpng15.patch 
b/gnu/packages/patches/celestia-libpng15.patch
new file mode 100644
index 0000000..0a772ff
--- /dev/null
+++ b/gnu/packages/patches/celestia-libpng15.patch
@@ -0,0 +1,14 @@
+imagecapture.cpp:184:40: error: ‘Z_BEST_COMPRESSION’ was not declared in this 
scope
+
+--- a/src/celestia/imagecapture.cpp
++++ b/src/celestia/imagecapture.cpp
+@@ -31,6 +31,9 @@
+ #include "png.h"
+ #endif
+ 
++// Z_BEST_COMPRESSION
++#include <zlib.h>
++
+ // Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng
+ #ifndef png_jmpbuf
+ #define png_jmpbuf(png_ptr) png_ptr->jmpbuf
diff --git a/gnu/packages/patches/celestia-lua-config.patch 
b/gnu/packages/patches/celestia-lua-config.patch
new file mode 100644
index 0000000..0f364ca
--- /dev/null
+++ b/gnu/packages/patches/celestia-lua-config.patch
@@ -0,0 +1,13 @@
+Allow Celestia to configure in the absense of a pkg-config file for lua.
+
+--- celestia-1.6.1/configure.orig      2011-06-05 13:33:27.000000000 -0500
++++ celestia-1.6.1/configure   2015-07-01 22:16:52.820366266 -0500
+@@ -28433,7 +28433,7 @@
+ fi
+ 
+ 
+-if (test "$enable_lua" != "no"); then
++if (test "$enable_lua" = "auto"); then
+       LUA_VER=0
+ 
+ pkg_failed=no
-- 
2.2.1




reply via email to

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