blob: c8fcd868f06ae889d9c9ae4f6ae9de32e8b3f442 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{
lib,
stdenv,
fetchurl,
python3,
dict,
glibcLocales,
libfaketime,
}:
stdenv.mkDerivation rec {
pname = "dict-db-wiktionary";
version = "20240901";
src = fetchurl {
url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
sha256 = "f37e899a9091a1b01137c7b0f3d58813edf3039e9e94ae656694c88859bbe756";
};
nativeBuildInputs = [
python3
dict
glibcLocales
libfaketime
];
dontUnpack = true;
installPhase = ''
mkdir -p $out/share/dictd/
cd $out/share/dictd
source_date=$(date --utc --date=@$SOURCE_DATE_EPOCH "+%F %T")
faketime -f "$source_date" ${python3.interpreter} -O ${./wiktionary2dict.py} "${src}"
faketime -f "$source_date" dictzip wiktionary-en.dict
echo en_US.UTF-8 > locale
'';
passthru.updateScript = ./update.sh;
meta = {
description = "DICT version of English Wiktionary";
homepage = "https://en.wiktionary.org/";
maintainers = with lib.maintainers; [ qyliss ];
platforms = lib.platforms.all;
license = with lib.licenses; [
cc-by-sa-30
fdl11Plus
];
};
}
|