libxml2: remove python2 support, don't check for python3

This commit is contained in:
Gutyina Gergő
2025-07-19 00:28:02 +02:00
parent 8dc10e9c4f
commit 2fc3989948
+5 -16
View File
@@ -5,9 +5,7 @@
fetchFromGitLab,
pkg-config,
autoreconfHook,
libintl,
python3,
gettext,
ncurses,
findXMLCatalogs,
libiconv,
@@ -33,7 +31,6 @@
}:
let
python = python3;
# libxml2 is a dependency of xcbuild. Avoid an infinite recursion by using a bootstrap stdenv
# that does not propagate xcrun.
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else stdenv;
@@ -79,16 +76,8 @@ stdenv'.mkDerivation (finalAttrs: {
buildInputs =
lib.optionals pythonSupport [
python
]
++ lib.optionals (pythonSupport && python ? isPy2 && python.isPy2) [
gettext
]
++ lib.optionals (pythonSupport && python ? isPy3 && python.isPy3) [
ncurses
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && pythonSupport && python ? isPy2 && python.isPy2) [
libintl
python3
]
++ lib.optionals zlibSupport [
zlib
@@ -112,15 +101,15 @@ stdenv'.mkDerivation (finalAttrs: {
(lib.enableFeature enableShared "shared")
(lib.withFeature icuSupport "icu")
(lib.withFeature pythonSupport "python")
(lib.optionalString pythonSupport "PYTHON=${python.pythonOnBuildForHost.interpreter}")
(lib.optionalString pythonSupport "PYTHON=${python3.pythonOnBuildForHost.interpreter}")
]
# avoid rebuilds, can be merged into list in version bumps
++ lib.optional enableHttp "--with-http"
++ lib.optional zlibSupport "--with-zlib";
installFlags = lib.optionals pythonSupport [
"pythondir=\"${placeholder "py"}/${python.sitePackages}\""
"pyexecdir=\"${placeholder "py"}/${python.sitePackages}\""
"pythondir=\"${placeholder "py"}/${python3.sitePackages}\""
"pyexecdir=\"${placeholder "py"}/${python3.sitePackages}\""
];
enableParallelBuilding = true;
@@ -135,7 +124,7 @@ stdenv'.mkDerivation (finalAttrs: {
'';
preInstall = lib.optionalString pythonSupport ''
substituteInPlace python/libxml2mod.la --replace-fail "$dev/${python.sitePackages}" "$py/${python.sitePackages}"
substituteInPlace python/libxml2mod.la --replace-fail "$dev/${python3.sitePackages}" "$py/${python3.sitePackages}"
'';
postFixup =