summary refs log tree commit diff
path: root/pkgs/applications/misc/jiten
diff options
context:
space:
mode:
authorFelix C. Stegerman <flx@obfusk.net>2021-04-17 13:01:06 +0200
committerFelix C. Stegerman <flx@obfusk.net>2021-04-17 13:01:06 +0200
commite2066ea46020104ad1f8358951871fbc8d66fd65 (patch)
treeceb80f6db111e8c1631c29c45728ebae1693dbbb /pkgs/applications/misc/jiten
parente69f9dbd63a83052766fa97b36050192540f2c95 (diff)
downloadnixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar.gz
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar.bz2
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar.lz
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar.xz
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.tar.zst
nixpkgs-e2066ea46020104ad1f8358951871fbc8d66fd65.zip
jiten: init at 1.0.0
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/applications/misc/jiten')
-rw-r--r--pkgs/applications/misc/jiten/default.nix91
1 files changed, 91 insertions, 0 deletions
diff --git a/pkgs/applications/misc/jiten/default.nix b/pkgs/applications/misc/jiten/default.nix
new file mode 100644
index 00000000000..5447a2b3050
--- /dev/null
+++ b/pkgs/applications/misc/jiten/default.nix
@@ -0,0 +1,91 @@
+{ lib
+, fetchFromGitHub
+, python3Packages
+, makeWrapper
+, pcre
+, sqlite
+, nodejs
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "jiten";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "obfusk";
+    repo = "jiten";
+    rev = "v${version}";
+    sha256 = "1lg1n7f4383jdlkbma0q65yl6l159wgh886admcq7l7ap26zpqd2";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ pcre sqlite ];
+  propagatedBuildInputs = with python3Packages; [ click flask ];
+  checkInputs = [ nodejs ];
+
+  preBuild = ''
+    export JITEN_VERSION=${version}   # override `git describe`
+    export JITEN_FINAL=yes            # build & package *.sqlite3
+  '';
+
+  postPatch = ''
+    substituteInPlace Makefile                  --replace /bin/bash "$(command -v bash)"
+    substituteInPlace jiten/res/jmdict/Makefile --replace /bin/bash "$(command -v bash)"
+  '';
+
+  checkPhase = "make test";
+
+  postInstall = ''
+    # requires pywebview
+    rm $out/bin/jiten-gui
+  '';
+
+  meta = with lib; {
+    description = "Japanese android/cli/web dictionary based on jmdict/kanjidic";
+    longDescription = ''
+      Jiten is a Japanese dictionary based on JMDict/Kanjidic
+
+      Fine-grained search using regexes (regular expressions)
+      • simple searches don't require knowledge of regexes
+      • quick reference available in the web interface and android app
+
+      JMDict multilingual japanese dictionary
+      • kanji, readings (romaji optional), meanings & more
+      • meanings in english, dutch, german, french and/or spanish
+      • pitch accent (from Wadoku)
+      • browse by frequency/jlpt
+
+      Kanji dictionary
+      • readings (romaji optional), meanings (english), jmdict entries, radicals & more
+      • search using SKIP codes
+      • search by radical
+      • browse by frequency/level/jlpt
+
+      Example sentences (from Tatoeba)
+      • with english, dutch, german, french and/or spanish translation
+      • some with audio
+
+      Stroke order
+      • input a word or sentence and see how it's written
+
+      Web interface
+      • available online at https://jiten.obfusk.dev
+      • light/dark mode
+      • search history (stored locally)
+      • tooltips to quickly see meanings and readings for kanji and words
+      • use long press for tooltips on mobile
+      • converts romaji to hiragana and between hiragana and katakana
+      • can be run on your own computer
+
+      Command-line interface
+    '';
+    homepage = "https://github.com/obfusk/jiten";
+    license = with licenses; [
+      agpl3Plus               # code
+      cc-by-sa-30             # jmdict/kanjidic
+      unfreeRedistributable   # pitch data from wadoku is non-commercial :(
+    ];
+    maintainers = [ maintainers.obfusk ];
+    platforms = platforms.unix;
+  };
+}