2023-04-16 06:45:11 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2019-09-02 10:11:00 +01:00
|
|
|
, fetchurl
|
|
|
|
, aspell
|
2023-04-16 06:45:11 +01:00
|
|
|
, groff
|
2020-09-12 14:08:04 +01:00
|
|
|
, pkg-config
|
2019-09-02 10:11:00 +01:00
|
|
|
, glib
|
|
|
|
, hunspell
|
|
|
|
, hspell
|
2021-08-09 01:21:18 +01:00
|
|
|
, nuspell
|
2019-09-02 10:11:00 +01:00
|
|
|
, unittest-cpp
|
2024-05-10 15:43:22 +01:00
|
|
|
|
|
|
|
, withHspell ? true
|
|
|
|
, withAspell ? true
|
|
|
|
, withHunspell ? true
|
|
|
|
, withNuspell ? true
|
2024-05-10 15:51:16 +01:00
|
|
|
, withAppleSpell ? stdenv.hostPlatform.isDarwin
|
|
|
|
|
|
|
|
, Cocoa
|
2019-09-02 10:11:00 +01:00
|
|
|
}:
|
2018-03-14 13:56:19 +00:00
|
|
|
|
2024-05-10 15:51:16 +01:00
|
|
|
assert withAppleSpell -> stdenv.hostPlatform.isDarwin;
|
|
|
|
|
2019-07-01 12:59:35 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-14 13:56:19 +00:00
|
|
|
pname = "enchant";
|
2024-04-07 16:41:46 +01:00
|
|
|
version = "2.6.9";
|
2018-03-14 13:56:19 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-07-01 12:59:35 +01:00
|
|
|
url = "https://github.com/AbiWord/${pname}/releases/download/v${version}/${pname}-${version}.tar.gz";
|
2024-04-07 16:41:46 +01:00
|
|
|
hash = "sha256-2aWhDcmzikOzoPoix27W67fgnrU1r/YpVK/NvUDv/2s=";
|
2018-03-14 13:56:19 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:25:54 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2019-09-02 10:11:00 +01:00
|
|
|
nativeBuildInputs = [
|
2023-04-16 06:45:11 +01:00
|
|
|
groff
|
2020-09-12 14:08:04 +01:00
|
|
|
pkg-config
|
2019-09-02 10:11:00 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
2024-05-10 15:43:22 +01:00
|
|
|
] ++ lib.optionals withHunspell [
|
2019-09-02 10:11:00 +01:00
|
|
|
hunspell
|
2024-05-10 15:43:22 +01:00
|
|
|
] ++ lib.optionals withNuspell [
|
2021-08-09 01:21:18 +01:00
|
|
|
nuspell
|
2024-05-10 15:51:16 +01:00
|
|
|
] ++ lib.optionals withAppleSpell [
|
|
|
|
Cocoa
|
2019-09-02 10:11:00 +01:00
|
|
|
];
|
|
|
|
|
2024-01-13 08:25:54 +00:00
|
|
|
checkInputs = [
|
2019-09-02 10:11:00 +01:00
|
|
|
unittest-cpp
|
|
|
|
];
|
|
|
|
|
|
|
|
# libtool puts these to .la files
|
2024-05-10 15:43:22 +01:00
|
|
|
propagatedBuildInputs = lib.optionals withHspell [
|
2019-09-02 10:11:00 +01:00
|
|
|
hspell
|
2024-05-10 15:43:22 +01:00
|
|
|
] ++ lib.optionals withAspell [
|
2019-09-02 10:11:00 +01:00
|
|
|
aspell
|
|
|
|
];
|
2018-03-14 13:56:19 +00:00
|
|
|
|
2019-07-01 12:59:35 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-09-02 08:25:20 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-relocatable" # needed for tests
|
2024-05-10 15:43:22 +01:00
|
|
|
(lib.withFeature withAspell "aspell")
|
|
|
|
(lib.withFeature withHspell "hspell")
|
|
|
|
(lib.withFeature withHunspell "hunspell")
|
|
|
|
(lib.withFeature withNuspell "nuspell")
|
2024-05-10 15:51:16 +01:00
|
|
|
(lib.withFeature withAppleSpell "applespell")
|
2019-09-02 08:25:20 +01:00
|
|
|
];
|
2018-04-25 04:20:18 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-03-14 13:56:19 +00:00
|
|
|
description = "Generic spell checking library";
|
2020-02-28 13:57:41 +00:00
|
|
|
homepage = "https://abiword.github.io/enchant/";
|
2018-03-14 13:56:19 +00:00
|
|
|
license = licenses.lgpl21Plus; # with extra provision for non-free checkers
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|