From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: [PATCH] Add GeoGebra Date: Sun, 29 May 2016 23:38:40 +0200 Message-ID: <87wpmcmtnj.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b78QC-0001Wl-OR for guix-devel@gnu.org; Sun, 29 May 2016 17:38:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b78QA-0000dF-68 for guix-devel@gnu.org; Sun, 29 May 2016 17:38:55 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:44078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b78Q9-0000cP-Rm for guix-devel@gnu.org; Sun, 29 May 2016 17:38:54 -0400 Received: from saiph.selenimh (unknown [IPv6:2a03:a0a0:0:4301::b3c]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id C3E9E17209A for ; Sun, 29 May 2016 23:38:51 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain Hello, The following patch adds GeoGebra. Please consider adding it to the repository. Thank you. Regards, -- Nicolas Goaziou 0x80A93738 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnu-Add-geogebra.patch Content-Description: Add geogebra (v1) >From ea6cc12bffe9e7c566f0d98681446df2676d2eb2 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou 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 --=-=-=--