2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
|
|
|
pname = "geogebra";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "6-0-676-0";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
srcIcon = geogebra.srcIcon;
|
|
|
|
desktopItem = geogebra.desktopItem;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
meta = with lib; geogebra.meta // {
|
2020-11-03 02:18:15 +00:00
|
|
|
license = licenses.geogebra;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ voidless sikmir ];
|
2020-11-03 02:18:15 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
linuxPkg = stdenv.mkDerivation {
|
|
|
|
inherit pname version meta;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
2021-12-06 16:07:01 +00:00
|
|
|
"https://web.archive.org/web/20211123222708/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "0wn90n2nd476rkf83gk9vvcpbjflkrvyri50pnmv52j76n023hmm";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
unzip
|
|
|
|
makeWrapper
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
unzip $src
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/libexec/geogebra/ $out/bin
|
|
|
|
cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
|
2021-12-06 16:07:01 +00:00
|
|
|
makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
|
2020-11-03 02:18:15 +00:00
|
|
|
install -Dm644 "${desktopItem}/share/applications/"* \
|
|
|
|
-t $out/share/applications/
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
install -Dm644 "${srcIcon}" \
|
|
|
|
"$out/share/icons/hicolor/scalable/apps/geogebra.svg"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
darwinPkg = stdenv.mkDerivation {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
urls = [
|
|
|
|
"https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
2021-12-06 16:07:01 +00:00
|
|
|
"https://web.archive.org/web/20211124143625/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "1dwv2f94a1c2y10lmy0i66cafynalp7dkqgnpk4f0mk6pir2fdgj";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm755 $out/Applications
|
|
|
|
unzip $src -d $out/Applications
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwinPkg
|
|
|
|
else linuxPkg
|