mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-28 05:40:05 +00:00
libdigidocpp: Replace wrap with rpath addition
libdigidocpp.so itself contains the code to load the PKCS#11 module, not digidoc-tool(1). Wrapping `digitoc-tool` - leaves the library broken - is too broad (LD_LIBRARY_PATH is generic and inherited by children) - needs an extra wrapper script (introducing subtle changes on its own) Considering how dlopen(3) prefers the calling object's DT_RUNPATH, simply amend that.
This commit is contained in:
parent
a58de450c5
commit
ea62d92f63
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl, fetchpatch, cmake, makeWrapper, minizip, pcsclite, opensc, openssl
|
{ lib, stdenv, fetchurl, fetchpatch, cmake, minizip, pcsclite, opensc, openssl
|
||||||
, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
|
, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake makeWrapper pkg-config xxd ];
|
nativeBuildInputs = [ cmake pkg-config xxd ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
minizip pcsclite opensc openssl xercesc
|
minizip pcsclite opensc openssl xercesc
|
||||||
@ -31,11 +31,11 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
outputs = [ "out" "lib" "dev" "bin" ];
|
outputs = [ "out" "lib" "dev" "bin" ];
|
||||||
|
|
||||||
# replace this hack with a proper cmake variable or environment variable
|
# libdigidocpp.so's `PKCS11Signer::PKCS11Signer()` dlopen()s "opensc-pkcs11.so"
|
||||||
# once https://github.com/open-eid/cmake/pull/34 (or #35) gets merged.
|
# itself, so add OpenSC to its DT_RUNPATH after the fixupPhase shrinked it.
|
||||||
postInstall = ''
|
# https://github.com/open-eid/cmake/pull/35 might be an alternative.
|
||||||
wrapProgram $bin/bin/digidoc-tool \
|
postFixup = ''
|
||||||
--prefix LD_LIBRARY_PATH : ${opensc}/lib/pkcs11/
|
patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user