cxxopts: add pkgconfig tests

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Colin
2025-10-07 12:02:45 +02:00
committed by Sefa Eyeoglu
parent 9bdbef688a
commit 313196be92

View File

@@ -6,6 +6,8 @@
cmake, cmake,
icu74, icu74,
pkg-config, pkg-config,
testers,
validatePkgConfig,
enableUnicodeHelp ? true, enableUnicodeHelp ? true,
}: }:
@@ -25,7 +27,13 @@ stdenv.mkDerivation (finalAttrs: {
"-DCXXOPTS_BUILD_EXAMPLES=OFF" "-DCXXOPTS_BUILD_EXAMPLES=OFF"
] ]
++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"; ++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE";
nativeBuildInputs = [ cmake ] ++ lib.optionals enableUnicodeHelp [ pkg-config ]; nativeBuildInputs = [
cmake
]
++ lib.optionals enableUnicodeHelp [
pkg-config
validatePkgConfig
];
doCheck = true; doCheck = true;
@@ -46,11 +54,19 @@ stdenv.mkDerivation (finalAttrs: {
}) })
]; ];
passthru = {
tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
versionCheck = true;
};
};
meta = with lib; { meta = with lib; {
homepage = "https://github.com/jarro2783/cxxopts"; homepage = "https://github.com/jarro2783/cxxopts";
description = "Lightweight C++ GNU-style option parser library"; description = "Lightweight C++ GNU-style option parser library";
license = licenses.mit; license = licenses.mit;
maintainers = [ maintainers.spease ]; maintainers = [ maintainers.spease ];
pkgConfigModules = [ "cxxopts" ];
platforms = platforms.all; platforms = platforms.all;
}; };
}) })