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.4";
14
15 src = fetchFromGitHub {
16 owner = "vlaci";
17 repo = pname;
18 rev = "v${version}";
19 hash = "sha256-6Dez14qlZ7cnVQfaiTHGuiTSAHvBoKtolgKF7ne9ASw=";
20 };
21
22 cargoDeps = rustPlatform.fetchCargoTarball {
23 inherit src;
24 name = "${pname}-${version}";
25 hash = "sha256-ZYFAWkcDdX10024hc+gdARyaJFpNNcXf+gGLxBP5VlA=";
26 };
27
28 format = "pyproject";
29
30 nativeBuildInputs = with rustPlatform; [
31 cargoSetupHook
32 maturinBuildHook
33 ];
34
35 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
36
37 pythonImportsCheck = [ "lzallright" ];
38
39 doCheck = false;
40
41 passthru.tests = {
42 pytest = callPackage ./tests.nix { };
43 };
44
45 meta = with lib; {
46 description = ''
47 A Python 3.8+ binding for lzokay library which is an MIT licensed
48 a minimal, C++14 implementation of the LZO compression format.
49 '';
50 homepage = "https://github.com/vlaci/lzallright";
51 license = licenses.mit;
52 maintainers = with maintainers; [ vlaci ];
53 };
54}