diff --git a/pkgs/tools/security/jd-gui/default.nix b/pkgs/tools/security/jd-gui/default.nix index 106fbf0a150a..32bc1a4d7119 100644 --- a/pkgs/tools/security/jd-gui/default.nix +++ b/pkgs/tools/security/jd-gui/default.nix @@ -1,8 +1,22 @@ -{ stdenv, fetchurl, gtk2, atk, gdk_pixbuf, pango, makeWrapper }: +{ stdenv, fetchurl, gtk2, atk, gdk_pixbuf, glib, pango, fontconfig, zlib, xorg, upx, patchelf }: let dynlibPath = stdenv.lib.makeLibraryPath - [ gtk2 atk gdk_pixbuf pango ]; + ([ gtk2 atk gdk_pixbuf glib pango fontconfig zlib stdenv.cc.cc.lib ] + ++ (with xorg; [ + libX11 + libXext + libXrender + libXrandr + libSM + libXfixes + libXdamage + libXcursor + libXinerama + libXi + libXcomposite + libXxf86vm + ])); in stdenv.mkDerivation rec { name = "jd-gui-${version}"; @@ -13,14 +27,18 @@ stdenv.mkDerivation rec { sha256 = "0jrvzs2s836yvqi41c7fq0gfiwf187qg765b9r1il2bjc0mb3dqv"; }; - buildInputs = [ makeWrapper ]; + nativeBuildInputs = [ upx patchelf ]; phases = "unpackPhase installPhase"; unpackPhase = "tar xf ${src}"; installPhase = '' - mkdir -p $out/bin && mv jd-gui $out/bin - wrapProgram $out/bin/jd-gui \ - --prefix LD_LIBRARY_PATH ":" "${dynlibPath}" + mkdir -p $out/bin + upx -d jd-gui -o $out/bin/jd-gui + + patchelf \ + --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ + --set-rpath ${dynlibPath} \ + $out/bin/jd-gui ''; meta = {