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.
This commit is contained in:
Bjørn Forsman 2016-10-02 13:27:21 +02:00
parent 1021797201
commit b0d77698bf

View File

@ -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/;