summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pycangjie/default.nix
blob: 18f400ac2847fa443ff6d19c845cd7155472df39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  fetchFromGitLab,
  pkg-config,
  libcangjie,
  sqlite,
  buildPythonPackage,
  cython,
  meson,
  ninja,
  cmake,
}:

buildPythonPackage rec {
  pname = "pycangjie";
  version = "1.5.0";

  pyproject = false;

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "cangjie";
    repo = "pycangjie";
    rev = version;
    hash = "sha256-REWX6u3Rc72+e5lIImBwV5uFoBBUTMM5BOfYdKIFL4k=";
  };

  preConfigure = ''
    (
      cd subprojects
      set -x
      cp -R --no-preserve=mode,ownership ${libcangjie.src} libcangjie
    )
  '';

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    cython
    cmake
  ];

  buildInputs = [
    sqlite
  ];

  pythonImportsCheck = [ "cangjie" ];

  # `buildPythonApplication` skips checkPhase
  postInstallCheck = ''
    mesonCheckPhase
  '';

  meta = {
    description = "Python wrapper to libcangjie";
    homepage = "https://cangjians.github.io/projects/pycangjie/";
    license = lib.licenses.lgpl3Plus;
    maintainers = [ ];
    platforms = lib.platforms.all;
  };
}