Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / nh3 / default.nix
blob5c627edadeeb8914eb2fa9ad2c56ac1e2bfea0f5
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , pythonOlder
5 , rustPlatform
6 , libiconv
7 , fetchFromGitHub
8 , darwin
9 }:
10 let
11   pname = "nh3";
12   version = "0.2.15";
13   src = fetchFromGitHub {
14     owner = "messense";
15     repo = pname;
16     rev = "v${version}";
17     hash = "sha256-OyTehgnjmDALU2qPRL/HrvoAMyIsmYuTKFlOJT8r+Gk=";
18   };
20 buildPythonPackage {
21   inherit pname version src;
22   format = "pyproject";
23   disabled = pythonOlder "3.6";
25   cargoDeps = rustPlatform.fetchCargoTarball {
26     inherit src;
27     name = "${pname}-${version}";
28     hash = "sha256-fetAE3cj9hh4SoPE72Bqco5ytUMiDqbazeS2MHdUibM=";
29   };
31   nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
33   buildInputs = lib.optionals stdenv.isDarwin [
34     libiconv
35     darwin.apple_sdk.frameworks.Security
36   ];
38   pythonImportsCheck = [ "nh3" ];
40   meta = with lib; {
41     description = "Python binding to Ammonia HTML sanitizer Rust crate";
42     homepage = "https://github.com/messense/nh3";
43     license = licenses.mit;
44     maintainers = with maintainers; [ happysalada ];
45   };