rescuetime: use patchelf to avoid LD_PRELOAD hack

+5 -12
+5 -12
pkgs/applications/misc/rescuetime/default.nix
··· 11 11 url = "https://www.rescuetime.com/installers/rescuetime_current_amd64.deb"; 12 12 sha256 = "0b56iglg8g45biddwsdn1hmx9gsz4kxr64civwyy7f69f022ppab"; 13 13 }; 14 - 15 - in 16 - 17 - stdenv.mkDerivation { 14 + in stdenv.mkDerivation { 18 15 # https://www.rescuetime.com/updates/linux_release_notes.html 19 16 name = "rescuetime-2.10.0.1322"; 20 17 inherit src; 21 18 buildInputs = [ dpkg makeWrapper ]; 19 + # avoid https://github.com/NixOS/patchelf/issues/99 20 + dontStrip = true; 22 21 unpackPhase = '' 23 22 mkdir pkg 24 23 dpkg-deb -x $src pkg 25 24 sourceRoot=pkg 26 25 ''; 27 - installPhase = let 28 - 29 - lib = p: stdenv.lib.makeLibraryPath [ p ]; 30 - 31 - in '' 26 + installPhase = '' 32 27 mkdir -p $out/bin 33 28 cp usr/bin/rescuetime $out/bin 34 29 35 30 ${patchelf}/bin/patchelf \ 36 31 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 32 + --set-rpath "${lib.makeLibraryPath [ qt4 libXtst libXext libX11 libXScrnSaver ]}" \ 37 33 $out/bin/rescuetime 38 - 39 - wrapProgram $out/bin/rescuetime \ 40 - --prefix LD_PRELOAD : ${lib qt4}/libQtGui.so.4:${lib qt4}/libQtCore.so.4:${lib libXtst}/libXtst.so.6:${lib libXext}/libXext.so.6:${lib libX11}/libX11.so.6:${lib libXScrnSaver}/libXss.so.1 41 34 ''; 42 35 meta = with lib; { 43 36 description = "Helps you understand your daily habits so you can focus and be more productive";