nuspell: Refactor to finalAttrs, ctestCheckHook

This commit is contained in:
Ross Smyth
2025-09-10 19:34:06 -04:00
parent c497663ffc
commit 3c718c07e2
2 changed files with 31 additions and 18 deletions
+30 -16
View File
@@ -3,21 +3,23 @@
stdenv,
fetchFromGitHub,
cmake,
ctestCheckHook,
buildPackages,
pkg-config,
icu,
catch2_3,
testers,
enableManpages ? buildPackages.pandoc.compiler.bootstrapAvailable,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "nuspell";
version = "5.1.6";
src = fetchFromGitHub {
owner = "nuspell";
repo = "nuspell";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-U/lHSxpKsBnamf4ikE2aIjEPSU5fxjtuSmhZR0jxMAI=";
};
@@ -25,19 +27,17 @@ stdenv.mkDerivation rec {
cmake
pkg-config
]
++ lib.optionals enableManpages [
buildPackages.pandoc
];
++ lib.optional enableManpages buildPackages.pandoc;
strictDeps = true;
buildInputs = [ catch2_3 ];
propagatedBuildInputs = [ icu ];
cmakeFlags = [
"-DBUILD_TESTING=YES"
]
++ lib.optionals (!enableManpages) [
"-DBUILD_DOCS=OFF"
cmakeFlags = lib.optional (!enableManpages) "-DBUILD_DOCS=OFF";
nativeCheckInputs = [
ctestCheckHook
];
doCheck = true;
@@ -48,13 +48,27 @@ stdenv.mkDerivation rec {
"dev"
];
meta = with lib; {
passthru = {
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
cmake = testers.hasCmakeConfigModules {
moduleNames = [ "Nuspell" ];
package = finalAttrs.finalPackage;
version = finalAttrs.version;
versionCheck = true;
};
};
};
meta = {
description = "Free and open source C++ spell checking library";
mainProgram = "nuspell";
pkgConfigModules = [ "nuspell" ];
homepage = "https://nuspell.github.io/";
platforms = platforms.all;
maintainers = with maintainers; [ fpletz ];
license = licenses.lgpl3Plus;
changelog = "https://github.com/nuspell/nuspell/blob/v${version}/CHANGELOG.md";
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ fpletz ];
license = lib.licenses.lgpl3Plus;
changelog = "https://github.com/nuspell/nuspell/blob/v${finalAttrs.version}/CHANGELOG.md";
};
}
})
+1 -2
View File
@@ -8528,9 +8528,8 @@ with pkgs;
nss = nss_esr;
nssTools = nss.tools;
nuspell = callPackage ../development/libraries/nuspell { };
nuspellWithDicts =
dicts: callPackage ../development/libraries/nuspell/wrapper.nix { inherit dicts; };
dicts: callPackage ../by-name/nu/nuspell/wrapper.nix { inherit dicts; };
nv-codec-headers-9 = nv-codec-headers.override { majorVersion = "9"; };
nv-codec-headers-10 = nv-codec-headers.override { majorVersion = "10"; };