gdk-pixbuf: Add meta.pkgConfigModules and test

This commit is contained in:
John Ericson 2023-02-10 20:53:45 -05:00
parent d43e540f89
commit 36b6027957

View File

@ -19,16 +19,19 @@
, doCheck ? false
, makeWrapper
, lib
, testers
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gdk-pixbuf";
version = "2.42.10";
outputs = [ "out" "dev" "man" "devdoc" ]
++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
src = fetchurl {
src = let
inherit (finalAttrs) pname version;
in fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "7ptsddE7oJaQei48aye2G80X9cfr6rWltDnS8uOf5Es=";
};
@ -97,7 +100,7 @@ stdenv.mkDerivation rec {
'' + lib.optionalString stdenv.isDarwin ''
# meson erroneously installs loaders with .dylib extension on Darwin.
# Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
for f in $out/${passthru.moduleDir}/*.dylib; do
for f in $out/${finalAttrs.passthru.moduleDir}/*.dylib; do
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
mv $f ''${f%.dylib}.so
done
@ -127,12 +130,13 @@ stdenv.mkDerivation rec {
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
packageName = finalAttrs.pname;
versionPolicy = "odd-unstable";
};
tests = {
installedTests = nixosTests.installed-tests.gdk-pixbuf;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
# gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
@ -145,6 +149,7 @@ stdenv.mkDerivation rec {
license = licenses.lgpl21Plus;
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
mainProgram = "gdk-pixbuf-thumbnailer";
pkgConfigModules = [ "gdk-pixbuf-2.0" ];
platforms = platforms.unix;
};
}
})