1{ lib
2, stdenv
3, buildPythonPackage
4, callPackage
5, fetchFromGitHub
6, rustPlatform
7, libiconv
8}:
9
10buildPythonPackage rec {
11 pname = "lzallright";
12 version = "0.2.3";
13
14 src = fetchFromGitHub {
15 owner = "vlaci";
16 repo = pname;
17 rev = "v${version}";
18 hash = "sha256-Zzif6WtecgAkNmml0kt0Z+Ewx0L30ahr+kwzYR5aUAM=";
19 };
20
21 cargoDeps = rustPlatform.fetchCargoTarball {
22 inherit src;
23 name = "${pname}-${version}";
24 hash = "sha256-+pV9q2QM6qFA1a5E10OAsE7KJEUsTiEiU1KqO4/2rFw=";
25 };
26
27 format = "pyproject";
28
29 nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
30
31 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
32
33 pythonImportsCheck = [ "lzallright" ];
34
35 doCheck = false;
36
37 passthru.tests = {
38 pytest = callPackage ./tests.nix { };
39 };
40
41 meta = with lib; {
42 description = ''
43 A Python 3.8+ binding for lzokay library which is an MIT licensed
44 a minimal, C++14 implementation of the LZO compression format.
45 '';
46 homepage = "https://github.com/vlaci/lzallright";
47 license = licenses.mit;
48 maintainers = with maintainers; [ vlaci ];
49 };
50}