From f985121df697898ad28029841dbac41397331d24 Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Sun, 4 Jul 2021 18:48:05 +0200 Subject: [PATCH] kanjidraw: init at 0.2.3 --- pkgs/applications/misc/kanjidraw/default.nix | 47 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/applications/misc/kanjidraw/default.nix diff --git a/pkgs/applications/misc/kanjidraw/default.nix b/pkgs/applications/misc/kanjidraw/default.nix new file mode 100644 index 00000000000..53c752651d2 --- /dev/null +++ b/pkgs/applications/misc/kanjidraw/default.nix @@ -0,0 +1,47 @@ +{ lib +, fetchFromGitHub +, python3 +, bash +}: + +python3.pkgs.buildPythonApplication rec { + pname = "kanjidraw"; + version = "0.2.3"; + + src = fetchFromGitHub { + owner = "obfusk"; + repo = "kanjidraw"; + rev = "v${version}"; + sha256 = "03ag8vkbf85qww857ii8hcnn8bh5qa7rsmhka0v9vfxk272ifbyq"; + }; + + propagatedBuildInputs = with python3.pkgs; [ tkinter ]; + + postPatch = '' + substituteInPlace Makefile --replace /bin/bash ${bash}/bin/bash + ''; + + checkPhase = '' + make test + ''; + + meta = with lib; { + description = "Handwritten kanji recognition"; + longDescription = '' + kanjidraw is a simple Python library + GUI for matching (the strokes of a) + handwritten kanji against its database. + + You can use the GUI to draw and subsequently select a kanji from the list of + probable matches, which will then be copied to the clipboard. + + The database is based on KanjiVG and the algorithms are based on the + Kanji draw Android app. + ''; + homepage = "https://github.com/obfusk/kanjidraw"; + license = with licenses; [ + agpl3Plus # code + cc-by-sa-30 # data.json + ]; + maintainers = [ maintainers.obfusk ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b6961be94b8..4ecd78eaef3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2891,6 +2891,8 @@ in jiten = callPackage ../applications/misc/jiten { }; + kanjidraw = callPackage ../applications/misc/kanjidraw { }; + jotta-cli = callPackage ../applications/misc/jotta-cli { }; joycond = callPackage ../os-specific/linux/joycond { };