1{
2 buildPythonPackage,
3 cryptography,
4 fetchPypi,
5 lib,
6 protobuf,
7 pycryptodome,
8 requests,
9 protobuf_27,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 version = "0.4.4";
15 pname = "gpapi";
16 pyproject = true;
17
18 src = fetchPypi {
19 inherit version pname;
20 sha256 = "sha256-HA06ie25ny7AXI7AvZgezvowfZ3ExalY8HDkk7betyo=";
21 };
22
23 postPatch = ''
24 substituteInPlace setup.py \
25 --replace-fail 'PROTOC_EXEC = "protoc"' 'PROTOC_EXEC = "${lib.getExe protobuf_27}"'
26 '';
27
28 build-system = [ setuptools ];
29
30 buildInputs = [
31 protobuf_27
32 ];
33
34 dependencies = [
35 cryptography
36 protobuf
37 pycryptodome
38 requests
39 ];
40
41 preBuild = ''
42 export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python"
43 '';
44
45 # package doesn't contain unit tests
46 # scripts in ./test require networking
47 doCheck = false;
48
49 pythonImportsCheck = [ "gpapi.googleplay" ];
50
51 meta = {
52 homepage = "https://github.com/NoMore201/googleplay-api";
53 license = lib.licenses.gpl3Only;
54 description = "Google Play Unofficial Python API";
55 maintainers = [ ];
56 };
57}