2020-08-20 17:08:02 +00:00
|
|
|
{ stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
|
|
|
pname = "geogebra";
|
|
|
|
version = "6-0-609-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
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
meta = with stdenv.lib; geogebra.meta // {
|
|
|
|
license = licenses.geogebra;
|
|
|
|
maintainers = with maintainers; [ voidless ];
|
|
|
|
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 = [
|
|
|
|
"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";
|
|
|
|
};
|
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/"
|
|
|
|
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/
|
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 {
|
|
|
|
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
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwinPkg
|
|
|
|
else linuxPkg
|