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";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "6-0-723-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"
|
2022-08-21 13:32:41 +00:00
|
|
|
"https://web.archive.org/web/20220807022226/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "f0b8a5bdadd3599489872ffe8e0bfd9e42ce3d28b1f6072001cc74f7d3e9e647";
|
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 {
|
2022-06-26 10:26:21 +00:00
|
|
|
inherit pname version;
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
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"
|
2022-08-21 13:32:41 +00:00
|
|
|
"https://web.archive.org/web/20220807022337/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "463ca067c5187e0b639b72bef577b2f1bf73c394c9a1a88071c547e3e1c1888c";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm755 $out/Applications
|
|
|
|
unzip $src -d $out/Applications
|
|
|
|
'';
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
meta = meta // {
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwinPkg
|
|
|
|
else linuxPkg
|