libxml2: add meta.pkgConfigModules and tests.pkg-config

Co-authored-by: Rodney Lorrimar <dev@rodney.id.au>
This commit is contained in:
Eldritch Cookie 2024-01-14 15:24:27 -03:00 committed by Rodney Lorrimar
parent 511914a5fe
commit bee5bd0106
No known key found for this signature in database
GPG Key ID: D8B75C95FB4D1143
2 changed files with 11 additions and 4 deletions

View File

@ -20,6 +20,7 @@
, enableShared ? !stdenv.hostPlatform.isMinGW && !stdenv.hostPlatform.isStatic
, enableStatic ? !enableShared
, gnome
, testers
}:
let
@ -32,7 +33,7 @@ in
assert oldVer -> stdenv.isDarwin; # reduce likelihood of using old libxml2 unintentionally
let
libxml = stdenv.mkDerivation rec {
libxml = stdenv.mkDerivation (finalAttrs: rec {
pname = "libxml2";
version = "2.12.4";
@ -123,6 +124,11 @@ libxml = stdenv.mkDerivation rec {
packageName = pname;
versionPolicy = "none";
};
tests = {
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
};
meta = with lib; {
@ -131,8 +137,9 @@ libxml = stdenv.mkDerivation rec {
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ eelco jtojnar ];
pkgConfigModules = [ "libxml-2.0" ];
};
};
});
in
if oldVer then
libxml.overrideAttrs (attrs: rec {

View File

@ -23639,8 +23639,8 @@ with pkgs;
in pkgs.buildEnv { # slightly hacky
name = "libxml2+py-${res.libxml2.version}";
paths = with libxml2; [ dev bin py ];
# Avoid update.nix conflicts with libxml2.
passthru = builtins.removeAttrs libxml2.passthru [ "updateScript" ];
# Avoid update.nix/tests conflicts with libxml2.
passthru = builtins.removeAttrs libxml2.passthru [ "updateScript" "tests" ];
# the hook to find catalogs is hidden by buildEnv
postBuild = ''
mkdir "$out/nix-support"