about summary refs log tree commit diff
path: root/pkgs/development/python-modules/faust-cchardet/default.nix
blob: ff3cd46700c9417db24ca8b645d2c053ecbcb9ae (plain) (blame)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  cython,
  pkgconfig,
  setuptools,
  wheel,
  pytestCheckHook,
  python,
}:

buildPythonPackage rec {
  pname = "faust-cchardet";
  version = "2.1.19";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "faust-streaming";
    repo = "cChardet";
    rev = "refs/tags/v${version}";
    fetchSubmodules = true;
    hash = "sha256-yY6YEhXC4S47rxnkKAta4m16IVGn7gkHSt056bYOYJ4=";
  };

  nativeBuildInputs = [
    cython
    pkgconfig
    setuptools
    wheel
  ];

  postFixup = ''
    # fake cchardet distinfo, so packages that depend on cchardet
    # accept it as a drop-in replacement
    ln -s $out/${python.sitePackages}/{faust_,}cchardet-${version}.dist-info
  '';

  pythonImportsCheck = [ "cchardet" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    changelog = "https://github.com/faust-streaming/cChardet/blob/${src.rev}/CHANGES.rst";
    description = "High-speed universal character encoding detector";
    mainProgram = "cchardetect";
    homepage = "https://github.com/faust-streaming/cChardet";
    license = lib.licenses.mpl11;
    maintainers = with lib.maintainers; [
      dotlambda
      ivan
    ];
  };
}