a66bca1520
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
89 lines
2.6 KiB
Nix
89 lines
2.6 KiB
Nix
{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
|
|
let
|
|
pname = "geogebra";
|
|
version = "6-0-745-0";
|
|
|
|
srcIcon = geogebra.srcIcon;
|
|
desktopItem = geogebra.desktopItem;
|
|
|
|
meta = with lib; {
|
|
description = "Dynamic mathematics software with graphics, algebra and spreadsheets";
|
|
longDescription = ''
|
|
Dynamic mathematics software for all levels of education that brings
|
|
together geometry, algebra, spreadsheets, graphing, statistics and
|
|
calculus in one easy-to-use package.
|
|
'';
|
|
homepage = "https://www.geogebra.org/";
|
|
maintainers = with maintainers; [ voidless sikmir ];
|
|
license = licenses.geogebra;
|
|
sourceProvenance = with sourceTypes; [
|
|
binaryBytecode
|
|
binaryNativeCode # some jars include native binaries
|
|
];
|
|
platforms = with platforms; linux ++ darwin;
|
|
hydraPlatforms = [];
|
|
};
|
|
|
|
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/20221126110648/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
|
];
|
|
hash = "sha256-UksHZt7bEs/aRzFiJrT1Quz/SFSvA88sdhoi1IEVdBc=";
|
|
};
|
|
|
|
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}/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;
|
|
|
|
src = fetchurl {
|
|
urls = [
|
|
"https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
|
"https://web.archive.org/web/20221126111123/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
|
];
|
|
hash = "sha256-Qn2MD3W5icX45Tfs19oRV8J3lYmL8T+hp7A+crRb9tQ=";
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
installPhase = ''
|
|
install -dm755 $out/Applications
|
|
unzip $src -d $out/Applications
|
|
'';
|
|
|
|
meta = meta // {
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
};
|
|
};
|
|
in
|
|
if stdenv.isDarwin
|
|
then darwinPkg
|
|
else linuxPkg
|