summary refs log tree commit diff
path: root/pkgs/development/tools/misc/gpshell
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2016-10-02 13:27:21 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2016-10-05 17:06:15 +0200
commitb0d77698bfb18d435a99ff2ffe4ca807cb0f9002 (patch)
tree6eead5ad59f2628bea7ff07940f0264ef1eab835 /pkgs/development/tools/misc/gpshell
parent10217972014788ec4b756773c602b39e5e3b7e14 (diff)
downloadnixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar.gz
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar.bz2
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar.lz
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar.xz
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.tar.zst
nixpkgs-b0d77698bfb18d435a99ff2ffe4ca807cb0f9002.zip
gpshell: wrap with gppcscconnectionplugin
Fixes this:

  $ echo establish_context | gpshell
  establish_context
  establish_context failed with error 0xFFFFFFFFFFFFFFFF (libgppcscconnectionplugin.so.1.0.1: cannot open shared object file: No such file or directory)

Have to use LD_LIBRARY_PATH instead of patchelf, because it's
libglobalplatform.so.6 (from globalplatform package) that needs
libgppcscconnectionplugin.so.1.0.1, not gpshell itself. And because
RPATH doesn't "propagate" from one ELF to another, the library isn't
found. One can argue that globalplatform should depend on
gppcscconnectionplugin, but it touches on the still-unsolved "plugin"
issue in Nix packaging, so leaving that alone.
Diffstat (limited to 'pkgs/development/tools/misc/gpshell')
-rw-r--r--pkgs/development/tools/misc/gpshell/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/development/tools/misc/gpshell/default.nix b/pkgs/development/tools/misc/gpshell/default.nix
index a4ed3a44f35..f552fe00566 100644
--- a/pkgs/development/tools/misc/gpshell/default.nix
+++ b/pkgs/development/tools/misc/gpshell/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, globalplatform, pcsclite }:
+{ stdenv, fetchurl, pkgconfig, globalplatform, pcsclite, gppcscconnectionplugin
+, makeWrapper
+}:
 
 stdenv.mkDerivation rec {
   name = "gpshell-${version}";
@@ -9,7 +11,11 @@ stdenv.mkDerivation rec {
     sha256 = "19a77zvyf2vazbv17185s4pynhylk2ky8vhl4i8pg9zww29sicqi";
   };
 
-  buildInputs = [ pkgconfig globalplatform pcsclite ];
+  buildInputs = [ pkgconfig globalplatform pcsclite makeWrapper ];
+
+  postFixup = ''
+    wrapProgram "$out/bin/gpshell" --prefix LD_LIBRARY_PATH : "${gppcscconnectionplugin}/lib"
+  '';
 
   meta = with stdenv.lib; {
     homepage = https://sourceforge.net/p/globalplatform/wiki/Home/;