···11-{ lib, stdenv, fetchurl, jre, unzip, makeWrapper }:
22-33-# Note:
44-# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems
55-# and to $HOME/Library/Preferences on macOS.
66-# (The current trend appears to be to use $HOME/.config/imagej
77-# on linux systems, but we here do not attempt to fix it.)
11+{ lib
22+, stdenv
33+, fetchurl
44+, jre
55+, unzip
66+, makeWrapper
77+, makeDesktopItem
88+, copyDesktopItems
99+}:
810911let
1010- imagej150 = stdenv.mkDerivation {
1111- pname = "imagej";
1212- version = "150";
1212+ icon = fetchurl {
1313+ url = "https://imagej.net/media/icons/imagej.png";
1414+ sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
1515+ };
1616+in stdenv.mkDerivation rec {
1717+ pname = "imagej";
1818+ version = "153";
13191414- src = fetchurl {
1515- url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip";
1616- sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
1717- };
1818- nativeBuildInputs = [ makeWrapper unzip ];
2020+ src = fetchurl {
2121+ url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
2222+ sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
2323+ };
2424+ nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
2525+ desktopItems = lib.optionals stdenv.isLinux [
2626+ (makeDesktopItem {
2727+ name = "ImageJ";
2828+ desktopName = "ImageJ";
2929+ icon = "imagej";
3030+ categories = "Science;Utility;Graphics;";
3131+ exec = "imagej";
3232+ })
3333+ ];
3434+3535+ passthru = {
1936 inherit jre;
3737+ };
20382121- # JAR files that are intended to be used by other packages
2222- # should go to $out/share/java.
2323- # (Some uses ij.jar as a library not as a standalone program.)
2424- installPhase = ''
2525- mkdir -p $out/share/java
2626- # Read permisssion suffices for the jar and others.
2727- # Simple cp shall clear suid bits, if any.
2828- cp ij.jar $out/share/java
2929- cp -dR luts macros plugins $out/share
3030- mkdir $out/bin
3131- makeWrapper ${jre}/bin/java $out/bin/imagej \
3232- --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
3939+ # JAR files that are intended to be used by other packages
4040+ # should go to $out/share/java.
4141+ # (Some uses ij.jar as a library not as a standalone program.)
4242+ installPhase = ''
4343+ runHook preInstall
4444+4545+ mkdir -p $out/share/java $out/bin
4646+ # Read permisssion suffices for the jar and others.
4747+ # Simple cp shall clear suid bits, if any.
4848+ cp ij.jar $out/share/java
4949+ cp -dR luts macros plugins $out/share
5050+ makeWrapper ${jre}/bin/java $out/bin/imagej \
5151+ --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
5252+5353+ runHook postInstall
5454+ '';
5555+5656+ postFixup = lib.optionalString stdenv.isLinux ''
5757+ install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
5858+ substituteInPlace $out/share/applications/ImageJ.desktop \
5959+ --replace Exec=imagej Exec=$out/bin/imagej
6060+ '';
6161+6262+ meta = with lib; {
6363+ homepage = "https://imagej.nih.gov/ij/";
6464+ description = "Image processing and analysis in Java";
6565+ longDescription = ''
6666+ ImageJ is a public domain Java image processing program
6767+ inspired by NIH Image for the Macintosh.
6868+ It runs on any computer with a Java 1.4 or later virtual machine.
3369 '';
3434- meta = with lib; {
3535- homepage = "https://imagej.nih.gov/ij/";
3636- description = "Image processing and analysis in Java";
3737- longDescription = ''
3838- ImageJ is a public domain Java image processing program
3939- inspired by NIH Image for the Macintosh.
4040- It runs on any computer with a Java 1.4 or later virtual machine.
4141- '';
4242- license = licenses.publicDomain;
4343- platforms = with platforms; linux ++ darwin;
4444- maintainers = with maintainers; [ yuriaisaka ];
4545- };
7070+ license = licenses.publicDomain;
7171+ platforms = platforms.unix;
7272+ maintainers = with maintainers; [ yuriaisaka ];
4673 };
4747-in
4848- imagej150
7474+}
···1515 name = last (builtins.split "/" nameOrPath);
1616 in
17171818- pkgs.runCommandLocal name (if types.path.check content then {
1919- inherit interpreter;
2020- contentPath = content;
2121- } else {
1818+ pkgs.runCommandLocal name (if (types.str.check content) then {
2219 inherit content interpreter;
2320 passAsFile = [ "content" ];
2121+ } else {
2222+ inherit interpreter;
2323+ contentPath = content;
2424 }) ''
2525 # On darwin a script cannot be used as an interpreter in a shebang but
2626 # there doesn't seem to be a limit to the size of shebang and multiple
···11+# This derivation should be redundant, now that regular smlnj works on Darwin,
22+# and is preserved only for pre-existing direct usage. New use cases should
33+# just use the regular smlnj derivation.
44+15{ lib, stdenv, fetchurl, cpio, rsync, xar, makeWrapper }:
2637stdenv.mkDerivation rec {
···11{ lib, stdenv, fetchurl, libvorbis, libogg, libtheora, SDL, libXft, SDL_image, zlib, libX11, libpng, openal, runtimeShell, requireFile, commercialVersion ? false }:
2233-let plainName = "andyetitmoves";
44- version = "1.2.2";
55-in
66-77-stdenv.mkDerivation {
88- name = "${plainName}-${version}";
33+stdenv.mkDerivation rec {
44+ pname = "andyetitmoves";
55+ version = "1.2.2";
96107 src = if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"
118 then
129 let postfix = if stdenv.hostPlatform.system == "i686-linux" then "i386" else "x86_64";
1313- commercialName = "${plainName}-${version}_${postfix}.tar.gz";
1414- demoUrl = "http://www.andyetitmoves.net/demo/${plainName}Demo-${version}_${postfix}.tar.gz";
1010+ commercialName = "${pname}-${version}_${postfix}.tar.gz";
1111+ demoUrl = "http://www.andyetitmoves.net/demo/${pname}Demo-${version}_${postfix}.tar.gz";
1512 in
1613 if commercialVersion
1714 then requireFile {
+8-7
pkgs/games/arena/default.nix
···12121313in
1414stdenv.mkDerivation rec {
1515- name = "arena-3.10-beta";
1515+ pname = "arena";
1616+ version = "3.10-beta";
16171718 src = fetchurl {
1818- url = "http://www.playwitharena.de/downloads/arenalinux_64bit_3.10beta.tar.gz";
1919+ url = "http://www.playwitharena.de/downloads/arenalinux_64bit_${lib.replaceStrings ["-"] [""] version}.tar.gz";
1920 sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
2021 };
2122···2526 unpackPhase = ''
2627 # This is is a tar bomb, i.e. it extract a dozen files and directories to
2728 # the top-level, so we must create a sub-directory first.
2828- mkdir -p $out/lib/${name}
2929- tar -C $out/lib/${name} -xf ${src}
2929+ mkdir -p $out/lib/${pname}-${version}
3030+ tar -C $out/lib/${pname}-${version} -xf ${src}
30313132 # Remove executable bits from data files. This matters for the find command
3233 # we'll use below to find all bundled engines.
3333- chmod -x $out/lib/${name}/Engines/*/*.{txt,bin,bmp,zip}
3434+ chmod -x $out/lib/${pname}-${version}/Engines/*/*.{txt,bin,bmp,zip}
3435 '';
35363637 buildPhase = ''
3738 # Arena has (at least) two executables plus a couple of bundled chess
3839 # engines that we need to patch.
3940 exes=( $(find $out -name '*x86_64_linux')
4040- $(find $out/lib/${name}/Engines -type f -perm /u+x)
4141+ $(find $out/lib/${pname}-${version}/Engines -type f -perm /u+x)
4142 )
4243 for i in "''${exes[@]}"; do
4344 # Arminius is statically linked.
···52535354 installPhase = ''
5455 mkdir -p $out/bin
5555- ln -s $out/lib/${name}/Arena_x86_64_linux $out/bin/arena
5656+ ln -s $out/lib/${pname}-${version}/Arena_x86_64_linux $out/bin/arena
5657 '';
57585859 dontStrip = true;
···11{ lib, stdenv, requireFile, SDL, libpulseaudio, alsa-lib, runtimeShell }:
2233stdenv.mkDerivation rec {
44- name = "vessel-12082012";
44+ pname = "vessel";
55+ version = "12082012";
5667 goBuyItNow = ''
78 We cannot download the full version automatically, as you require a license.
89 Once you bought a license, you need to add your downloaded version to the nix store.
99- You can do this by using "nix-prefetch-url file://\$PWD/${name}-bin" in the
1010+ You can do this by using "nix-prefetch-url file://\$PWD/vessel-${version}-bin" in the
1011 directory where you saved it.
1112 '';
12131314 src = if (stdenv.isi686) then
1415 requireFile {
1516 message = goBuyItNow;
1616- name = "${name}-bin";
1717+ name = "vessel-${version}-bin";
1718 sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
1819 } else throw "unsupported platform ${stdenv.hostPlatform.system} only i686-linux supported for now.";
1920