1 { stdenv, fetchurl, libxml2, gnutls, libxslt, pkg-config, libgcrypt, libtool
2 , openssl, nss, lib, runCommandCC, writeText }:
5 stdenv.mkDerivation rec {
10 url = "https://www.aleksey.com/xmlsec/download/xmlsec1-${version}.tar.gz";
11 sha256 = "sha256-Us7UlD81vX0IGKOCmMFSjKSsilRED9cRNKB9LRNwomI=";
15 ./lt_dladdsearchdir.patch
16 ] ++ lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
18 substituteAllInPlace src/dl.c
21 outputs = [ "out" "dev" ];
23 nativeBuildInputs = [ pkg-config ];
25 buildInputs = [ libxml2 gnutls libgcrypt libtool openssl nss ];
27 propagatedBuildInputs = [
28 # required by xmlsec/transforms.h
32 enableParallelBuilding = true;
34 nativeCheckInputs = [ nss.tools ];
36 substituteInPlace tests/testrun.sh \
37 --replace 'timestamp=`date +%Y%m%d_%H%M%S`' 'timestamp=19700101_000000' \
38 --replace 'TMPFOLDER=/tmp' '$(mktemp -d)'
41 # enable deprecated soap headers required by lasso
42 # https://dev.entrouvert.org/issues/18771
43 configureFlags = [ "--enable-soap" ];
45 # otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
46 NIX_LDFLAGS = "-lgcrypt";
49 moveToOutput "bin/xmlsec1-config" "$dev"
50 moveToOutput "lib/xmlsec1Conf.sh" "$dev"
53 passthru.tests.libxmlsec1-crypto = runCommandCC "libxmlsec1-crypto-test"
55 nativeBuildInputs = [ pkg-config ];
56 buildInputs = [ self libxml2 libxslt libtool ];
58 $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" ''
59 #include <xmlsec/xmlsec.h>
60 #include <xmlsec/crypto.h>
62 int main(int argc, char **argv) {
63 return xmlSecInit() ||
64 xmlSecCryptoDLLoadLibrary(argc > 1 ? argv[1] : 0) ||
69 for crypto in "" gcrypt gnutls nss openssl; do
76 description = "XML Security Library in C based on libxml2";
77 homepage = "https://www.aleksey.com/xmlsec/";
78 downloadPage = "https://www.aleksey.com/xmlsec/download.html";
79 license = licenses.mit;
80 mainProgram = "xmlsec1";
81 maintainers = with maintainers; [ ];
82 platforms = with platforms; linux ++ darwin;