libxml2: prepare for multiple versions

This commit is contained in:
Gutyina Gergő
2025-07-19 00:30:51 +02:00
parent e67ade88a3
commit febeabf314
3 changed files with 40 additions and 15 deletions

View File

@@ -2,7 +2,6 @@
stdenv,
darwin,
lib,
fetchFromGitLab,
pkg-config,
autoreconfHook,
python3,
@@ -28,6 +27,10 @@
gnome,
testers,
enableHttp ? false,
version,
src,
extraMeta ? { },
}:
let
@@ -36,8 +39,12 @@ let
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else stdenv;
in
stdenv'.mkDerivation (finalAttrs: {
inherit
version
src
;
pname = "libxml2";
version = "2.14.5";
outputs =
[
@@ -50,14 +57,6 @@ stdenv'.mkDerivation (finalAttrs: {
++ lib.optional (enableStatic && enableShared) "static";
outputMan = "bin";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "libxml2";
tag = "v${finalAttrs.version}";
hash = "sha256-vxKlw8Kz+fgUP6bhWG2+4346WJVzqG0QvPG/BT7RftQ=";
};
patches = [
# Unmerged ABI-breaking patch required to fix the following security issues:
# - https://gitlab.gnome.org/GNOME/libxslt/-/issues/139
@@ -159,9 +158,6 @@ stdenv'.mkDerivation (finalAttrs: {
description = "XML parsing library for C";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
jtojnar
];
pkgConfigModules = [ "libxml-2.0" ];
};
} // extraMeta;
})

View File

@@ -0,0 +1,26 @@
{
lib,
callPackage,
fetchFromGitLab,
}:
let
packages = {
libxml2 = callPackage ./common.nix {
version = "2.14.5";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "libxml2";
tag = "v${packages.libxml2.version}";
hash = "sha256-vxKlw8Kz+fgUP6bhWG2+4346WJVzqG0QvPG/BT7RftQ=";
};
extraMeta = {
maintainers = with lib.maintainers; [
jtojnar
];
};
};
};
in
packages

View File

@@ -8835,7 +8835,10 @@ with pkgs;
libxcrypt-legacy = libxcrypt.override { enableHashes = "all"; };
libxkbcommon = libxkbcommon_8;
libxml2 = callPackage ../development/libraries/libxml2/common.nix { };
inherit (callPackage ../development/libraries/libxml2 { })
libxml2
;
libxml2Python =
let