···1-{ lib, stdenv, fetchurl, jre, unzip, makeWrapper }:
2-3-# Note:
4-# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems
5-# and to $HOME/Library/Preferences on macOS.
6-# (The current trend appears to be to use $HOME/.config/imagej
7-# on linux systems, but we here do not attempt to fix it.)
0089let
10- imagej150 = stdenv.mkDerivation {
11- pname = "imagej";
12- version = "150";
00001314- src = fetchurl {
15- url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip";
16- sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
17- };
18- nativeBuildInputs = [ makeWrapper unzip ];
0000000000019 inherit jre;
02021- # JAR files that are intended to be used by other packages
22- # should go to $out/share/java.
23- # (Some uses ij.jar as a library not as a standalone program.)
24- installPhase = ''
25- mkdir -p $out/share/java
26- # Read permisssion suffices for the jar and others.
27- # Simple cp shall clear suid bits, if any.
28- cp ij.jar $out/share/java
29- cp -dR luts macros plugins $out/share
30- mkdir $out/bin
31- makeWrapper ${jre}/bin/java $out/bin/imagej \
32- --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
00000000000000000033 '';
34- meta = with lib; {
35- homepage = "https://imagej.nih.gov/ij/";
36- description = "Image processing and analysis in Java";
37- longDescription = ''
38- ImageJ is a public domain Java image processing program
39- inspired by NIH Image for the Macintosh.
40- It runs on any computer with a Java 1.4 or later virtual machine.
41- '';
42- license = licenses.publicDomain;
43- platforms = with platforms; linux ++ darwin;
44- maintainers = with maintainers; [ yuriaisaka ];
45- };
46 };
47-in
48- imagej150
···1+{ lib
2+, stdenv
3+, fetchurl
4+, jre
5+, unzip
6+, makeWrapper
7+, makeDesktopItem
8+, copyDesktopItems
9+}:
1011let
12+ icon = fetchurl {
13+ url = "https://imagej.net/media/icons/imagej.png";
14+ sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
15+ };
16+in stdenv.mkDerivation rec {
17+ pname = "imagej";
18+ version = "153";
1920+ src = fetchurl {
21+ url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
22+ sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
23+ };
24+ nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
25+ desktopItems = lib.optionals stdenv.isLinux [
26+ (makeDesktopItem {
27+ name = "ImageJ";
28+ desktopName = "ImageJ";
29+ icon = "imagej";
30+ categories = "Science;Utility;Graphics;";
31+ exec = "imagej";
32+ })
33+ ];
34+35+ passthru = {
36 inherit jre;
37+ };
3839+ # JAR files that are intended to be used by other packages
40+ # should go to $out/share/java.
41+ # (Some uses ij.jar as a library not as a standalone program.)
42+ installPhase = ''
43+ runHook preInstall
44+45+ mkdir -p $out/share/java $out/bin
46+ # Read permisssion suffices for the jar and others.
47+ # Simple cp shall clear suid bits, if any.
48+ cp ij.jar $out/share/java
49+ cp -dR luts macros plugins $out/share
50+ makeWrapper ${jre}/bin/java $out/bin/imagej \
51+ --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
52+53+ runHook postInstall
54+ '';
55+56+ postFixup = lib.optionalString stdenv.isLinux ''
57+ install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
58+ substituteInPlace $out/share/applications/ImageJ.desktop \
59+ --replace Exec=imagej Exec=$out/bin/imagej
60+ '';
61+62+ meta = with lib; {
63+ homepage = "https://imagej.nih.gov/ij/";
64+ description = "Image processing and analysis in Java";
65+ longDescription = ''
66+ ImageJ is a public domain Java image processing program
67+ inspired by NIH Image for the Macintosh.
68+ It runs on any computer with a Java 1.4 or later virtual machine.
69 '';
70+ license = licenses.publicDomain;
71+ platforms = platforms.unix;
72+ maintainers = with maintainers; [ yuriaisaka ];
00000000073 };
74+}
0
···15 name = last (builtins.split "/" nameOrPath);
16 in
1718- pkgs.runCommandLocal name (if types.path.check content then {
19- inherit interpreter;
20- contentPath = content;
21- } else {
22 inherit content interpreter;
23 passAsFile = [ "content" ];
00024 }) ''
25 # On darwin a script cannot be used as an interpreter in a shebang but
26 # there doesn't seem to be a limit to the size of shebang and multiple
···15 name = last (builtins.split "/" nameOrPath);
16 in
1718+ pkgs.runCommandLocal name (if (types.str.check content) then {
00019 inherit content interpreter;
20 passAsFile = [ "content" ];
21+ } else {
22+ inherit interpreter;
23+ contentPath = content;
24 }) ''
25 # On darwin a script cannot be used as an interpreter in a shebang but
26 # there doesn't seem to be a limit to the size of shebang and multiple
···1+# This derivation should be redundant, now that regular smlnj works on Darwin,
2+# and is preserved only for pre-existing direct usage. New use cases should
3+# just use the regular smlnj derivation.
4+5{ lib, stdenv, fetchurl, cpio, rsync, xar, makeWrapper }:
67stdenv.mkDerivation rec {
···1{ lib, stdenv, fetchurl, libvorbis, libogg, libtheora, SDL, libXft, SDL_image, zlib, libX11, libpng, openal, runtimeShell, requireFile, commercialVersion ? false }:
23-let plainName = "andyetitmoves";
4- version = "1.2.2";
5-in
6-7-stdenv.mkDerivation {
8- name = "${plainName}-${version}";
910 src = if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"
11 then
12 let postfix = if stdenv.hostPlatform.system == "i686-linux" then "i386" else "x86_64";
13- commercialName = "${plainName}-${version}_${postfix}.tar.gz";
14- demoUrl = "http://www.andyetitmoves.net/demo/${plainName}Demo-${version}_${postfix}.tar.gz";
15 in
16 if commercialVersion
17 then requireFile {
···1{ lib, stdenv, fetchurl, libvorbis, libogg, libtheora, SDL, libXft, SDL_image, zlib, libX11, libpng, openal, runtimeShell, requireFile, commercialVersion ? false }:
23+stdenv.mkDerivation rec {
4+ pname = "andyetitmoves";
5+ version = "1.2.2";
00067 src = if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"
8 then
9 let postfix = if stdenv.hostPlatform.system == "i686-linux" then "i386" else "x86_64";
10+ commercialName = "${pname}-${version}_${postfix}.tar.gz";
11+ demoUrl = "http://www.andyetitmoves.net/demo/${pname}Demo-${version}_${postfix}.tar.gz";
12 in
13 if commercialVersion
14 then requireFile {
+8-7
pkgs/games/arena/default.nix
···1213in
14stdenv.mkDerivation rec {
15- name = "arena-3.10-beta";
01617 src = fetchurl {
18- url = "http://www.playwitharena.de/downloads/arenalinux_64bit_3.10beta.tar.gz";
19 sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
20 };
21···25 unpackPhase = ''
26 # This is is a tar bomb, i.e. it extract a dozen files and directories to
27 # the top-level, so we must create a sub-directory first.
28- mkdir -p $out/lib/${name}
29- tar -C $out/lib/${name} -xf ${src}
3031 # Remove executable bits from data files. This matters for the find command
32 # we'll use below to find all bundled engines.
33- chmod -x $out/lib/${name}/Engines/*/*.{txt,bin,bmp,zip}
34 '';
3536 buildPhase = ''
37 # Arena has (at least) two executables plus a couple of bundled chess
38 # engines that we need to patch.
39 exes=( $(find $out -name '*x86_64_linux')
40- $(find $out/lib/${name}/Engines -type f -perm /u+x)
41 )
42 for i in "''${exes[@]}"; do
43 # Arminius is statically linked.
···5253 installPhase = ''
54 mkdir -p $out/bin
55- ln -s $out/lib/${name}/Arena_x86_64_linux $out/bin/arena
56 '';
5758 dontStrip = true;
···1213in
14stdenv.mkDerivation rec {
15+ pname = "arena";
16+ version = "3.10-beta";
1718 src = fetchurl {
19+ url = "http://www.playwitharena.de/downloads/arenalinux_64bit_${lib.replaceStrings ["-"] [""] version}.tar.gz";
20 sha256 = "1pzb9sg4lzbbi4gbldvlb85p8xyl9xnplxwyb9pkk2mwzvvxkf0d";
21 };
22···26 unpackPhase = ''
27 # This is is a tar bomb, i.e. it extract a dozen files and directories to
28 # the top-level, so we must create a sub-directory first.
29+ mkdir -p $out/lib/${pname}-${version}
30+ tar -C $out/lib/${pname}-${version} -xf ${src}
3132 # Remove executable bits from data files. This matters for the find command
33 # we'll use below to find all bundled engines.
34+ chmod -x $out/lib/${pname}-${version}/Engines/*/*.{txt,bin,bmp,zip}
35 '';
3637 buildPhase = ''
38 # Arena has (at least) two executables plus a couple of bundled chess
39 # engines that we need to patch.
40 exes=( $(find $out -name '*x86_64_linux')
41+ $(find $out/lib/${pname}-${version}/Engines -type f -perm /u+x)
42 )
43 for i in "''${exes[@]}"; do
44 # Arminius is statically linked.
···5354 installPhase = ''
55 mkdir -p $out/bin
56+ ln -s $out/lib/${pname}-${version}/Arena_x86_64_linux $out/bin/arena
57 '';
5859 dontStrip = true;
···1{ lib, stdenv, requireFile, SDL, libpulseaudio, alsa-lib, runtimeShell }:
23stdenv.mkDerivation rec {
4- name = "vessel-12082012";
056 goBuyItNow = ''
7 We cannot download the full version automatically, as you require a license.
8 Once you bought a license, you need to add your downloaded version to the nix store.
9- You can do this by using "nix-prefetch-url file://\$PWD/${name}-bin" in the
10 directory where you saved it.
11 '';
1213 src = if (stdenv.isi686) then
14 requireFile {
15 message = goBuyItNow;
16- name = "${name}-bin";
17 sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
18 } else throw "unsupported platform ${stdenv.hostPlatform.system} only i686-linux supported for now.";
19
···1{ lib, stdenv, requireFile, SDL, libpulseaudio, alsa-lib, runtimeShell }:
23stdenv.mkDerivation rec {
4+ pname = "vessel";
5+ version = "12082012";
67 goBuyItNow = ''
8 We cannot download the full version automatically, as you require a license.
9 Once you bought a license, you need to add your downloaded version to the nix store.
10+ You can do this by using "nix-prefetch-url file://\$PWD/vessel-${version}-bin" in the
11 directory where you saved it.
12 '';
1314 src = if (stdenv.isi686) then
15 requireFile {
16 message = goBuyItNow;
17+ name = "vessel-${version}-bin";
18 sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
19 } else throw "unsupported platform ${stdenv.hostPlatform.system} only i686-linux supported for now.";
20