gtk: Add meta.pkgConfigModules and test

This commit is contained in:
John Ericson 2023-02-10 20:48:14 -05:00
parent 6861492a22
commit d43e540f89
2 changed files with 31 additions and 9 deletions

View File

@ -5,6 +5,7 @@
, gdktarget ? if stdenv.isDarwin then "quartz" else "x11"
, AppKit, Cocoa
, fetchpatch, buildPackages
, testers
}:
let
@ -17,12 +18,12 @@ let
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gtk+";
version = "2.24.33";
src = fetchurl {
url = "mirror://gnome/sources/gtk+/2.24/${pname}-${version}.tar.xz";
url = "mirror://gnome/sources/gtk+/2.24/${finalAttrs.pname}-${finalAttrs.version}.tar.xz";
sha256 = "rCrHV/WULTGKMRpUsMgLXvKV8pnCpzxjL2v7H/Scxto=";
};
@ -37,7 +38,9 @@ stdenv.mkDerivation rec {
];
nativeBuildInputs = setupHooks ++ [ perl pkg-config gettext gobject-introspection ];
nativeBuildInputs = finalAttrs.setupHooks ++ [
perl pkg-config gettext gobject-introspection
];
patches = [
./patches/2.0-immodules.cache.patch
@ -90,6 +93,7 @@ stdenv.mkDerivation rec {
$out/bin/gtk-query-immodules-2.0 $out/lib/gtk-2.0/2.10.0/immodules/*.so > $out/lib/gtk-2.0/2.10.0/immodules.cache
''; # workaround for bug of nix-mode for Emacs */ '';
inherit gdktarget;
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = with lib; {
@ -97,6 +101,13 @@ stdenv.mkDerivation rec {
homepage = "https://www.gtk.org/";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ lovek323 raskin ];
pkgConfigModules = [
"gdk-2.0"
"gtk+-2.0"
] ++ lib.optionals (gdktarget == "x11") [
"gdk-x11-2.0"
"gtk+-x11-2.0"
];
platforms = platforms.all;
longDescription = ''
@ -111,4 +122,4 @@ stdenv.mkDerivation rec {
'';
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
};
}
})

View File

@ -46,6 +46,7 @@
, QuartzCore
, broadwaySupport ? true
, wayland-scanner
, testers
}:
let
@ -58,7 +59,7 @@ let
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gtk+3";
version = "3.24.36";
@ -70,7 +71,9 @@ stdenv.mkDerivation rec {
gtkCleanImmodulesCache
];
src = fetchurl {
src = let
inherit (finalAttrs) version;
in fetchurl {
url = "mirror://gnome/sources/gtk+/${lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
sha256 = "sha256-J6bvFXdDNQyAf/6lm6odcCJtvt6CpelT/9WOpgWf5pE=";
};
@ -99,7 +102,7 @@ stdenv.mkDerivation rec {
python3
sassc
gdk-pixbuf
] ++ setupHooks ++ lib.optionals withGtkDoc [
] ++ finalAttrs.setupHooks ++ lib.optionals withGtkDoc [
docbook_xml_dtd_43
docbook-xsl-nons
gtk-doc
@ -212,7 +215,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 stdenv.isDarwin ''
# a comment created a cycle between outputs
@ -225,6 +228,7 @@ stdenv.mkDerivation rec {
attrPath = "gtk3";
freeze = true;
};
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = with lib; {
@ -242,7 +246,14 @@ stdenv.mkDerivation rec {
homepage = "https://www.gtk.org/";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ raskin ] ++ teams.gnome.members;
pkgConfigModules = [
"gdk-3.0"
"gtk+-3.0"
] ++ lib.optionals x11Support [
"gdk-x11-3.0"
"gtk+-x11-3.0"
];
platforms = platforms.all;
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
};
}
})