Files

50 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
cython,
meson-python,
pytestCheckHook,
python,
}:
buildPythonPackage rec {
pname = "faust-cchardet";
version = "2.2.1";
pyproject = true;
src = fetchFromGitHub {
owner = "faust-streaming";
repo = "cChardet";
tag = "v${version}";
fetchSubmodules = true;
hash = "sha256-m/wa41dhLFmRg20iAn1YkXVCIubp5bT4PI+YuUIK3Wc=";
};
build-system = [
cython
meson-python
];
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.tag}/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
];
};
}