1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cython,
6 pkgconfig,
7 setuptools,
8 wheel,
9 pytestCheckHook,
10 python,
11}:
12
13buildPythonPackage rec {
14 pname = "faust-cchardet";
15 version = "2.1.19";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "faust-streaming";
20 repo = "cChardet";
21 tag = "v${version}";
22 fetchSubmodules = true;
23 hash = "sha256-yY6YEhXC4S47rxnkKAta4m16IVGn7gkHSt056bYOYJ4=";
24 };
25
26 nativeBuildInputs = [
27 cython
28 pkgconfig
29 setuptools
30 wheel
31 ];
32
33 postFixup = ''
34 # fake cchardet distinfo, so packages that depend on cchardet
35 # accept it as a drop-in replacement
36 ln -s $out/${python.sitePackages}/{faust_,}cchardet-${version}.dist-info
37 '';
38
39 pythonImportsCheck = [ "cchardet" ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 meta = {
44 changelog = "https://github.com/faust-streaming/cChardet/blob/${src.rev}/CHANGES.rst";
45 description = "High-speed universal character encoding detector";
46 mainProgram = "cchardetect";
47 homepage = "https://github.com/faust-streaming/cChardet";
48 license = lib.licenses.mpl11;
49 maintainers = with lib.maintainers; [
50 dotlambda
51 ivan
52 ];
53 };
54}