nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 callPackage,
5 fetchFromGitHub,
6 cmake,
7 ctestCheckHook,
8 doxygen,
9 buildPackages,
10 pkg-config,
11 icu,
12 catch2_3,
13 testers,
14 enableManpages ? buildPackages.pandoc.compiler.bootstrapAvailable,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "nuspell";
19 version = "5.1.7";
20
21 src = fetchFromGitHub {
22 owner = "nuspell";
23 repo = "nuspell";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-CAyM3bzIP0aYNEu94I7I1qlglPx9HJSnEkgEfjNGfvc=";
26 };
27
28 nativeBuildInputs = [
29 cmake
30 doxygen
31 pkg-config
32 ]
33 ++ lib.optional enableManpages buildPackages.pandoc;
34
35 strictDeps = true;
36 buildInputs = [ catch2_3 ];
37
38 propagatedBuildInputs = [ icu ];
39
40 cmakeFlags = lib.optional (!enableManpages) "-DBUILD_DOCS=OFF";
41
42 nativeCheckInputs = [
43 ctestCheckHook
44 ];
45
46 doCheck = true;
47
48 outputs = [
49 "out"
50 "lib"
51 "dev"
52 ];
53
54 passthru = {
55 withDicts = callPackage ./wrapper.nix { nuspell = finalAttrs.finalPackage; };
56
57 tests = {
58 wrapper = testers.testVersion {
59 package = finalAttrs.finalPackage.withDicts (d: [ d.en_US ]);
60 };
61
62 pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
63
64 cmake = testers.hasCmakeConfigModules {
65 moduleNames = [ "Nuspell" ];
66 package = finalAttrs.finalPackage;
67 version = finalAttrs.version;
68 versionCheck = true;
69 };
70 };
71 };
72
73 meta = {
74 description = "Free and open source C++ spell checking library";
75 mainProgram = "nuspell";
76 pkgConfigModules = [ "nuspell" ];
77 homepage = "https://nuspell.github.io/";
78 platforms = lib.platforms.all;
79 maintainers = with lib.maintainers; [ fpletz ];
80 license = lib.licenses.lgpl3Plus;
81 changelog = "https://github.com/nuspell/nuspell/blob/v${finalAttrs.version}/CHANGELOG.md";
82 };
83})