blob: 3d8cf49711c8cf152d75f979cd3e5fe209166fc2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{ stdenv
, lib
, fetchurl
, makeWrapper
, autoPatchelfHook
, jdk11
, makeDesktopItem
, copyDesktopItems
, runtimeShell
, unzip
}:
stdenv.mkDerivation rec {
pname = "fiji";
version = "20240614-2117";
src = fetchurl {
url = "https://downloads.imagej.net/fiji/archive/${version}/fiji-nojre.zip";
sha256 = "sha256-OCNnN8CYniNEIfKRHRBoJ3Fo+u5AwXoPJAzUCc4P+f0=";
};
dontBuild = true;
nativeBuildInputs = [ autoPatchelfHook makeWrapper copyDesktopItems unzip ];
buildInputs = [ stdenv.cc.cc.lib ];
desktopItems = [
(makeDesktopItem {
name = "fiji";
exec = "fiji %F";
tryExec = "fiji";
icon = "fiji";
mimeTypes = [ "image/*" ];
comment = "Scientific Image Analysis";
desktopName = "Fiji Is Just ImageJ";
genericName = "Fiji Is Just ImageJ";
categories = [ "Education" "Science" "ImageProcessing" ];
startupNotify = true;
startupWMClass = "fiji-Main";
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,fiji,share/pixmaps}
cp -R * $out/fiji
rm -f $out/fiji/jars/imagej-updater-*.jar
# Don't create a local desktop entry and avoid deprecated garbage
# collection option
cat <<EOF > $out/bin/.fiji-launcher-hack
#!${runtimeShell}
exec \$($out/fiji/ImageJ-linux64 --default-gc --dry-run "\$@")
EOF
chmod +x $out/bin/.fiji-launcher-hack
makeWrapper $out/bin/.fiji-launcher-hack $out/bin/fiji \
--prefix PATH : ${lib.makeBinPath [ jdk11 ]} \
--set JAVA_HOME ${jdk11.home}
ln $out/fiji/images/icon.png $out/share/pixmaps/fiji.png
runHook postInstall
'';
meta = with lib; {
homepage = "https://imagej.net/software/fiji/";
description = "batteries-included distribution of ImageJ2, bundling a lot of plugins which facilitate scientific image analysis";
mainProgram = "fiji";
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode
];
license = with lib.licenses; [ gpl2Plus gpl3Plus bsd2 publicDomain ];
maintainers = with maintainers; [ davisrichard437 ];
};
}
|