15 url = "https://imagej.net/media/icons/imagej.png";
16 sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
18 in stdenv.mkDerivation rec {
23 url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
24 sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
26 nativeBuildInputs = [ copyDesktopItems makeWrapper unzip wrapGAppsHook3 ];
27 buildInputs = [ glib ];
30 desktopItems = lib.optionals stdenv.hostPlatform.isLinux [
33 desktopName = "ImageJ";
35 categories = [ "Science" "Utility" "Graphics" ];
44 # JAR files that are intended to be used by other packages
45 # should go to $out/share/java.
46 # (Some uses ij.jar as a library not as a standalone program.)
50 mkdir -p $out/share/java $out/bin
51 # Read permisssion suffices for the jar and others.
52 # Simple cp shall clear suid bits, if any.
53 cp ij.jar $out/share/java
54 cp -dR luts macros plugins $out/share
59 postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
60 makeWrapper ${jre}/bin/java $out/bin/imagej \
61 ''${gappsWrapperArgs[@]} \
62 --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
64 install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
65 substituteInPlace $out/share/applications/ImageJ.desktop \
66 --replace Exec=imagej Exec=$out/bin/imagej
70 homepage = "https://imagej.nih.gov/ij/";
71 description = "Image processing and analysis in Java";
73 ImageJ is a public domain Java image processing program
74 inspired by NIH Image for the Macintosh.
75 It runs on any computer with a Java 1.4 or later virtual machine.
77 sourceProvenance = with sourceTypes; [ binaryBytecode ];
78 license = licenses.publicDomain;
79 platforms = platforms.unix;
80 maintainers = with maintainers; [ yuriaisaka ];
81 mainProgram = "imagej";