forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / servers / dict / dictd-wordnet.nix
blobc07aa4293587106861d500f45460611b3bd87dc7
1 {lib, stdenv, python3, wordnet, writeScript, libfaketime}:
3 stdenv.mkDerivation rec {
4   version = "542";
5   pname = "dict-db-wordnet";
7   buildInputs = [python3 wordnet libfaketime];
8   convert = ./wordnet_structures.py;
10   builder = writeScript "builder.sh" ''
11     . ${stdenv}/setup
12     mkdir -p $out/share/dictd/
13     cd $out/share/dictd
15     for i in ${wordnet}/dict/data.*; do
16       DATA="$DATA `echo $i | sed -e s,data,index,` $i";
17     done
19     source_date=$(date --utc --date=@$SOURCE_DATE_EPOCH "+%F %T")
20     faketime -f "$source_date" python ${convert} $DATA
21     echo en_US.UTF-8 > locale
22   '';
24   meta = {
25     description = "dictd-compatible version of WordNet";
27     longDescription = ''
28       WordNet® is a large lexical database of English. This package makes
29       the wordnet data available to dictd and by extension for lookup with
30       the dict command.
31     '';
33     homepage = "https://wordnet.princeton.edu/";
35     maintainers = [ ];
36     platforms = lib.platforms.all;
37   };