unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add GeoGebra
@ 2016-05-29 21:38 Nicolas Goaziou
  2016-05-30 15:23 ` Alex Vong
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2016-05-29 21:38 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

Hello,

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

Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Add geogebra (v1) --]
[-- Type: text/x-diff, Size: 5053 bytes --]

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


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

* Re: [PATCH] Add GeoGebra
  2016-05-29 21:38 [PATCH] Add GeoGebra Nicolas Goaziou
@ 2016-05-30 15:23 ` Alex Vong
  2016-05-31 16:18   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Vong @ 2016-05-30 15:23 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: guix-devel

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
>

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

* Re: [PATCH] Add GeoGebra
  2016-05-30 15:23 ` Alex Vong
@ 2016-05-31 16:18   ` Ludovic Courtès
  2016-06-01 10:35     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-05-31 16:18 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel, Nicolas Goaziou

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’.

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

* Re: [PATCH] Add GeoGebra
  2016-05-31 16:18   ` Ludovic Courtès
@ 2016-06-01 10:35     ` Nicolas Goaziou
  2016-06-01 11:08       ` Andreas Enge
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2016-06-01 10:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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,

-- 
Nicolas Goaziou                                                0x80A93738

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

* Re: [PATCH] Add GeoGebra
  2016-06-01 10:35     ` Nicolas Goaziou
@ 2016-06-01 11:08       ` Andreas Enge
  2016-06-02  8:13         ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Enge @ 2016-06-01 11:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: guix-devel

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
  

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

* Re: [PATCH] Add GeoGebra
  2016-06-01 11:08       ` Andreas Enge
@ 2016-06-02  8:13         ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-06-02  8:13 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel, Nicolas Goaziou

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’.

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

end of thread, other threads:[~2016-06-02  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-29 21:38 [PATCH] Add GeoGebra Nicolas Goaziou
2016-05-30 15:23 ` Alex Vong
2016-05-31 16:18   ` Ludovic Courtès
2016-06-01 10:35     ` Nicolas Goaziou
2016-06-01 11:08       ` Andreas Enge
2016-06-02  8:13         ` Ludovic Courtès

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).