nixpkgs/pkgs/development/libraries/xmlsec/default.nix

78 lines
2.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkgconfig, libgcrypt, libtool
, openssl, nss, lib, runCommandCC, writeText }:
lib.fix (self:
let
2020-10-06 17:20:23 +01:00
version = "1.2.30";
in
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "xmlsec";
inherit version;
src = fetchurl {
url = "https://www.aleksey.com/xmlsec/download/xmlsec1-${version}.tar.gz";
2020-10-06 17:20:23 +01:00
sha256 = "1j5bf7ni45jghyrbf7a14wx2pvfara557zyry7g7h8840c5kd11d";
};
patches = [
./lt_dladdsearchdir.patch
] ++ stdenv.lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
postPatch = ''
substituteAllInPlace src/dl.c
'';
2017-09-25 18:49:21 +01:00
outputs = [ "out" "dev" ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss ];
2017-09-25 18:49:21 +01:00
enableParallelBuilding = true;
doCheck = true;
2020-10-06 17:20:23 +01:00
checkInputs = [ nss.tools ];
# enable deprecated soap headers required by lasso
# https://dev.entrouvert.org/issues/18771
configureFlags = [ "--enable-soap" ];
# otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
2019-10-30 02:23:29 +00:00
NIX_LDFLAGS = "-lgcrypt";
2017-09-25 18:49:21 +01:00
postInstall = ''
moveToOutput "bin/xmlsec1-config" "$dev"
moveToOutput "lib/xmlsec1Conf.sh" "$dev"
'';
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 = {
homepage = "http://www.aleksey.com/xmlsec";
downloadPage = "https://www.aleksey.com/xmlsec/download.html";
description = "XML Security Library in C based on libxml2";
license = stdenv.lib.licenses.mit;
2015-09-23 05:25:53 +01:00
platforms = with stdenv.lib.platforms; linux ++ darwin;
updateWalker = true;
};
}
)