1{ lib
2, stdenv
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.18";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "faust-streaming";
20 repo = "cChardet";
21 rev = "refs/tags/v${version}";
22 fetchSubmodules = true;
23 hash = "sha256-jTOqxBss/FAb8nMkU62H6O4ysmirD2FTA9mtvxXh43k=";
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 = [
40 "cchardet"
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 ];
46
47 meta = {
48 changelog = "https://github.com/faust-streaming/cChardet/blob/${src.rev}/CHANGES.rst";
49 description = "High-speed universal character encoding detector";
50 homepage = "https://github.com/faust-streaming/cChardet";
51 license = lib.licenses.mpl11;
52 maintainers = with lib.maintainers; [ dotlambda ivan ];
53 };
54}