about summary refs log tree commit diff
path: root/corp/russian/data-import/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'corp/russian/data-import/default.nix')
-rw-r--r--corp/russian/data-import/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/corp/russian/data-import/default.nix b/corp/russian/data-import/default.nix
new file mode 100644
index 000000000000..b4cdc50c25c1
--- /dev/null
+++ b/corp/russian/data-import/default.nix
@@ -0,0 +1,39 @@
+{ depot, pkgs, ... }:
+
+let
+  buildInputs = with pkgs; [
+    sqlite
+    pkg-config
+  ];
+
+  # mirrored input data from OpenCorpora, as of 2023-01-17.
+  #
+  # This data is licensed under CC-BY-SA.
+  inputDataArchive = pkgs.fetchurl {
+    name = "dict.opcorpora.xml.bz";
+    url = "https://tazj.in/blobs/dict.opcorpora.xml.bz2";
+    sha256 = "04n5g43fkfc93z6xlwf2qfdrfdfl562pc2ivdb3cbbbsy56gkqg6";
+  };
+
+  inputData = pkgs.runCommand "dict.opcorpora.xml" { } ''
+    ${pkgs.bzip2}/bin/bunzip2 -k -c ${inputDataArchive} > $out
+  '';
+
+  # development shell with native deps
+  shell = pkgs.mkShell {
+    inherit buildInputs;
+
+    # make OPENCORPORA_DATA available in the environment
+    OPENCORPORA_DATA = inputData;
+  };
+in
+depot.third_party.naersk.buildPackage {
+  src = depot.third_party.gitignoreSource ./.;
+  inherit buildInputs;
+
+  passthru = {
+    inherit shell;
+
+
+  };
+}