1{ stdenv, lib, buildPythonPackage, fetchPypi, six, cmigemo, pytestCheckHook }:
2
3buildPythonPackage rec {
4 pname = "cmigemo";
5 version = "0.1.6";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "09j68kvcskav2cqb7pj12caksmj4wh2lhjp0csq00xpn0wqal4vk";
10 };
11
12 propagatedBuildInputs = [ six ];
13
14 preConfigure = ''
15 export LDFLAGS="-L${cmigemo}/lib"
16 export CPPFLAGS="-I${cmigemo}/include"
17 export LD_LIBRARY_PATH="${cmigemo}/lib"
18 '';
19
20 postPatch = ''
21 sed -i 's~dict_path_base = "/usr/share/cmigemo"~dict_path_base = "/${cmigemo}/share/migemo"~g' test/test_cmigemo.py
22 '';
23
24 checkInputs = [ pytestCheckHook ];
25
26 pytestFlagsArray = [ "test/" ];
27
28 pythonImportsCheck = [ "cmigemo" ];
29
30 meta = with lib; {
31 broken = stdenv.isDarwin;
32 homepage = "https://github.com/mooz/python-cmigemo";
33 description = "A pure python binding for C/Migemo";
34 license = licenses.mit;
35 maintainers = with maintainers; [ illustris ];
36 };
37}