tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
rescuetime: use patchelf to avoid LD_PRELOAD hack
Domen Kožar
8 years ago
23984e78
fb346c34
+5
-12
1 changed file
expand all
collapse all
unified
split
pkgs
applications
misc
rescuetime
default.nix
+5
-12
pkgs/applications/misc/rescuetime/default.nix
···
11
url = "https://www.rescuetime.com/installers/rescuetime_current_amd64.deb";
12
sha256 = "0b56iglg8g45biddwsdn1hmx9gsz4kxr64civwyy7f69f022ppab";
13
};
14
-
15
-
in
16
-
17
-
stdenv.mkDerivation {
18
# https://www.rescuetime.com/updates/linux_release_notes.html
19
name = "rescuetime-2.10.0.1322";
20
inherit src;
21
buildInputs = [ dpkg makeWrapper ];
0
0
22
unpackPhase = ''
23
mkdir pkg
24
dpkg-deb -x $src pkg
25
sourceRoot=pkg
26
'';
27
-
installPhase = let
28
-
29
-
lib = p: stdenv.lib.makeLibraryPath [ p ];
30
-
31
-
in ''
32
mkdir -p $out/bin
33
cp usr/bin/rescuetime $out/bin
34
35
${patchelf}/bin/patchelf \
36
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
0
37
$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
'';
42
meta = with lib; {
43
description = "Helps you understand your daily habits so you can focus and be more productive";
···
11
url = "https://www.rescuetime.com/installers/rescuetime_current_amd64.deb";
12
sha256 = "0b56iglg8g45biddwsdn1hmx9gsz4kxr64civwyy7f69f022ppab";
13
};
14
+
in stdenv.mkDerivation {
0
0
0
15
# https://www.rescuetime.com/updates/linux_release_notes.html
16
name = "rescuetime-2.10.0.1322";
17
inherit src;
18
buildInputs = [ dpkg makeWrapper ];
19
+
# avoid https://github.com/NixOS/patchelf/issues/99
20
+
dontStrip = true;
21
unpackPhase = ''
22
mkdir pkg
23
dpkg-deb -x $src pkg
24
sourceRoot=pkg
25
'';
26
+
installPhase = ''
0
0
0
0
27
mkdir -p $out/bin
28
cp usr/bin/rescuetime $out/bin
29
30
${patchelf}/bin/patchelf \
31
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
32
+
--set-rpath "${lib.makeLibraryPath [ qt4 libXtst libXext libX11 libXScrnSaver ]}" \
33
$out/bin/rescuetime
0
0
0
34
'';
35
meta = with lib; {
36
description = "Helps you understand your daily habits so you can focus and be more productive";