summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyoxipng/default.nix
blob: f696a8a44b1c9c2b50da0adf19662b243f30c459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  rustPlatform,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pyoxipng";
  version = "9.1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "nfrasser";
    repo = "pyoxipng";
    tag = "v${version}";
    hash = "sha256-aVya+0+X2p0VaWCZTxVlVUFFlqkqZ7A2lJjhxiXAgrE=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit src;
    hash = "sha256-wMCx6cujqM4q96b1mg4eovKjWmsv0FcaDBCxy0OodmA=";
  };

  nativeBuildInputs = with rustPlatform; [
    cargoSetupHook
    maturinBuildHook
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "oxipng" ];

  meta = {
    description = "Python wrapper for multithreaded PNG optimizer oxipng";
    homepage = "https://github.com/nfrasser/pyoxipng";
    changelog = "https://github.com/nfrasser/pyoxipng/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ undefined-landmark ];
  };
}