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