Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 70 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 jre, 6 makeBinaryWrapper, 7 copyDesktopItems, 8 makeDesktopItem, 9}: 10 11let 12 desktopicon = fetchurl { 13 name = "netlogo.png"; 14 url = "https://netlogoweb.org/assets/images/desktopicon.png"; 15 hash = "sha256-KCsXt1dnBNUEBKvusp5JpKOSH7u9gSwaUvvTMDKkg8Q="; 16 }; 17in 18stdenv.mkDerivation (finalAttrs: { 19 pname = "netlogo"; 20 version = "6.4.0"; 21 22 src = fetchurl { 23 url = "https://ccl.northwestern.edu/netlogo/${finalAttrs.version}/NetLogo-${finalAttrs.version}-64.tgz"; 24 hash = "sha256-hkciO0KC4L4+YtycRSB/gkELpj3SiSsIrylAy6pq0d4="; 25 }; 26 27 nativeBuildInputs = [ 28 makeBinaryWrapper 29 copyDesktopItems 30 ]; 31 32 desktopItems = [ 33 (makeDesktopItem { 34 name = "netlogo"; 35 exec = "netlogo"; 36 icon = "netlogo"; 37 comment = "A multi-agent programmable modeling environment"; 38 desktopName = "NetLogo"; 39 categories = [ "Science" ]; 40 }) 41 ]; 42 43 installPhase = '' 44 runHook preInstall 45 46 mkdir -p $out/opt 47 cp -r lib/app $out/opt/netlogo 48 # launcher with `cd` is required b/c otherwise the model library isn't usable 49 makeWrapper ${jre}/bin/java $out/bin/netlogo \ 50 --chdir $out/opt/netlogo \ 51 --add-flags "-jar netlogo-${finalAttrs.version}.jar" 52 install -Dm644 ${desktopicon} $out/share/pixmaps/netlogo.png 53 54 runHook postInstall 55 ''; 56 57 meta = { 58 description = "Multi-agent programmable modeling environment"; 59 mainProgram = "netlogo"; 60 longDescription = '' 61 NetLogo is a multi-agent programmable modeling environment. It is used by 62 many tens of thousands of students, teachers and researchers worldwide. 63 ''; 64 homepage = "https://ccl.northwestern.edu/netlogo/index.shtml"; 65 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; 66 license = lib.licenses.gpl2; 67 maintainers = [ lib.maintainers.dpaetzel ]; 68 platforms = lib.platforms.linux; 69 }; 70})