about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix92
1 files changed, 58 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
index 65caff82ead1..7bd582648937 100644
--- a/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
@@ -1,46 +1,70 @@
 { stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
-stdenv.mkDerivation rec{
+let
+  pname = "geogebra";
+  version = "6-0-609-0";
 
-  name = "geogebra-${version}";
-  version = "6-0-600-0";
+  srcIcon = geogebra.srcIcon;
+  desktopItem = geogebra.desktopItem;
 
-  src = fetchurl {
-    urls = [
-        "https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
-        "https://web.archive.org/web/20200904093945/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
-      ];
-    sha256 = "1l49rvfkil2cz6r7sa2mi0p6hvb6p66jv3x6xj8hjqls4l3sfhkm";
+  meta = with stdenv.lib; geogebra.meta // {
+    license = licenses.geogebra;
+    maintainers = with maintainers; [ voidless ];
+    platforms = with platforms; linux ++ darwin;
   };
 
-  dontConfigure = true;
-  dontBuild = true;
+  linuxPkg = stdenv.mkDerivation {
+    inherit pname version meta;
 
-  nativeBuildInputs = [
-    unzip
-    makeWrapper
-  ];
+    src = fetchurl {
+      urls = [
+          "https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
+          "https://web.archive.org/web/20201022200156/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
+        ];
+      sha256 = "0rzcbq587x8827g9v03awa9hz27vyfjc0cz45ymbchqp31lsx49b";
+    };
 
-  unpackPhase = ''
-    unzip $src
-  '';
+    dontConfigure = true;
+    dontBuild = true;
 
-  installPhase = ''
-    mkdir -p $out/libexec/geogebra/ $out/bin
-    cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
-    makeWrapper ${stdenv.lib.getBin electron_6}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
-    install -Dm644 "${desktopItem}/share/applications/"* \
-      -t $out/share/applications/
+    nativeBuildInputs = [
+      unzip
+      makeWrapper
+    ];
 
-    install -Dm644 "${srcIcon}" \
-      "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
-  '';
+    unpackPhase = ''
+      unzip $src
+    '';
 
-  srcIcon = geogebra.srcIcon;
+    installPhase = ''
+      mkdir -p $out/libexec/geogebra/ $out/bin
+      cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
+      makeWrapper ${stdenv.lib.getBin electron_6}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
+      install -Dm644 "${desktopItem}/share/applications/"* \
+        -t $out/share/applications/
 
-  desktopItem = geogebra.desktopItem;
-  meta = with stdenv.lib; geogebra.meta // {
-    license = licenses.geogebra;
-    maintainers = with maintainers; [ voidless ];
-    platforms = platforms.linux;
+      install -Dm644 "${srcIcon}" \
+        "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
+    '';
+  };
+
+  darwinPkg = stdenv.mkDerivation {
+    inherit pname version meta;
+
+    src = fetchurl {
+      url = "https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip";
+      sha256 = "0275869zgwbl1qjj593q6629hnxbwk9c15rkm29a3lh10pinb099";
+    };
+
+    dontUnpack = true;
+
+    nativeBuildInputs = [ unzip ];
+
+    installPhase = ''
+      install -dm755 $out/Applications
+      unzip $src -d $out/Applications
+    '';
   };
-}
+in
+if stdenv.isDarwin
+then darwinPkg
+else linuxPkg