mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 01:23:03 +00:00
d17f76f05a
geogebra: 5-0-609-0 → 5-0-620-0, geogebra6: 6-0-609-0 → 6-0-620-0
74 lines
2.0 KiB
Nix
74 lines
2.0 KiB
Nix
{ lib, stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
|
|
let
|
|
pname = "geogebra";
|
|
version = "6-0-620-0";
|
|
|
|
srcIcon = geogebra.srcIcon;
|
|
desktopItem = geogebra.desktopItem;
|
|
|
|
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"
|
|
"https://web.archive.org/web/20210101214511/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
|
];
|
|
sha256 = "0xxzmphbfvmhnxnc1pkjgdhccjndyzmlvvaa8xfdrvswwwk7zh43";
|
|
};
|
|
|
|
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/"
|
|
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"
|
|
"https://web.archive.org/web/20210101214236/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
|
];
|
|
sha256 = "13g05d45j6dn9zwxpxnln83j7w1cvcd7l8jnir30pxlmdi7h8r78";
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
installPhase = ''
|
|
install -dm755 $out/Applications
|
|
unzip $src -d $out/Applications
|
|
'';
|
|
};
|
|
in
|
|
if stdenv.isDarwin
|
|
then darwinPkg
|
|
else linuxPkg
|