nixpkgs-suyu/pkgs/applications/science/math/geogebra/geogebra6.nix

74 lines
2 KiB
Nix
Raw Normal View History

2021-01-15 14:21:58 +01:00
{ lib, stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
let
pname = "geogebra";
2021-04-06 10:52:30 +02:00
version = "6-0-631-0";
srcIcon = geogebra.srcIcon;
desktopItem = geogebra.desktopItem;
2021-01-15 14:21:58 +01:00
meta = with lib; geogebra.meta // {
license = licenses.geogebra;
maintainers = with maintainers; [ voidless sikmir ];
platforms = with platforms; linux ++ darwin;
};
linuxPkg = stdenv.mkDerivation {
inherit pname version meta;
src = fetchurl {
urls = [
"https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
2021-04-06 10:52:30 +02:00
"https://web.archive.org/web/20210406083122/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
];
2021-04-06 10:52:30 +02:00
sha256 = "1k4jxcvxxjxfrdghs4a29zpp4yid2vh1mfgp8xxr3qlzxnqv92ha";
};
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [
unzip
makeWrapper
];
unpackPhase = ''
unzip $src
'';
installPhase = ''
mkdir -p $out/libexec/geogebra/ $out/bin
cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
2021-01-15 14:21:58 +01:00
makeWrapper ${lib.getBin electron_6}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
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;
src = fetchurl {
urls = [
"https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
2021-04-06 10:52:30 +02:00
"https://web.archive.org/web/20210406084052/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
];
2021-04-06 10:52:30 +02:00
sha256 = "0fa680yyz4nry1xvb9v6qqh1mib6grff5d3p7d90nyjlv101p262";
};
dontUnpack = true;
nativeBuildInputs = [ unzip ];
installPhase = ''
install -dm755 $out/Applications
unzip $src -d $out/Applications
'';
};
in
if stdenv.isDarwin
then darwinPkg
else linuxPkg