···11+{ lib
22+, fetchFromGitHub
33+, python3
44+, bash
55+}:
66+77+python3.pkgs.buildPythonApplication rec {
88+ pname = "kanjidraw";
99+ version = "0.2.3";
1010+1111+ src = fetchFromGitHub {
1212+ owner = "obfusk";
1313+ repo = "kanjidraw";
1414+ rev = "v${version}";
1515+ sha256 = "03ag8vkbf85qww857ii8hcnn8bh5qa7rsmhka0v9vfxk272ifbyq";
1616+ };
1717+1818+ propagatedBuildInputs = with python3.pkgs; [ tkinter ];
1919+2020+ postPatch = ''
2121+ substituteInPlace Makefile --replace /bin/bash ${bash}/bin/bash
2222+ '';
2323+2424+ checkPhase = ''
2525+ make test
2626+ '';
2727+2828+ meta = with lib; {
2929+ description = "Handwritten kanji recognition";
3030+ longDescription = ''
3131+ kanjidraw is a simple Python library + GUI for matching (the strokes of a)
3232+ handwritten kanji against its database.
3333+3434+ You can use the GUI to draw and subsequently select a kanji from the list of
3535+ probable matches, which will then be copied to the clipboard.
3636+3737+ The database is based on KanjiVG and the algorithms are based on the
3838+ Kanji draw Android app.
3939+ '';
4040+ homepage = "https://github.com/obfusk/kanjidraw";
4141+ license = with licenses; [
4242+ agpl3Plus # code
4343+ cc-by-sa-30 # data.json
4444+ ];
4545+ maintainers = [ maintainers.obfusk ];
4646+ };
4747+}