about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/dict/dictd-wordnet.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/dict/dictd-wordnet.nix')
-rw-r--r--nixpkgs/pkgs/servers/dict/dictd-wordnet.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/dict/dictd-wordnet.nix b/nixpkgs/pkgs/servers/dict/dictd-wordnet.nix
new file mode 100644
index 000000000000..663bd54897bf
--- /dev/null
+++ b/nixpkgs/pkgs/servers/dict/dictd-wordnet.nix
@@ -0,0 +1,36 @@
+{lib, stdenv, python3, wordnet, writeScript}:
+
+stdenv.mkDerivation rec {
+  version = "542";
+  pname = "dict-db-wordnet";
+
+  buildInputs = [python3 wordnet];
+  convert = ./wordnet_structures.py;
+
+  builder = writeScript "builder.sh" ''
+    . ${stdenv}/setup
+    mkdir -p $out/share/dictd/
+    cd $out/share/dictd
+
+    for i in ${wordnet}/dict/data.*; do
+      DATA="$DATA `echo $i | sed -e s,data,index,` $i";
+    done
+
+    python ${convert} $DATA
+    echo en_US.UTF-8 > locale
+  '';
+
+  meta = {
+    description = "dictd-compatible version of WordNet";
+
+    longDescription =
+      '' WordNet® is a large lexical database of English. This package makes
+         the wordnet data available to dictd and by extension for lookup with
+         the dict command. '';
+
+    homepage = "https://wordnet.princeton.edu/";
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}