2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeDesktopItem, makeWrapper, unzip, language ? "en_US" }:
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "geogebra";
|
2021-06-06 07:54:09 +00:00
|
|
|
version = "5-0-644-0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
srcIcon = fetchurl {
|
|
|
|
url = "http://static.geogebra.org/images/geogebra-logo.svg";
|
|
|
|
sha256 = "01sy7ggfvck350hwv0cla9ynrvghvssqm3c59x4q5lwsxjsxdpjm";
|
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "geogebra";
|
|
|
|
exec = "geogebra";
|
|
|
|
icon = "geogebra";
|
|
|
|
desktopName = "Geogebra";
|
|
|
|
genericName = "Geogebra";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Education;Science;Math;";
|
|
|
|
mimeType = "application/vnd.geogebra.file;application/vnd.geogebra.tool;";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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/";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ sikmir ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ gpl3 cc-by-nc-sa-30 geogebra ];
|
2020-11-03 02:18:15 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
linuxPkg = stdenv.mkDerivation {
|
|
|
|
inherit pname version meta srcIcon desktopItem;
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
|
|
|
"https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
|
2021-06-06 07:54:09 +00:00
|
|
|
"https://web.archive.org/web/20210604132513/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
|
2020-11-03 02:18:15 +00:00
|
|
|
];
|
2021-06-06 07:54:09 +00:00
|
|
|
sha256 = "dd992654175812d8770d94f063fc1430a743e8e0efcae03f51bf9a3a073c2522";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D geogebra/* -t "$out/libexec/geogebra/"
|
|
|
|
|
|
|
|
makeWrapper "$out/libexec/geogebra/geogebra" "$out/bin/geogebra" \
|
|
|
|
--set JAVACMD "${jre}/bin/java" \
|
|
|
|
--set GG_PATH "$out/libexec/geogebra" \
|
|
|
|
--add-flags "--language=${language}"
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
urls = [
|
|
|
|
"https://download.geogebra.org/installers/5.0/GeoGebra-MacOS-Installer-withJava-${version}.zip"
|
|
|
|
"https://web.archive.org/web/20210101213641/https://download.geogebra.org/installers/5.0/GeoGebra-MacOS-Installer-withJava-${version}.zip"
|
|
|
|
];
|
|
|
|
sha256 = "02sbxrns9zvhcfrr68ygv766and6f6b2a3dfarljxszwsviv6ljf";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm755 $out/Applications
|
|
|
|
unzip $src -d $out/Applications
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwinPkg
|
|
|
|
else linuxPkg
|