gtk4: 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-12 13:13:12 -03:00 committed by Rodney Lorrimar
parent 0e74ca98a7
commit c28dc44c01
No known key found for this signature in database
GPG Key ID: D8B75C95FB4D1143

View File

@ -54,6 +54,7 @@
, Cocoa
, libexecinfo
, broadwaySupport ? true
, testers
}:
let
@ -66,7 +67,7 @@ let
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gtk4";
version = "4.12.4";
@ -79,7 +80,7 @@ stdenv.mkDerivation rec {
];
src = fetchurl {
url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz";
url = with finalAttrs; "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz";
sha256 = "umfGSY5Vmfko7a+54IoyCt+qUKsvDab8arIlL8LVdSA=";
};
@ -109,7 +110,7 @@ stdenv.mkDerivation rec {
wayland-scanner
] ++ lib.optionals vulkanSupport [
shaderc # for glslc
] ++ setupHooks;
] ++ finalAttrs.setupHooks;
buildInputs = [
libxkbcommon
@ -245,7 +246,7 @@ stdenv.mkDerivation rec {
for program in ''${demos[@]}; do
wrapProgram $dev/bin/$program \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}"
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${finalAttrs.pname}-${finalAttrs.version}"
done
'' + lib.optionalString x11Support ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
@ -258,6 +259,11 @@ stdenv.mkDerivation rec {
versionPolicy = "odd-unstable";
attrPath = "gtk4";
};
tests = {
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
};
meta = with lib; {
@ -276,6 +282,13 @@ stdenv.mkDerivation rec {
license = licenses.lgpl2Plus;
maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
platforms = platforms.all;
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS";
pkgConfigModules = [
"gtk4"
"gtk4-broadway"
"gtk4-unix-print"
"gtk4-wayland"
"gtk4-x11"
];
};
}
})