@@ -0,0 +1,55 @@
1+{ stdenv, fetchurl, jre, makeDesktopItem, makeWrapper }:
2+
3+stdenv.mkDerivation rec {
4+ name = "geogebra-${version}";
5+ version = "5.0.265.0";
6+
7+ src = fetchurl {
8+ url = "http://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2";
9+ sha256 = "74e5abfa098ee0fc464cd391cd3ef6db474ff25e8ea4fbcd82c4b4b5d3d5c459";
10+ };
11+
12+ srcIcon = fetchurl {
13+ url = "http://static.geogebra.org/images/geogebra-logo.svg";
14+ sha256 = "55ded6b5ec9ad382494f858d8ab5def0ed6c7d529481cd212863b2edde3b5e07";
15+ };
16+
17+ desktopItem = makeDesktopItem {
18+ name = "geogebra";
19+ exec = "geogebra";
20+ icon = "geogebra";
21+ desktopName = "Geogebra";
22+ genericName = "Geogebra";
23+ comment = meta.description;
24+ categories = "Education;Science;Math;";
25+ mimeType = "application/vnd.geogebra.file;application/vnd.geogebra.tool;";
26+ };
27+
28+ buildInputs = [ makeWrapper ];
29+
30+ installPhase = ''
31+ install -D geogebra/* -t "$out/libexec/geogebra/"
32+
33+ makeWrapper "$out/libexec/geogebra/geogebra" "$out/bin/geogebra" \
34+ --set JAVACMD "${jre}/bin/java" \
35+ --set GG_PATH "$out/libexec/geogebra"
36+
37+ install -Dm644 "${desktopItem}/share/applications/"* \
38+ -t $out/share/applications/
39+
40+ install -Dm644 "${srcIcon}" \
41+ "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
42+ '';
43+
44+ meta = with stdenv.lib; {
45+ description = "Dynamic mathematics software with graphics, algebra and spreadsheets";
46+ longDescription = ''
47+ Dynamic mathematics software for all levels of education that brings
48+ together geometry, algebra, spreadsheets, graphing, statistics and
49+ calculus in one easy-to-use package.
50+ '';
51+ homepage = https://www.geogebra.org/;
52+ license = with licenses; [ gpl3 cc-by-nc-sa-30 geogebra ];
53+ platforms = platforms.all;
54+ };
55+}