imagej: fix crash with opening dialogs (#142841)
This commit is contained in:
parent
0dbfc99b52
commit
0254860766
@ -1,11 +1,13 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, glib
|
||||
, jre
|
||||
, unzip
|
||||
, makeWrapper
|
||||
, makeDesktopItem
|
||||
, copyDesktopItems
|
||||
, wrapGAppsHook
|
||||
}:
|
||||
|
||||
let
|
||||
@ -21,7 +23,10 @@ in stdenv.mkDerivation rec {
|
||||
url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
|
||||
sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
|
||||
};
|
||||
nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
|
||||
nativeBuildInputs = [ copyDesktopItems makeWrapper unzip wrapGAppsHook ];
|
||||
buildInputs = [ glib ];
|
||||
dontWrapGApps = true;
|
||||
|
||||
desktopItems = lib.optionals stdenv.isLinux [
|
||||
(makeDesktopItem {
|
||||
name = "ImageJ";
|
||||
@ -47,13 +52,15 @@ in stdenv.mkDerivation rec {
|
||||
# Simple cp shall clear suid bits, if any.
|
||||
cp ij.jar $out/share/java
|
||||
cp -dR luts macros plugins $out/share
|
||||
makeWrapper ${jre}/bin/java $out/bin/imagej \
|
||||
--add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postFixup = lib.optionalString stdenv.isLinux ''
|
||||
makeWrapper ${jre}/bin/java $out/bin/imagej \
|
||||
''${gappsWrapperArgs[@]} \
|
||||
--add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
|
||||
|
||||
install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
|
||||
substituteInPlace $out/share/applications/ImageJ.desktop \
|
||||
--replace Exec=imagej Exec=$out/bin/imagej
|
||||
|
Loading…
Reference in New Issue
Block a user