about summary refs log tree commit diff stats
path: root/pkgs/enchant-configurable
diff options
context:
space:
mode:
authorAlan Pearce2024-05-18 21:59:31 +0200
committerAlan Pearce2024-05-18 21:59:31 +0200
commit0fc8df6abdd0fdbf8ec797bf3324af50aa140bb5 (patch)
tree567fc93e78246602bc7e42df293e8ce94b26b616 /pkgs/enchant-configurable
parent57dd0897181f4f5f921a28f41d593f90a6811211 (diff)
downloadnix-packages-0fc8df6abdd0fdbf8ec797bf3324af50aa140bb5.tar.lz
nix-packages-0fc8df6abdd0fdbf8ec797bf3324af50aa140bb5.tar.zst
nix-packages-0fc8df6abdd0fdbf8ec797bf3324af50aa140bb5.zip
enchant-configurable: init at 2.6.9
Diffstat (limited to 'pkgs/enchant-configurable')
-rw-r--r--pkgs/enchant-configurable/default.nix82
1 files changed, 82 insertions, 0 deletions
diff --git a/pkgs/enchant-configurable/default.nix b/pkgs/enchant-configurable/default.nix
new file mode 100644
index 0000000..0afe168
--- /dev/null
+++ b/pkgs/enchant-configurable/default.nix
@@ -0,0 +1,82 @@
+{ 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
+    platforms = platforms.unix;
+  };
+}