From fcce7ff567e1237461bec14d032c970fbe345010 Mon Sep 17 00:00:00 2001 From: whispers Date: Sun, 6 Sep 2026 18:40:50 -0400 Subject: [PATCH] =?UTF-8?q?python3Packages.xmlsec:=20fix=20build=20with=20?= =?UTF-8?q?xmlsec=20=E2=89=A51.3.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/by-name/xm/xmlsec/package.nix | 56 ++++++++++--------- .../python-modules/xmlsec/default.nix | 15 +++++ 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/pkgs/by-name/xm/xmlsec/package.nix b/pkgs/by-name/xm/xmlsec/package.nix index 3addd0afb5fc..6f9fa280756c 100644 --- a/pkgs/by-name/xm/xmlsec/package.nix +++ b/pkgs/by-name/xm/xmlsec/package.nix @@ -9,6 +9,7 @@ openssl, nss, lib, + python3Packages, runCommandCC, writeText, }: @@ -76,34 +77,37 @@ stdenv.mkDerivation (finalAttrs: { moveToOutput "lib/xmlsec1Conf.sh" "$dev" ''; - passthru.tests.libxmlsec1-crypto = - runCommandCC "libxmlsec1-crypto-test" - { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - finalAttrs.finalPackage - libxml2 - libxslt - libtool - ]; - } - '' - $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" '' - #include - #include + passthru.tests = { + python-xmlsec = python3Packages.xmlsec; + libxmlsec1-crypto = + runCommandCC "libxmlsec1-crypto-test" + { + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + finalAttrs.finalPackage + libxml2 + libxslt + libtool + ]; + } + '' + $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" '' + #include + #include - int main(int argc, char **argv) { - return xmlSecInit() || - xmlSecCryptoDLLoadLibrary(argc > 1 ? argv[1] : 0) || - xmlSecCryptoInit(); - } - ''} + int main(int argc, char **argv) { + return xmlSecInit() || + xmlSecCryptoDLLoadLibrary(argc > 1 ? argv[1] : 0) || + xmlSecCryptoInit(); + } + ''} - for crypto in "" gnutls nss openssl; do - ./crypto-test $crypto - done - touch $out - ''; + for crypto in "" gnutls nss openssl; do + ./crypto-test $crypto + done + touch $out + ''; + }; meta = { description = "XML Security Library in C based on libxml2"; diff --git a/pkgs/development/python-modules/xmlsec/default.nix b/pkgs/development/python-modules/xmlsec/default.nix index 81f4571b32e6..ab677396f6df 100644 --- a/pkgs/development/python-modules/xmlsec/default.nix +++ b/pkgs/development/python-modules/xmlsec/default.nix @@ -3,6 +3,7 @@ stdenv, buildPythonPackage, fetchFromGitHub, + fetchpatch, # build-system pkgconfig, @@ -38,6 +39,20 @@ buildPythonPackage (finalAttrs: { hash = "sha256-p3V75DLUI2PKdharP3/0HrKOgma9Kh3lAOZLRAQjo80="; }; + patches = [ + # https://github.com/lsh123/xmlsec/issues/1148 + # https://github.com/xmlsec/python-xmlsec/pull/422 + (fetchpatch { + name = "xmlsec-1.3.11-test-compatibility.patch"; + url = "https://github.com/xmlsec/python-xmlsec/commit/5e8b4e6aa133c358b8aaf8e17ceb5b3b7fea78e8.patch"; + includes = [ + "src/*" + "tests/*" + ]; + hash = "sha256-+J2L6oq802/534qIDvFqsWYfn9LExRlXXIeDvVqZEYk="; + }) + ]; + postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "lxml==" "lxml>=" \