From b0d77698bfb18d435a99ff2ffe4ca807cb0f9002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 2 Oct 2016 13:27:21 +0200 Subject: [PATCH] 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. --- pkgs/development/tools/misc/gpshell/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/gpshell/default.nix b/pkgs/development/tools/misc/gpshell/default.nix index a4ed3a44f350..f552fe00566b 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/;