unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add Celestia.
@ 2015-07-02  4:29 ericbavier
  2015-07-04  6:56 ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: ericbavier @ 2015-07-02  4:29 UTC (permalink / raw)
  To: guix-devel; +Cc: Eric Bavier

From: Eric Bavier <bavier@member.fsf.org>

* 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 <bavier@member.fsf.org>
+;;;
+;;; 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,,,'0@a~}" ;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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add Celestia.
  2015-07-02  4:29 [PATCH] gnu: Add Celestia ericbavier
@ 2015-07-04  6:56 ` Mark H Weaver
  2015-07-06 15:42   ` Eric Bavier
  2015-07-06 17:54   ` Mark H Weaver
  0 siblings, 2 replies; 4+ messages in thread
From: Mark H Weaver @ 2015-07-04  6:56 UTC (permalink / raw)
  To: ericbavier; +Cc: guix-devel, Eric Bavier

ericbavier@openmailbox.org writes:

> From: Eric Bavier <bavier@member.fsf.org>
>
> * 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.

I actually already packaged this (although using the gtk+ interface),
and have been using it, but I hadn't posted it because there are
copyright issues with some of the images and models included within,
e.g. those from the JPL.

I don't have time right now to go into further details...

      Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add Celestia.
  2015-07-04  6:56 ` Mark H Weaver
@ 2015-07-06 15:42   ` Eric Bavier
  2015-07-06 17:54   ` Mark H Weaver
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Bavier @ 2015-07-06 15:42 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

On 2015-07-04 01:56, Mark H Weaver wrote:
> ericbavier@openmailbox.org writes:
> 
>> From: Eric Bavier <bavier@member.fsf.org>
>> 
>> * 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.
> 
> I actually already packaged this (although using the gtk+ interface),
> and have been using it, but I hadn't posted it because there are
> copyright issues with some of the images and models included within,
> e.g. those from the JPL.

Ok.  It sounds like you've maybe done a more thorough job with the 
packaging.

> 
> I don't have time right now to go into further details...

I see that JPL's image usage policy includes the requirement to use a 
credit line in image captions.  It doesn't appear that Celestia does 
this.

Now I see many of the models and images might be in similar situations.

`~Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add Celestia.
  2015-07-04  6:56 ` Mark H Weaver
  2015-07-06 15:42   ` Eric Bavier
@ 2015-07-06 17:54   ` Mark H Weaver
  1 sibling, 0 replies; 4+ messages in thread
From: Mark H Weaver @ 2015-07-06 17:54 UTC (permalink / raw)
  To: ericbavier; +Cc: guix-devel, Eric Bavier

Mark H Weaver <mhw@netris.org> writes:

> ericbavier@openmailbox.org writes:
>
>> From: Eric Bavier <bavier@member.fsf.org>
>>
>> * 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.
>
> I actually already packaged this (although using the gtk+ interface),
> and have been using it, but I hadn't posted it because there are
> copyright issues with some of the images and models included within,
> e.g. those from the JPL.
>
> I don't have time right now to go into further details...

Okay, I refreshed my memory on the details, and there may or may not
still be an issue.  The issue I remember is that, at least in the past,
the "JPL Image Policy" was this (quoting from
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=174456>):

---snip---
JPL Image Policy

JPL images are available for use by the public free of charge. However,
by electing to download images from this web site the user agrees that
Caltech makes no warranties or representations with respect to its
ownership of copyrights for the images, does not represent others who
may claim to be owners of rights in the images, and makes no warranties
as to the quality of the images.

Commercial users (excluding journalistic uses) are required to copy the
JPL Image Release document and return a signed copy to the Caltech's
Intellectual Property Counsel, California Institute of Technology M/C
201-85, Pasadena, California 91125, who will countersign document and
return a copy to you. Copies may be faxed to (626) 577-2528. This
document will become effective when it is countersigned by Caltech.
---snip---

For non-functional data such as this, the GNU FSDG requirements are more
permissive than Debian's DFSG: we don't insist on the right to
distribute /modified/ versions.  However, the license must grant
"permission to copy and redistribute, both for commercial and
non-commercial purposes."  (See the "Non-functional Data" section of
<https://gnu.org/distros/free-system-distribution-guidelines.html>)

So, the requirement for each user to obtain a release before commercial
use is a show-stopper for us.

However, I looked at <http://www.jpl.nasa.gov/imagepolicy/> today and no
longer see the above text, so maybe the situation has changed since
Debian researched this in 2003.  The only remaining bit that might be
problematic is this (at the end of the page):

  * Some image and video materials on JPL public web sites are owned by
    organizations other than JPL or NASA. These owners have agreed to
    make their images and video available for journalistic, educational
    and personal uses, but restrictions are placed on commercial
    uses. To obtain permission for commercial use, contact the copyright
    owner listed in each image caption. Ownership of images and video by
    parties other than JPL and NASA is noted in the caption material
    with each image.

So, there may or may not still be a problem.  This will require more
research.

      Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-06 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02  4:29 [PATCH] gnu: Add Celestia ericbavier
2015-07-04  6:56 ` Mark H Weaver
2015-07-06 15:42   ` Eric Bavier
2015-07-06 17:54   ` Mark H Weaver

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).