diff mbox

Add GeoGebra

Message ID 87wpmcmtnj.fsf@saiph.selenimh
State New
Headers show

Commit Message

Nicolas Goaziou May 29, 2016, 9:38 p.m. UTC
Hello,

The following patch adds GeoGebra. Please consider adding it to the
repository.

Thank you.

Regards,

Comments

Alex Vong May 30, 2016, 3:23 p.m. UTC | #1
Hi,


I have skimmed through the patch, the website of geogebra, and I have
noticed some problems.


+           ;; Move ".jar" files and license into "share/geogebra/".
It seems the jar files are copied into the installation directory.
This is no good because guix requires compiling everything from source
(except the bootstrap binaries). There is an ant-build-system in guix
(https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00207.html),
you may find it useful.


+    ;; Source code uses GPLv3+.  Other parts (e.g., translations) use
+    ;; a Non-Commercial clause.
This is hairy. I have looked at the website.

At the top of the website, it said
"You are free to copy, distribute and transmit GeoGebra for
non-commercial purposes (please see details below)."

But at the end of the website, it said
"Please note that GeoGebra as a complete software program would
probably not be considered "free" software according to the definition
of that term which is used \
by the Free Software Foundation. This is because the restrictions on
commercial use that apply to the GeoGebra installers, web services and
language files add-ons m\
ight be seen to be a restriction on the software as a whole (thus
making it "non-free"), even though the GeoGebra source code is made
available under the GNU General Public License without restriction.
You can rest assured that our license terms fully respect \
all existing licenses from third parties (including the GNU General
Public License and all Creative Commons variants) and have been
checked by an experienced \
law firm."

I guess this means the source is free-sw, but not the binaries and
translation, so we would have add a build phase to delete those
non-free parts. How do the other think about the license?


Thanks,
Alex


On 30/05/2016, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> The following patch adds GeoGebra. Please consider adding it to the
> repository.
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou                                                0x80A93738
>
Ludovic Courtès May 31, 2016, 4:18 p.m. UTC | #2
Hello!

Alex Vong <alexvong1995@gmail.com> skribis:

> +           ;; Move ".jar" files and license into "share/geogebra/".
> It seems the jar files are copied into the installation directory.
> This is no good because guix requires compiling everything from source
> (except the bootstrap binaries).

Indeed, those binaries must be removed in a ‘snippet’ field in the
‘origin’ object.  See the ‘java-hamcrest-core’ package for an example of
that.

> +    ;; Source code uses GPLv3+.  Other parts (e.g., translations) use
> +    ;; a Non-Commercial clause.

[...]

> "Please note that GeoGebra as a complete software program would
> probably not be considered "free" software according to the definition
> of that term which is used \
> by the Free Software Foundation.

Indeed, the non-commercial clause very clearly makes it non-free.  All
the affected parts must also be removed in a ‘snippet’.

Nicolas, could you look into it?

Thanks!

Ludo’.
Nicolas Goaziou June 1, 2016, 10:35 a.m. UTC | #3
Hello,

ludo@gnu.org (Ludovic Courtès) writes:

> Alex Vong <alexvong1995@gmail.com> skribis:

Thank you for the review.

>> +           ;; Move ".jar" files and license into "share/geogebra/".
>> It seems the jar files are copied into the installation directory.
>> This is no good because guix requires compiling everything from source
>> (except the bootstrap binaries).
>
> Indeed, those binaries must be removed in a ‘snippet’ field in the
> ‘origin’ object.  See the ‘java-hamcrest-core’ package for an example of
> that.

The problem is that the program is unusable without these jar files, or
to put it differently, the program is the jar files.

AFAIU, building from source is not an option at the moment. According to
<https://dev.geogebra.org/trac/wiki/SetUp>, ignoring the Eclipse-related
stuff, the project seems to be using Gradle for compilation. Guix
doesn't provide it. 

Notwithstanding the fact that adding it doesn't look like a trivial
task, Gradle seems to act like a package manager on its own. It can
download and install specific version of dependencies or even itself.
One option would be to skip the Gradle part altogether, but that's
probably out of my league.

>> +    ;; Source code uses GPLv3+.  Other parts (e.g., translations) use
>> +    ;; a Non-Commercial clause.
>
> [...]
>
>> "Please note that GeoGebra as a complete software program would
>> probably not be considered "free" software according to the definition
>> of that term which is used \
>> by the Free Software Foundation.
>
> Indeed, the non-commercial clause very clearly makes it non-free.  All
> the affected parts must also be removed in a ‘snippet’.

It is difficult to tell what parts are non-free or not. I mean, some
parts are obvious (web, installer) and are not provided in the current
package. However, I don't think there is an exhaustive list of non-free
elements.

OTOH Debian provides it in "main" repository, albeit in version 4.
I don't think the software was re-licensed between versions 4 and 5,
tho.

At this point, I'm not sure what to do next. If anyone has a clearer
picture of the task to do, please tell.


Regards,
Andreas Enge June 1, 2016, 11:08 a.m. UTC | #4
Hello Nicolas,

On Wed, Jun 01, 2016 at 12:35:29PM +0200, Nicolas Goaziou wrote:
> It is difficult to tell what parts are non-free or not. I mean, some
> parts are obvious (web, installer) and are not provided in the current
> package. However, I don't think there is an exhaustive list of non-free
> elements.
> 
> OTOH Debian provides it in "main" repository, albeit in version 4.
> I don't think the software was re-licensed between versions 4 and 5,
> tho.

the Debian package is called "geogebra-4.0.34.0+dfsg1-3"; the "dfsg" indicates 
that non-free parts of the source code have been dropped. You can browse the
Debian source code at
   https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/ ;
