depot/third_party/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

83 lines
1.6 KiB
Nix

{ stdenv
, lib
, fetchurl
, aspell
, groff
, pkg-config
, glib
, hunspell
, hspell
, nuspell
, unittest-cpp
, withHspell ? true
, withAspell ? true
, withHunspell ? true
, withNuspell ? true
, withAppleSpell ? stdenv.isDarwin
, Cocoa
}:
assert withAppleSpell -> stdenv.isDarwin;
stdenv.mkDerivation rec {
pname = "enchant";
version = "2.6.9";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://github.com/AbiWord/${pname}/releases/download/v${version}/${pname}-${version}.tar.gz";
hash = "sha256-2aWhDcmzikOzoPoix27W67fgnrU1r/YpVK/NvUDv/2s=";
};
strictDeps = true;
nativeBuildInputs = [
groff
pkg-config
];
buildInputs = [
glib
] ++ lib.optionals withHunspell [
hunspell
] ++ lib.optionals withNuspell [
nuspell
] ++ lib.optionals withAppleSpell [
Cocoa
];
checkInputs = [
unittest-cpp
];
# libtool puts these to .la files
propagatedBuildInputs = lib.optionals withHspell [
hspell
] ++ lib.optionals withAspell [
aspell
];
enableParallelBuilding = true;
doCheck = true;
configureFlags = [
"--enable-relocatable" # needed for tests
(lib.withFeature withAspell "aspell")
(lib.withFeature withHspell "hspell")
(lib.withFeature withHunspell "hunspell")
(lib.withFeature withNuspell "nuspell")
(lib.withFeature withAppleSpell "applespell")
];
meta = with lib; {
description = "Generic spell checking library";
homepage = "https://abiword.github.io/enchant/";
license = licenses.lgpl21Plus; # with extra provision for non-free checkers
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.unix;
};
}