lol
1{ jre, lib, stdenv, fetchurl, makeWrapper, makeDesktopItem }:
2
3let
4
5 desktopItem = makeDesktopItem rec {
6 name = "netlogo";
7 exec = name;
8 icon = name;
9 comment = "A multi-agent programmable modeling environment";
10 desktopName = "NetLogo";
11 categories = "Science;";
12 };
13
14in
15
16stdenv.mkDerivation rec {
17 pname = "netlogo";
18 version = "6.1.1";
19
20 src = fetchurl {
21 url = "https://ccl.northwestern.edu/netlogo/${version}/NetLogo-${version}-64.tgz";
22 sha256 = "1j08df68pgggxqkmpzd369w4h97q0pivmmljdb48hjghx7hacblp";
23 };
24
25 src1 = fetchurl {
26 name = "netlogo.png";
27 url = "https://netlogoweb.org/assets/images/desktopicon.png";
28 sha256 = "1i43lhr31lzva8d2r0dxpcgr58x496gb5vmb0h2da137ayvifar8";
29 };
30
31 nativeBuildInputs = [ makeWrapper ];
32
33 installPhase = ''
34 mkdir -pv $out/share/netlogo $out/share/icons/hicolor/256x256/apps $out/share/applications $out/share/doc
35 cp -rv app $out/share/netlogo
36 cp -v readme.md $out/share/doc/
37
38 # launcher with `cd` is required b/c otherwise the model library isn't usable
39 makeWrapper "${jre}/bin/java" "$out/bin/netlogo" \
40 --run "cd $out/share/netlogo/app" \
41 --add-flags "-jar netlogo-${version}.jar"
42
43 cp $src1 $out/share/icons/hicolor/256x256/apps/netlogo.png
44 cp ${desktopItem}/share/applications/* $out/share/applications
45 '';
46
47 meta = with lib; {
48 description = "A multi-agent programmable modeling environment";
49 longDescription = ''
50 NetLogo is a multi-agent programmable modeling environment. It is used by
51 many tens of thousands of students, teachers and researchers worldwide.
52 '';
53 homepage = "https://ccl.northwestern.edu/netlogo/index.shtml";
54 license = licenses.gpl2;
55 maintainers = [ maintainers.dpaetzel ];
56 platforms = platforms.linux;
57 };
58}