all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: guix-devel@gnu.org
Subject: [PATCH] Add GeoGebra
Date: Sun, 29 May 2016 23:38:40 +0200	[thread overview]
Message-ID: <87wpmcmtnj.fsf@saiph.selenimh> (raw)

[-- 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


             reply	other threads:[~2016-05-29 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29 21:38 Nicolas Goaziou [this message]
2016-05-30 15:23 ` [PATCH] Add GeoGebra 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpmcmtnj.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.