···1+{ lib
2+, fetchFromGitHub
3+, python3
4+, bash
5+}:
6+7+python3.pkgs.buildPythonApplication rec {
8+ pname = "kanjidraw";
9+ version = "0.2.3";
10+11+ src = fetchFromGitHub {
12+ owner = "obfusk";
13+ repo = "kanjidraw";
14+ rev = "v${version}";
15+ sha256 = "03ag8vkbf85qww857ii8hcnn8bh5qa7rsmhka0v9vfxk272ifbyq";
16+ };
17+18+ propagatedBuildInputs = with python3.pkgs; [ tkinter ];
19+20+ postPatch = ''
21+ substituteInPlace Makefile --replace /bin/bash ${bash}/bin/bash
22+ '';
23+24+ checkPhase = ''
25+ make test
26+ '';
27+28+ meta = with lib; {
29+ description = "Handwritten kanji recognition";
30+ longDescription = ''
31+ kanjidraw is a simple Python library + GUI for matching (the strokes of a)
32+ handwritten kanji against its database.
33+34+ You can use the GUI to draw and subsequently select a kanji from the list of
35+ probable matches, which will then be copied to the clipboard.
36+37+ The database is based on KanjiVG and the algorithms are based on the
38+ Kanji draw Android app.
39+ '';
40+ homepage = "https://github.com/obfusk/kanjidraw";
41+ license = with licenses; [
42+ agpl3Plus # code
43+ cc-by-sa-30 # data.json
44+ ];
45+ maintainers = [ maintainers.obfusk ];
46+ };
47+}