Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / adblock / default.nix
blob8fc697828f0ad231181a1785d7fb83145a9e8149
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , buildPythonPackage
5 , rustPlatform
6 , pythonImportsCheckHook
7 , pkg-config
8 , openssl
9 , publicsuffix-list
10 , isPy27
11 , CoreFoundation
12 , Security
15 buildPythonPackage rec {
16   pname = "adblock";
17   version = "0.4.0";
18   disabled = isPy27;
20   # Pypi only has binary releases
21   src = fetchFromGitHub {
22     owner = "ArniDagur";
23     repo = "python-adblock";
24     rev = version;
25     sha256 = "10d6ks2fyzbizq3kb69q478idj0h86k6ygjb6wl3zq3mf65ma4zg";
26   };
28   cargoDeps = rustPlatform.fetchCargoTarball {
29     inherit src;
30     name = "${pname}-${version}";
31     hash = "sha256-gEFmj3/KvhvvsOK2nX2L1RUD4Wfp3nYzEzVnQZIsIDY=";
32   };
34   format = "pyproject";
36   nativeBuildInputs = [ pkg-config pythonImportsCheckHook ]
37     ++ (with rustPlatform; [ cargoSetupHook maturinBuildHook ]);
39   buildInputs = [ openssl ]
40     ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
42   PSL_PATH = "${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat";
44   # There are no rust tests
45   doCheck = false;
47   pythonImportsCheck = [ "adblock" ];
49   meta = with lib; {
50     description = "Python wrapper for Brave's adblocking library, which is written in Rust";
51     homepage = "https://github.com/ArniDagur/python-adblock/";
52     maintainers = with maintainers; [ petabyteboy ];
53     license = with licenses; [ asl20 mit ];
54   };