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