imagej: Add desktop item and icon
(cherry picked from commit 0750062126633db814ead9298902e845102ab1ba)
This commit is contained in:
parent
487300c6aa
commit
d16a1e9975
@ -4,9 +4,16 @@
|
|||||||
, jre
|
, jre
|
||||||
, unzip
|
, unzip
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, makeDesktopItem
|
||||||
|
, copyDesktopItems
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
let
|
||||||
|
icon = fetchurl {
|
||||||
|
url = "https://imagej.net/media/icons/imagej.png";
|
||||||
|
sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
|
||||||
|
};
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "imagej";
|
pname = "imagej";
|
||||||
version = "150";
|
version = "150";
|
||||||
|
|
||||||
@ -14,7 +21,17 @@ stdenv.mkDerivation {
|
|||||||
url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
|
url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
|
||||||
sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
|
sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [ makeWrapper unzip ];
|
nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
|
||||||
|
desktopItems = lib.optionals stdenv.isLinux [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "ImageJ";
|
||||||
|
desktopName = "ImageJ";
|
||||||
|
icon = "imagej";
|
||||||
|
categories = "Science;Utility;Graphics;";
|
||||||
|
exec = "imagej";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit jre;
|
inherit jre;
|
||||||
};
|
};
|
||||||
@ -36,6 +53,12 @@ stdenv.mkDerivation {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postFixup = lib.optionalString stdenv.isLinux ''
|
||||||
|
install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
|
||||||
|
substituteInPlace $out/share/applications/ImageJ.desktop \
|
||||||
|
--replace Exec=imagej Exec=$out/bin/imagej
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://imagej.nih.gov/ij/";
|
homepage = "https://imagej.nih.gov/ij/";
|
||||||
description = "Image processing and analysis in Java";
|
description = "Image processing and analysis in Java";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user