2023-06-22 16:41:42 +00:00
|
|
|
{lib, stdenv, python3, wordnet, writeScript, libfaketime}:
|
2012-10-27 21:01:53 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "542";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "dict-db-wordnet";
|
2012-10-27 21:01:53 +00:00
|
|
|
|
2023-06-22 16:41:42 +00:00
|
|
|
buildInputs = [python3 wordnet libfaketime];
|
2012-10-27 21:01:53 +00:00
|
|
|
convert = ./wordnet_structures.py;
|
|
|
|
|
|
|
|
builder = writeScript "builder.sh" ''
|
|
|
|
. ${stdenv}/setup
|
2014-06-30 12:56:10 +00:00
|
|
|
mkdir -p $out/share/dictd/
|
2012-10-27 21:01:53 +00:00
|
|
|
cd $out/share/dictd
|
|
|
|
|
|
|
|
for i in ${wordnet}/dict/data.*; do
|
|
|
|
DATA="$DATA `echo $i | sed -e s,data,index,` $i";
|
|
|
|
done
|
|
|
|
|
2023-06-22 16:41:42 +00:00
|
|
|
source_date=$(date --utc --date=@$SOURCE_DATE_EPOCH "+%F %T")
|
|
|
|
faketime -f "$source_date" python ${convert} $DATA
|
2012-10-27 21:01:53 +00:00
|
|
|
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. '';
|
|
|
|
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://wordnet.princeton.edu/";
|
2012-10-27 21:01:53 +00:00
|
|
|
|
2018-01-17 05:13:23 +00:00
|
|
|
maintainers = [ ];
|
2021-01-15 07:07:56 +00:00
|
|
|
platforms = lib.platforms.all;
|
2012-10-27 21:01:53 +00:00
|
|
|
};
|
|
|
|
}
|