in particular, see these:
   https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/README.Debian/
   https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/README.source/
   https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/get_orig_source.sh/

All this looks like a lot of work; your call to decide how much you would
like to invest into this program.

Andreas
Ludovic Courtès June 2, 2016, 8:13 a.m. UTC | #5
Hi,

Andreas Enge <andreas@enge.fr> skribis:

> On Wed, Jun 01, 2016 at 12:35:29PM +0200, Nicolas Goaziou wrote:
>> It is difficult to tell what parts are non-free or not. I mean, some
>> parts are obvious (web, installer) and are not provided in the current
>> package. However, I don't think there is an exhaustive list of non-free
>> elements.
>> 
>> OTOH Debian provides it in "main" repository, albeit in version 4.
>> I don't think the software was re-licensed between versions 4 and 5,
>> tho.
>
> the Debian package is called "geogebra-4.0.34.0+dfsg1-3"; the "dfsg" indicates 
> that non-free parts of the source code have been dropped. You can browse the
> Debian source code at
>    https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/ ;
> in particular, see these:
>    https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/README.Debian/
>    https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/README.source/
>    https://sources.debian.net/src/geogebra/4.0.34.0%2Bdfsg1-3/debian/get_orig_source.sh/
>
> All this looks like a lot of work; your call to decide how much you would
> like to invest into this program.

Indeed, non-trivial work.  :-/

Regardless, for inclusion in Guix, it will have to be built from source,
which means packaging Gradle and other dependencies first.

Ricardo has experience dealing with Java packages and maybe has useful
insight?

Ludo’.
diff mbox

Patch

From ea6cc12bffe9e7c566f0d98681446df2676d2eb2 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Sun, 29 May 2016 19:28:53 +0200
Subject: [PATCH] gnu: Add geogebra.

* gnu/packages/maths.scm (geogebra): New variable.
---
 gnu/packages/maths.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index e11208c..135794f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -41,7 +41,10 @@ 
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system r)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
@@ -61,6 +64,7 @@ 
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages less)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages gnome)
@@ -2442,3 +2446,85 @@  structured and unstructured grid problems.")))
     (description "Matio is a library for reading and writing MAT files.  It
 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
     (license license:bsd-2)))
+
+(define-public geogebra
+  (package
+    (name "geogebra")
+    (version "5.0.240.0")
+    (synopsis "Dynamic mathematics software for education")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://download.geogebra.org/installers/"
+                           (version-major+minor version)
+                           "/GeoGebra-Linux-Portable-"
+                           version ".tar.bz2"))
+       (sha256
+        (base32
+         "1ngh0bah3krdc30ah3g73zbvh3gypvrvyfddlgcg7n5dmfad7a71"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (srfi srfi-26))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (srfi srfi-26))
+         (let ((bash (string-append (assoc-ref %build-inputs "bash") "/bin"))
+               (bzip2 (string-append (assoc-ref %build-inputs "bzip2") "/bin"))
+               (java (string-append (assoc-ref %build-inputs "icedtea")
+                                    "/bin/java")))
+           ;; Set paths.
+           (setenv "PATH" (string-append bzip2 ":" bash))
+           ;; Unpack file any move into source directory.
+           (let ((source (assoc-ref %build-inputs "source"))
+                 (tar (assoc-ref %build-inputs "tar")))
+             (system* (string-append tar "/bin/tar") "xjf" source))
+           (chdir (string-append "GeoGebra-Linux-Portable-" ,version))
+           ;; Move ".jar" files and license into "share/geogebra/".
+           (let* ((out (assoc-ref %outputs "out"))
+                  (bin (string-append out "/bin"))
+                  (share (string-append out "/share"))
+                  (applications (string-append share "/applications"))
+                  (jar-dir (string-append share "/geogebra")))
+             (for-each (cut install-file <> jar-dir)
+                       (find-files "." "\\.jar$"))
+             (install-file "LICENSE.txt" jar-dir)
+             ;; Create a launcher into "bin/".
+             (install-file "geogebra/geogebra" bin)
+             (with-directory-excursion bin
+               (patch-shebang "geogebra" (list bash))
+               (wrap-program "geogebra"
+                 `("GG_PATH" = (,jar-dir))
+                 `("GG_SCRIPTNAME" = ("geogebra"))
+                 `("JAVACMD" = (,java))))
+             ;; Install .desktop file in "share/applications/"
+             (mkdir-p applications)
+             (call-with-output-file
+                 (string-append applications "/geogebra.desktop")
+               (lambda (port)
+                 (format port "~
+\[Desktop Entry]~@
+Name=GeoGebra~@
+Comment=~a~@
+Exec=~a/geogebra~@
+Terminal=false~@
+Type=Application~@
+MimeType=application/vnd.geogebra.file;application/vnd.geogebra.tool~@
+Categories=Education;Science;Math;"
+                         ,synopsis bin))))
+           #t))))
+    (native-inputs `(("bzip2" ,bzip2)
+                     ("tar" ,tar)))
+    (inputs `(("bash" ,bash-minimal)
+              ("icedtea" ,icedtea)))
+    (description "GeoGebra is dynamic mathematics software for all
+levels of education that brings together geometry, algebra,
+spreadsheets, graphing, statistics and calculus in one package.")
+    (home-page "https://www.geogebra.org")
+    ;; Source code uses GPLv3+.  Other parts (e.g., translations) use
+    ;; a Non-Commercial clause.
+    (license
+     (list license:gpl3+
+           (license:non-copyleft "file:///LICENSE.txt"
+                                 "See LICENSE.txt in the distribution.")))))
-- 
2.8.3