diff options
author | Fabian Möller <fabianm88@gmail.com> | 2020-11-27 13:46:36 +0100 |
---|---|---|
committer | Milan Pässler <milan@petabyte.dev> | 2020-11-29 04:26:48 +0100 |
commit | b65a1ab2a4d2e4d34f41e94ef59f2479561bd5c9 (patch) | |
tree | 8829e5317dd8738ac60286051a8d280b1b6d8229 /pkgs/tools/security/jd-gui | |
parent | 5fbffecb1451f49edc007d124aea67fe01712f4b (diff) |
jd-gui: use copyDesktopItems hook
Diffstat (limited to 'pkgs/tools/security/jd-gui')
-rw-r--r-- | pkgs/tools/security/jd-gui/default.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pkgs/tools/security/jd-gui/default.nix b/pkgs/tools/security/jd-gui/default.nix index c4b7706c266b1..91c092922f04a 100644 --- a/pkgs/tools/security/jd-gui/default.nix +++ b/pkgs/tools/security/jd-gui/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, jre, jdk, gradle_5, makeDesktopItem, perl, writeText, runtimeShell }: +{ stdenv, fetchFromGitHub, jre, jdk, gradle_5, makeDesktopItem, copyDesktopItems, perl, writeText, runtimeShell }: let pname = "jd-gui"; @@ -55,9 +55,9 @@ let } ''; - desktopItem = launcher: makeDesktopItem { + desktopItem = makeDesktopItem { name = "jd-gui"; - exec = "${launcher} %F"; + exec = "jd-gui %F"; icon = "jd-gui"; comment = "Java Decompiler JD-GUI"; desktopName = "JD-GUI"; @@ -71,7 +71,7 @@ in stdenv.mkDerivation rec { inherit pname version src; name = "${pname}-${version}"; - nativeBuildInputs = [ jdk gradle_5 ]; + nativeBuildInputs = [ jdk gradle_5 copyDesktopItems ]; buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) @@ -81,6 +81,8 @@ in stdenv.mkDerivation rec { installPhase = let jar = "$out/share/jd-gui/${name}.jar"; in '' + runHook preInstall + mkdir -p $out/bin $out/share/{jd-gui,icons/hicolor/128x128/apps} cp build/libs/${name}.jar ${jar} cp src/linux/resources/jd_icon_128.png $out/share/icons/hicolor/128x128/apps/jd-gui.png @@ -92,9 +94,11 @@ in stdenv.mkDerivation rec { EOF chmod +x $out/bin/jd-gui - ${(desktopItem "$out/bin/jd-gui").buildCommand} + runHook postInstall ''; + desktopItems = [ desktopItem ]; + meta = with stdenv.lib; { description = "Fast Java Decompiler with powerful GUI"; homepage = "https://java-decompiler.github.io/"; |