1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 buildPackages,
7 pkg-config,
8 icu,
9 catch2_3,
10 enableManpages ? buildPackages.pandoc.compiler.bootstrapAvailable,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "nuspell";
15 version = "5.1.6";
16
17 src = fetchFromGitHub {
18 owner = "nuspell";
19 repo = "nuspell";
20 rev = "v${version}";
21 hash = "sha256-U/lHSxpKsBnamf4ikE2aIjEPSU5fxjtuSmhZR0jxMAI=";
22 };
23
24 nativeBuildInputs =
25 [
26 cmake
27 pkg-config
28 ]
29 ++ lib.optionals enableManpages [
30 buildPackages.pandoc
31 ];
32
33 buildInputs = [ catch2_3 ];
34
35 propagatedBuildInputs = [ icu ];
36
37 cmakeFlags =
38 [
39 "-DBUILD_TESTING=YES"
40 ]
41 ++ lib.optionals (!enableManpages) [
42 "-DBUILD_DOCS=OFF"
43 ];
44
45 doCheck = true;
46
47 outputs = [
48 "out"
49 "lib"
50 "dev"
51 ];
52
53 meta = with lib; {
54 description = "Free and open source C++ spell checking library";
55 mainProgram = "nuspell";
56 homepage = "https://nuspell.github.io/";
57 platforms = platforms.all;
58 maintainers = with maintainers; [ fpletz ];
59 license = licenses.lgpl3Plus;
60 changelog = "https://github.com/nuspell/nuspell/blob/v${version}/CHANGELOG.md";
61 };
62}