2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
unzip,
|
|
|
|
fetchurl,
|
|
|
|
electron,
|
|
|
|
makeWrapper,
|
|
|
|
geogebra,
|
|
|
|
}:
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
|
|
|
pname = "geogebra";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "6-0-794-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
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
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/";
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
voidless
|
|
|
|
sikmir
|
|
|
|
];
|
2022-12-17 10:02:37 +00:00
|
|
|
license = licenses.geogebra;
|
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
2024-07-27 06:49:29 +00:00
|
|
|
binaryNativeCode # some jars include native binaries
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
2020-11-03 02:18:15 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2024-07-27 06:49:29 +00:00
|
|
|
hydraPlatforms = [ ];
|
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"
|
2023-10-09 19:29:22 +00:00
|
|
|
"https://web.archive.org/web/20230824011801/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-sNCq1Xcx/Y5r+SIRiqQYcG9dVsfIC2Ef5KJf+tgfxC8=";
|
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/"
|
2024-07-27 06:49:29 +00:00
|
|
|
makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra \
|
|
|
|
--add-flags "$out/resources/app" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
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"
|
2023-10-09 19:29:22 +00:00
|
|
|
"https://web.archive.org/web/20230824012900/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-CrSoKAjXiejfJHyv8wIpcRr2d8u/50HnatiDm1CdnGQ=";
|
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
|
2024-09-26 11:04:55 +00:00
|
|
|
if stdenv.hostPlatform.isDarwin then darwinPkg else linuxPkg
|