plutovg: Add module testers

This commit is contained in:
Ross Smyth 2025-07-18 11:04:31 -04:00
parent 6f6cc673b8
commit c8366fed27

View File

@ -3,6 +3,8 @@
stdenv,
fetchFromGitHub,
cmake,
testers,
fontFaceCache ? true,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "plutovg";
@ -16,6 +18,8 @@ stdenv.mkDerivation (finalAttrs: {
};
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "PLUTOVG_DISABLE_FONT_FACE_CACHE_LOAD" (!fontFaceCache))
# the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
# (setting it to an absolute path causes include files to go to $out/$out/include,
# because the absolute path is interpreted with root at $out).
@ -27,11 +31,24 @@ stdenv.mkDerivation (finalAttrs: {
cmake
];
passthru.tests = {
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
versionCheck = true;
};
cmake-config = testers.hasCmakeConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [ "plutovg" ];
versionCheck = true;
};
};
meta = {
homepage = "https://github.com/sammycage/plutovg/";
changelog = "https://github.com/sammycage/plutovg/releases/tag/v${finalAttrs.version}";
description = "Tiny 2D vector graphics library in C";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.eymeric ];
pkgConfigModules = [ "plutovg" ];
};
})