summary refs log tree commit diff
path: root/pkgs/development/libraries/xmlsec
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/xmlsec')
-rw-r--r--pkgs/development/libraries/xmlsec/default.nix33
-rw-r--r--pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch12
2 files changed, 31 insertions, 14 deletions
diff --git a/pkgs/development/libraries/xmlsec/default.nix b/pkgs/development/libraries/xmlsec/default.nix
index a1e6afd48b9..71a10764667 100644
--- a/pkgs/development/libraries/xmlsec/default.nix
+++ b/pkgs/development/libraries/xmlsec/default.nix
@@ -1,34 +1,39 @@
-{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkgconfig, libgcrypt, libtool
-, openssl, nss, lib, runCommandCC, writeText }:
+{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkg-config, libgcrypt, libtool
+# nss_3_53 is used instead of the latest due to a number of issues:
+# https://github.com/lsh123/xmlsec/issues?q=is%3Aissue+is%3Aopen+nss
+, openssl, nss_3_53, lib, runCommandCC, writeText }:
 
 lib.fix (self:
-let
-  version = "1.2.28";
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "xmlsec";
-  inherit version;
+  version = "1.2.31";
 
   src = fetchurl {
     url = "https://www.aleksey.com/xmlsec/download/xmlsec1-${version}.tar.gz";
-    sha256 = "1m12caglhyx08g8lh2sl3nkldlpryzdx2d572q73y3m33s0w9vhk";
+    sha256 = "mxC8Uswx5PdhYuOXXlDbJrcatJxXHYELMRymJr5aCyY=";
   };
 
   patches = [
     ./lt_dladdsearchdir.patch
-  ];
+  ] ++ lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
   postPatch = ''
     substituteAllInPlace src/dl.c
   '';
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss ];
+  buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss_3_53 ];
 
   enableParallelBuilding = true;
   doCheck = true;
+  checkInputs = [ nss_3_53.tools ];
+  preCheck = ''
+  substituteInPlace tests/testrun.sh \
+    --replace 'timestamp=`date +%Y%m%d_%H%M%S`' 'timestamp=19700101_000000' \
+    --replace 'TMPFOLDER=/tmp' '$(mktemp -d)'
+  '';
 
   # enable deprecated soap headers required by lasso
   # https://dev.entrouvert.org/issues/18771
@@ -44,7 +49,7 @@ stdenv.mkDerivation {
 
   passthru.tests.libxmlsec1-crypto = runCommandCC "libxmlsec1-crypto-test"
     {
-      nativeBuildInputs = [ pkgconfig ];
+      nativeBuildInputs = [ pkg-config ];
       buildInputs = [ self libxml2 libxslt libtool ];
     } ''
     $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" ''
@@ -68,8 +73,8 @@ stdenv.mkDerivation {
     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;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.mit;
+    platforms = with lib.platforms; linux ++ darwin;
     updateWalker = true;
   };
 }
diff --git a/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch b/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch
new file mode 100644
index 00000000000..700fad7e3dd
--- /dev/null
+++ b/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch
@@ -0,0 +1,12 @@
+--- a/tests/testEnc.sh	2020-04-20 14:30:32.000000000 -0400
++++ b/tests/testEnc.sh	2020-10-21 22:09:25.000000000 -0400
+@@ -405,9 +405,6 @@
+             else
+                 # generate binary file out of base64
+                 DECODE="-d"
+-                if [ "`uname`" = "Darwin" ]; then
+-		    DECODE="-D"
+-                fi
+                 cat "$topfolder/$base_test_name.data" | base64 $DECODE > $tmpfile.3
+                 execEncTest "$res_success" \
+                     "" \