Skip to content

Commit

Permalink
jd-gui: use copyDesktopItems hook
Browse files Browse the repository at this point in the history
  • Loading branch information
B4dM4n authored and Milan Pässler committed Nov 29, 2020
1 parent 5fbffec commit b65a1ab
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkgs/tools/security/jd-gui/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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/";
Expand Down

0 comments on commit b65a1ab

Please sign in to comment.