nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cmake,
8 setuptools,
9 setuptools-scm,
10
11 # native dependencies
12 zlib-ng,
13
14 # tests
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "zlib-ng";
20 version = "1.0.0";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "pycompression";
25 repo = "python-zlib-ng";
26 rev = "v${version}";
27 hash = "sha256-t/PSby1LUTyp+7XXKZTWjRrPvAei1ZrGSGU2CIcAQBc=";
28 };
29
30 build-system = [
31 cmake
32 setuptools
33 setuptools-scm
34 ];
35
36 dontUseCmakeConfigure = true;
37
38 env.PYTHON_ZLIB_NG_LINK_DYNAMIC = true;
39
40 buildInputs = [ zlib-ng ];
41
42 pythonImportsCheck = [ "zlib_ng" ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 preCheck = ''
47 rm -rf src
48 '';
49
50 disabledTests = [
51 # commandline tests fail to find the built module
52 "test_compress_fast_best_are_exclusive"
53 "test_compress_infile_outfile"
54 "test_compress_infile_outfile_default"
55 "test_decompress_cannot_have_flags_compression"
56 "test_decompress_infile_outfile"
57 "test_decompress_infile_outfile_error"
58 ];
59
60 meta = {
61 description = "Drop-in replacement for Python's zlib and gzip modules using zlib-ng";
62 homepage = "https://github.com/pycompression/python-zlib-ng";
63 changelog = "https://github.com/pycompression/python-zlib-ng/blob/${src.rev}/CHANGELOG.rst";
64 license = lib.licenses.psfl;
65 maintainers = with lib.maintainers; [ hexa ];
66 };
67}