summary refs log tree commit diff
path: root/pkgs/servers/dict/wiktionary/default.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-07-27 12:01:20 +0000
committerGitHub <noreply@github.com>2021-07-27 12:01:20 +0000
commit2692c2e4277b0b1b3b01299462f238efccba91e2 (patch)
tree9c186fa1b83585cd1f7f82351b8c8d061bfd6395 /pkgs/servers/dict/wiktionary/default.nix
parent4fc4793298c10b1d648a0f269bc44394d5171c9e (diff)
parent2431a34ffe50eeb382ea4d7f8d3984e9029d6e04 (diff)
downloadnixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar.gz
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar.bz2
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar.lz
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar.xz
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.tar.zst
nixpkgs-2692c2e4277b0b1b3b01299462f238efccba91e2.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/servers/dict/wiktionary/default.nix')
-rw-r--r--pkgs/servers/dict/wiktionary/default.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/pkgs/servers/dict/wiktionary/default.nix b/pkgs/servers/dict/wiktionary/default.nix
index 3a01120f3a6..05df86f3a78 100644
--- a/pkgs/servers/dict/wiktionary/default.nix
+++ b/pkgs/servers/dict/wiktionary/default.nix
@@ -1,23 +1,33 @@
 { lib, stdenv, fetchurl, python2, dict, glibcLocales }:
 
 stdenv.mkDerivation rec {
-  version = "20210201";
   pname = "dict-db-wiktionary";
+  version = "20210201";
 
   src = fetchurl {
     url = "https://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
     sha256 = "0dc34cbadsg0f6lhfcyx0np7zjnlg6837piqhlvnn0b45xnzn0cs";
   };
 
-  convert = ./wiktionary2dict.py;
-  buildInputs = [ python2 dict glibcLocales ];
-  builder = ./builder.sh;
+  # script in nixpkgs does not support python2
+  nativeBuildInputs = [ python2 dict glibcLocales ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/share/dictd/
+    cd $out/share/dictd
+
+    ${python2.interpreter} -O ${./wiktionary2dict.py} "${src}"
+    dictzip wiktionary-en.dict
+    echo en_US.UTF-8 > locale
+  '';
 
   passthru.updateScript = ./update.sh;
 
   meta = with lib; {
     description = "DICT version of English Wiktionary";
-    homepage = "http://en.wiktionary.org/";
+    homepage = "https://en.wiktionary.org/";
     maintainers = with maintainers; [ qyliss ];
     platforms = platforms.all;
     license = with licenses; [ cc-by-sa-30 fdl11Plus ];