git.iko.soy/typeable/nixpkgs
on master help sign in
enpass: fix install to work with browser extensions
commit0465b1407bc0b69c2b35e281fbafb615715ef280 authorGuillaume Koenig <guillaume.edward.koenig@gmail.com> dateSun 4 Dec 2016, 17:25 (10 years ago) parenteb01090
1 file changed+16−9
pkgs/tools/security/enpass/default.nix+16−9
pkgs/tools/security/enpass/default.nix+16−9
@@ -1,7 +1,8 @@
11{stdenv, system, fetchurl, dpkg, openssl, xorg
22, glib, mesa, libpulseaudio, zlib, dbus, fontconfig, freetype
33, gtk2, pango, atk, cairo, gdk_pixbuf, jasper, xkeyboardconfig
4−, makeWrapper , makeDesktopItem, python, pythonPackages, lib}:
4+, makeWrapper , makeDesktopItem, python, pythonPackages, lib
5+, libredirect, lsof}:
56assert system == "i686-linux" || system == "x86_64-linux";
67let
78 all_data = (with builtins; fromJSON (readFile ./data.json));
@@ -13,7 +14,7 @@ let
1314 data = (with builtins; getAttr (getAttr system system_map) all_data);
1415
1516 baseUrl = http://repo.sinew.in;
16−
17+
1718 # used of both wrappers and libpath
1819 libPath = lib.makeLibraryPath (with xorg; [
1920 openssl
@@ -66,28 +67,34 @@ let
6667 cp -r opt/Enpass/* $out
6768 cp -r usr/* $out
6869 rm $out/bin/runenpass.sh
70+ cp $out/bin/EnpassHelper/EnpassHelper{,.untampered}
6971
7072 sed \
7173 -i s@/opt/Enpass/bin/runenpass.sh@$out/bin/Enpass@ \
72− $out/share/applications/enpass.desktop
74+ $out/share/applications/enpass.desktop
7375
74− patchelf \
75− --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
76− $out/bin/Enpass
76+ for i in $out/bin/{Enpass,EnpassHelper/EnpassHelper}; do
77+ patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i
78+ done
7779
80+ # The helper's sha256 sum must match, hence the use of libredirect.
81+ # Also, lsof must be in the path for proper operation.
7882 wrapProgram $out/bin/Enpass \
7983 --set LD_LIBRARY_PATH "${libPath}:$out/lib:$out/plugins/sqldrivers" \
8084 --set QT_PLUGIN_PATH "$out/plugins" \
8185 --set QT_QPA_PLATFORM_PLUGIN_PATH "$out/plugins/platforms" \
8286 --set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb" \
83− --set HIDE_TOOLBAR_LINE 0
87+ --set HIDE_TOOLBAR_LINE 0 \
88+ --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
89+ --set NIX_REDIRECTS "$out/bin/EnpassHelper/EnpassHelper=$out/bin/EnpassHelper/EnpassHelper.untampered" \
90+ --prefix PATH : ${lsof}/bin
8491 '';
8592 };
8693 updater = {
8794 update = stdenv.mkDerivation rec {
8895 name = "enpass-update-script";
8996 SCRIPT =./update_script.py;
90−
97+
9198 buildInputs = with pythonPackages; [python requests pathlib2 six attrs ];
9299 shellHook = ''
93100 exec python $SCRIPT --target pkgs/tools/security/enpass/data.json --repo ${baseUrl}
@@ -95,4 +102,4 @@ let
95102
96103 };
97104 };
98−in (package // {refresh = updater;})
105+in (package // {refresh = updater;})