forked from mirrors/nixpkgs
Merge pull request #68488 from B4dM4n/xmlsec-dlsearchdir
xmlsec: add library path to lt_dladdsearchdir
This commit is contained in:
commit
c2ea7318be
|
@ -1,6 +1,7 @@
|
|||
{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkgconfig, libgcrypt, libtool
|
||||
, openssl, nss, makeWrapper }:
|
||||
, openssl, nss, lib, runCommandCC, writeText }:
|
||||
|
||||
lib.fix (self:
|
||||
let
|
||||
version = "1.2.28";
|
||||
in
|
||||
|
@ -13,9 +14,16 @@ stdenv.mkDerivation {
|
|||
sha256 = "1m12caglhyx08g8lh2sl3nkldlpryzdx2d572q73y3m33s0w9vhk";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./lt_dladdsearchdir.patch
|
||||
];
|
||||
postPatch = ''
|
||||
substituteAllInPlace src/dl.c
|
||||
'';
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss ];
|
||||
|
||||
|
@ -34,8 +42,26 @@ stdenv.mkDerivation {
|
|||
moveToOutput "lib/xmlsec1Conf.sh" "$dev"
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram "$out/bin/xmlsec1" --prefix LD_LIBRARY_PATH ":" "$out/lib"
|
||||
passthru.tests.libxmlsec1-crypto = runCommandCC "libxmlsec1-crypto-test"
|
||||
{
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ self libxml2 libxslt libtool ];
|
||||
} ''
|
||||
$CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" ''
|
||||
#include <xmlsec/xmlsec.h>
|
||||
#include <xmlsec/crypto.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
return xmlSecInit() ||
|
||||
xmlSecCryptoDLLoadLibrary(argc > 1 ? argv[1] : 0) ||
|
||||
xmlSecCryptoInit();
|
||||
}
|
||||
''}
|
||||
|
||||
for crypto in "" gcrypt gnutls nss openssl; do
|
||||
./crypto-test $crypto
|
||||
done
|
||||
touch $out
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
@ -47,3 +73,4 @@ stdenv.mkDerivation {
|
|||
updateWalker = true;
|
||||
};
|
||||
}
|
||||
)
|
||||
|
|
16
pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch
Normal file
16
pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
diff --git a/src/dl.c b/src/dl.c
|
||||
index b13f9d46..d761855b 100644
|
||||
--- a/src/dl.c
|
||||
+++ b/src/dl.c
|
||||
@@ -346,6 +346,11 @@ xmlSecCryptoDLInit(void) {
|
||||
xmlSecIOError("lt_dlinit", NULL, NULL);
|
||||
return(-1);
|
||||
}
|
||||
+ ret = lt_dladdsearchdir("@out@/lib");
|
||||
+ if(ret != 0) {
|
||||
+ xmlSecIOError("lt_dladdsearchdir", NULL, NULL);
|
||||
+ return(-1);
|
||||
+ }
|
||||
#endif /* XMLSEC_DL_LIBLTDL */
|
||||
|
||||
return(0);
|
Loading…
Reference in a new issue