diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-01-15 10:30:44 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-01-15 10:30:44 +0000 |
commit | e0794be8a0d11e90461e5a9c85012a36b93ec976 (patch) | |
tree | efd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/applications/science/math/geogebra/default.nix | |
parent | 3538874082ded7647b1ccec0343c7c1e882cfef3 (diff) | |
parent | 1a57d96edd156958b12782e8c8b6a374142a7248 (diff) | |
download | nixlib-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/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/science/math/geogebra/default.nix | 94 |
1 files changed, 60 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix index 5cebef83a4a9..a0548ffb232b 100644 --- a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix +++ b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix @@ -1,18 +1,7 @@ -{ stdenv, fetchurl, jre, makeDesktopItem, makeWrapper, language ? "en_US" }: - -stdenv.mkDerivation rec { +{ stdenv, fetchurl, jre, makeDesktopItem, makeWrapper, unzip, language ? "en_US" }: +let pname = "geogebra"; - version = "5-0-593-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 = "d84c27a3299e6df08881733d22215a18decedcba4c2d97a9e5424c39cd57db35"; - }; + version = "5-0-609-0"; srcIcon = fetchurl { url = "http://static.geogebra.org/images/geogebra-logo.svg"; @@ -30,23 +19,6 @@ stdenv.mkDerivation rec { 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 = '' @@ -55,9 +27,63 @@ stdenv.mkDerivation rec { calculus in one easy-to-use package. ''; homepage = "https://www.geogebra.org/"; - maintainers = with maintainers; [ ma27 ]; + maintainers = with maintainers; [ ]; license = with licenses; [ gpl3 cc-by-nc-sa-30 geogebra ]; - platforms = platforms.all; + platforms = with platforms; linux ++ darwin; hydraPlatforms = []; }; -} + + linuxPkg = stdenv.mkDerivation { + inherit pname version meta srcIcon desktopItem; + + preferLocalBuild = true; + + src = fetchurl { + urls = [ + "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2" + "http://web.archive.org/web/20201022200454/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2" + ]; + sha256 = "0xbhg8hm3dqm3qkraj48pqwslrnjyxpq9mcgylr2m8i1gmqw7xwf"; + }; + + nativeBuildInputs = [ 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" + ''; + }; + + darwinPkg = stdenv.mkDerivation { + inherit pname version meta; + + preferLocalBuild = true; + + src = fetchurl { + url = "https://download.geogebra.org/installers/5.0/GeoGebra-MacOS-Installer-withJava-${version}.zip"; + sha256 = "16fgqwxz31cfmia0pyzpk05aqzrqr11sjbw37q9zb3xfh3p1r4gz"; + }; + + dontUnpack = true; + + nativeBuildInputs = [ unzip ]; + + installPhase = '' + install -dm755 $out/Applications + unzip $src -d $out/Applications + ''; + }; +in +if stdenv.isDarwin +then darwinPkg +else linuxPkg |