2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
|
|
|
pname = "geogebra";
|
2021-04-08 16:26:57 +00:00
|
|
|
version = "6-0-631-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-04-08 16:26:57 +00:00
|
|
|
"https://web.archive.org/web/20210406083122/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-04-08 16:26:57 +00:00
|
|
|
sha256 = "1k4jxcvxxjxfrdghs4a29zpp4yid2vh1mfgp8xxr3qlzxnqv92ha";
|
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-01-17 00:15:33 +00:00
|
|
|
makeWrapper ${lib.getBin electron_6}/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-04-08 16:26:57 +00:00
|
|
|
"https://web.archive.org/web/20210406084052/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-04-08 16:26:57 +00:00
|
|
|
sha256 = "0fa680yyz4nry1xvb9v6qqh1mib6grff5d3p7d90nyjlv101p262";
|
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
|