Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / mitmproxy-rs / default.nix
blobd90e1e0c2a96a08d156ed16260f8426cf34884c1
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , rustPlatform
6 , darwin
7 , libiconv
8 , mitmproxy-macos
9 }:
11 buildPythonPackage rec {
12   pname = "mitmproxy-rs";
13   version = "0.3.11";
14   pyproject = true;
16   src = fetchFromGitHub {
17     owner = "mitmproxy";
18     repo = "mitmproxy_rs";
19     rev = version;
20     hash = "sha256-V6LUr1jJiTo0+53jipkTyzG5JSw6uHaS6ziyBaFbETw=";
21   };
23   cargoDeps = rustPlatform.importCargoLock {
24     lockFile = ./Cargo.lock;
25     outputHashes = {
26       "internet-packet-0.1.0" = "sha256-VtEuCE1sulBIFVymh7YW7VHCuIBjtb6tHoPz2tjxX+Q=";
27     };
28   };
30   buildAndTestSubdir = "mitmproxy-rs";
32   nativeBuildInputs = [
33     rustPlatform.cargoSetupHook
34     rustPlatform.maturinBuildHook
35   ];
37   buildInputs = lib.optionals stdenv.isDarwin [
38     darwin.apple_sdk.frameworks.Security
39     libiconv
40     mitmproxy-macos
41   ];
43   pythonImportsCheck = [ "mitmproxy_rs" ];
45   meta = with lib; {
46     description = "The Rust bits in mitmproxy";
47     homepage = "https://github.com/mitmproxy/mitmproxy_rs";
48     changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md";
49     license = licenses.mit;
50     maintainers = with maintainers; [ fab ];
51     platforms = platforms.all;
52   };