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