ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / adblock / default.nix
blob3106cf04002d5c9695cd67013f89b34820414b3a
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , buildPythonPackage
5 , rustPlatform
6 , pkg-config
7 , openssl
8 , publicsuffix-list
9 , pythonOlder
10 , libiconv
11 , CoreFoundation
12 , Security
13 , pytestCheckHook
14 , toml
17 buildPythonPackage rec {
18   pname = "adblock";
19   version = "0.6.0";
20   format = "pyproject";
22   disabled = pythonOlder "3.7";
24   # Pypi only has binary releases
25   src = fetchFromGitHub {
26     owner = "ArniDagur";
27     repo = "python-adblock";
28     rev = "refs/tags/${version}";
29     hash = "sha256-5g5xdUzH/RTVwu4Vfb5Cb1t0ruG0EXgiXjrogD/+JCU=";
30   };
32   cargoDeps = rustPlatform.fetchCargoTarball {
33     inherit src;
34     name = "${pname}-${version}";
35     hash = "sha256-1xmYmF5P7a5O9MilxDy+CVhmWMGRetdM2fGvTPy7JmM=";
36   };
38   nativeBuildInputs = [
39     pkg-config
40   ] ++ (with rustPlatform; [
41     cargoSetupHook
42     maturinBuildHook
43   ]);
45   buildInputs = [
46     openssl
47   ] ++ lib.optionals stdenv.isDarwin [
48     libiconv
49     CoreFoundation
50     Security
51   ];
53   PSL_PATH = "${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat";
55   checkInputs = [
56     pytestCheckHook
57     toml
58   ];
60   preCheck = ''
61     # import from $out instead
62     rm -r adblock
63   '';
65   disabledTestPaths = [
66     # relies on directory removed above
67     "tests/test_typestubs.py"
68   ];
70   pythonImportsCheck = [
71     "adblock"
72     "adblock.adblock"
73   ];
75   meta = with lib; {
76     description = "Python wrapper for Brave's adblocking library";
77     homepage = "https://github.com/ArniDagur/python-adblock/";
78     maintainers = with maintainers; [ dotlambda ];
79     license = with licenses; [ asl20 /* or */ mit ];
80   };