about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/geogebra/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/default.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
new file mode 100644
index 000000000000..1dd92267a837
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, jre, makeDesktopItem, makeWrapper, language ? "en_US" }:
+
+stdenv.mkDerivation rec {
+  pname = "geogebra";
+  version = "5-0-574-0";
+
+  preferLocalBuild = true;
+
+  src = fetchurl {
+    urls = [
+      "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
+      "http://web.archive.org/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
+    ];
+    sha256 = "0jbci4spqkf33yb079lsnsc684y4mdf1p8lm9r0037av8jlsrgrc";
+  };
+
+  srcIcon = fetchurl {
+    url = "http://static.geogebra.org/images/geogebra-logo.svg";
+    sha256 = "01sy7ggfvck350hwv0cla9ynrvghvssqm3c59x4q5lwsxjsxdpjm";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "geogebra";
+    exec = "geogebra";
+    icon = "geogebra";
+    desktopName = "Geogebra";
+    genericName = "Geogebra";
+    comment = meta.description;
+    categories = "Education;Science;Math;";
+    mimeType = "application/vnd.geogebra.file;application/vnd.geogebra.tool;";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    install -D geogebra/* -t "$out/libexec/geogebra/"
+
+    makeWrapper "$out/libexec/geogebra/geogebra" "$out/bin/geogebra" \
+      --set JAVACMD "${jre}/bin/java" \
+      --set GG_PATH "$out/libexec/geogebra" \
+      --add-flags "--language=${language}"
+
+    install -Dm644 "${desktopItem}/share/applications/"* \
+      -t $out/share/applications/
+
+    install -Dm644 "${srcIcon}" \
+      "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Dynamic mathematics software with graphics, algebra and spreadsheets";
+    longDescription = ''
+      Dynamic mathematics software for all levels of education that brings
+      together geometry, algebra, spreadsheets, graphing, statistics and
+      calculus in one easy-to-use package.
+    '';
+    homepage = "https://www.geogebra.org/";
+    maintainers = with maintainers; [ ma27 ];
+    license = with licenses; [ gpl3 cc-by-nc-sa-30 geogebra ];
+    platforms = platforms.all;
+    hydraPlatforms = [];
+  };
+}