lol

Merge pull request #176693 from klemensn/digidoc-rpath-opensc

digidoc: Replace wrap with rpath addition

authored by

Florian Klink and committed by
GitHub
2de7c6f1 f471bc27

+14 -10
+7 -7
pkgs/development/libraries/libdigidocpp/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchpatch, cmake, makeWrapper, minizip, pcsclite, opensc, openssl 1 + { lib, stdenv, fetchurl, fetchpatch, cmake, minizip, pcsclite, opensc, openssl 2 2 , xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }: 3 3 4 4 stdenv.mkDerivation rec { ··· 22 22 }) 23 23 ]; 24 24 25 - nativeBuildInputs = [ cmake makeWrapper pkg-config xxd ]; 25 + nativeBuildInputs = [ cmake pkg-config xxd ]; 26 26 27 27 buildInputs = [ 28 28 minizip pcsclite opensc openssl xercesc ··· 31 31 32 32 outputs = [ "out" "lib" "dev" "bin" ]; 33 33 34 - # replace this hack with a proper cmake variable or environment variable 35 - # once https://github.com/open-eid/cmake/pull/34 (or #35) gets merged. 36 - postInstall = '' 37 - wrapProgram $bin/bin/digidoc-tool \ 38 - --prefix LD_LIBRARY_PATH : ${opensc}/lib/pkcs11/ 34 + # libdigidocpp.so's `PKCS11Signer::PKCS11Signer()` dlopen()s "opensc-pkcs11.so" 35 + # itself, so add OpenSC to its DT_RUNPATH after the fixupPhase shrinked it. 36 + # https://github.com/open-eid/cmake/pull/35 might be an alternative. 37 + postFixup = '' 38 + patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so 39 39 ''; 40 40 41 41 meta = with lib; {
+7 -3
pkgs/tools/security/qdigidoc/default.nix
··· 35 35 qttranslations 36 36 ]; 37 37 38 - # replace this hack with a proper cmake variable or environment variable 39 - # once https://github.com/open-eid/cmake/pull/34 (or #35) gets merged. 38 + # qdigidoc4's `QPKCS11::reload()` dlopen()s "opensc-pkcs11.so" in QLibrary, 39 + # i.e. OpenSC's module is searched for in libQt5Core's DT_RUNPATH and fixing 40 + # qdigidoc4's DT_RUNPATH has no effect on Linux (at least OpenBSD's ld.so(1) 41 + # searches the program's runtime path as well). 42 + # LD_LIBRARY_PATH takes precedence for all calling objects, see dlopen(3). 43 + # https://github.com/open-eid/cmake/pull/35 might be an alternative. 40 44 qtWrapperArgs = [ 41 - "--prefix LD_LIBRARY_PATH : ${opensc}/lib/pkcs11/" 45 + "--prefix LD_LIBRARY_PATH : ${opensc}/lib/pkcs11/" 42 46 ]; 43 47 44 48 meta = with lib; {