1{ 2 lib, 3 fetchFromGitLab, 4 pkg-config, 5 libcangjie, 6 sqlite, 7 buildPythonPackage, 8 cython, 9 meson, 10 ninja, 11 cmake, 12}: 13 14buildPythonPackage rec { 15 pname = "pycangjie"; 16 version = "1.5.0"; 17 18 format = "other"; 19 20 src = fetchFromGitLab { 21 domain = "gitlab.freedesktop.org"; 22 owner = "cangjie"; 23 repo = "pycangjie"; 24 rev = version; 25 hash = "sha256-REWX6u3Rc72+e5lIImBwV5uFoBBUTMM5BOfYdKIFL4k="; 26 }; 27 28 preConfigure = '' 29 ( 30 cd subprojects 31 set -x 32 cp -R --no-preserve=mode,ownership ${libcangjie.src} libcangjie 33 ) 34 ''; 35 36 nativeBuildInputs = [ 37 pkg-config 38 meson 39 ninja 40 cython 41 cmake 42 ]; 43 44 buildInputs = [ 45 sqlite 46 ]; 47 48 pythonImportsCheck = [ "cangjie" ]; 49 50 # `buildPythonApplication` skips checkPhase 51 postInstallCheck = '' 52 mesonCheckPhase 53 ''; 54 55 meta = with lib; { 56 description = "Python wrapper to libcangjie"; 57 homepage = "https://cangjians.github.io/projects/pycangjie/"; 58 license = licenses.lgpl3Plus; 59 maintainers = [ maintainers.linquize ]; 60 platforms = platforms.all; 61 }; 62}