summary refs log tree commit diff
path: root/pkgs/applications/graphics/imagej/default.nix
diff options
context:
space:
mode:
authorYuri Aisaka <yuriaisaka@users.noreply.github.com>2017-05-05 15:00:38 +0900
committerJörg Thalheim <Mic92@users.noreply.github.com>2017-05-05 07:00:38 +0100
commit17d2ff414d83095361c2070f1cdaf57c016af9c7 (patch)
tree8ad8d21bc4fab5ce472a9368561668bee8c0a132 /pkgs/applications/graphics/imagej/default.nix
parent244b05e5e5ada2a9d16a2b0a49167d52cea1ed3f (diff)
downloadnixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar.gz
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar.bz2
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar.lz
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar.xz
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.tar.zst
nixpkgs-17d2ff414d83095361c2070f1cdaf57c016af9c7.zip
imagej: init at 150 (#25249)
* imagej: init at 150

* correcting for PR comments
Diffstat (limited to 'pkgs/applications/graphics/imagej/default.nix')
-rw-r--r--pkgs/applications/graphics/imagej/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/imagej/default.nix b/pkgs/applications/graphics/imagej/default.nix
new file mode 100644
index 00000000000..673361c734e
--- /dev/null
+++ b/pkgs/applications/graphics/imagej/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, jre, unzip, makeWrapper }:
+
+# Note:
+# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems
+#   and to $HOME/Library/Preferences on macOS.
+#  (The current trend appears to be to use $HOME/.config/imagej
+#    on linux systems, but we here do not attempt to fix it.)
+
+let
+  imagej150 = stdenv.mkDerivation rec {
+    name = "imagej-${version}";
+    version = "150";
+
+    src = fetchurl {
+      url = "http://wsr.imagej.net/distros/cross-platform/ij150.zip";
+      sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
+    };
+    buildInputs = [ unzip makeWrapper ];
+    inherit jre;
+
+    # JAR files that are intended to be used by other packages
+    # should go to $out/share/java.
+    # (Some uses ij.jar as a library not as a standalone program.)
+    installPhase = ''
+      mkdir -p $out/share/java
+      # Read permisssion suffices for the jar and others.
+      # Simple cp shall clear suid bits, if any.
+      cp ij.jar $out/share/java
+      cp -dR luts macros plugins $out/share
+      mkdir $out/bin
+      makeWrapper ${jre}/bin/java $out/bin/imagej \
+        --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
+    '';
+    meta = with stdenv.lib; {
+      homepage = https://imagej.nih.gov/ij/;
+      description = "Image processing and analysis in Java";
+      longDescription = ''
+        ImageJ is a public domain Java image processing program
+        inspired by NIH Image for the Macintosh.
+        It runs on any computer with a Java 1.4 or later virtual machine.
+      '';
+      license = licenses.publicDomain;
+      platforms = with platforms; linux ++ darwin;
+      maintainers = with maintainers; [ yuriaisaka ];
+    };
+  };
+in
+  imagej150