From 83cdd624e425c034b25f7baf4eb654fade97e1b3 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Thu, 24 Oct 2024 18:26:17 -0400 Subject: [PATCH 1/2] python3Packages.gpapi: Fix build --- pkgs/development/python-modules/gpapi/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/python-modules/gpapi/default.nix b/pkgs/development/python-modules/gpapi/default.nix index cd6ce736d2a6..a7e7ca5a3219 100644 --- a/pkgs/development/python-modules/gpapi/default.nix +++ b/pkgs/development/python-modules/gpapi/default.nix @@ -6,6 +6,7 @@ protobuf, pycryptodome, requests, + protobuf_27, }: buildPythonPackage rec { @@ -18,12 +19,25 @@ buildPythonPackage rec { sha256 = "0ampvsv97r3hy1cakif4kmyk1ynf3scbvh4fbk02x7xrxn4kl38w"; }; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail 'PROTOC_EXEC = "protoc"' 'PROTOC_EXEC = "${lib.getExe protobuf_27}"' + ''; + # package doesn't contain unit tests # scripts in ./test require networking doCheck = false; pythonImportsCheck = [ "gpapi.googleplay" ]; + preBuild = '' + export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" + ''; + + buildInputs = [ + protobuf_27 + ]; + propagatedBuildInputs = [ cryptography protobuf From 59ec08c4fbe96453703114484eef91c04ccd4dbf Mon Sep 17 00:00:00 2001 From: Pyrox Date: Thu, 24 Oct 2024 18:27:55 -0400 Subject: [PATCH 2/2] python3Packages.gpapi: refactor and modernize --- .../python-modules/gpapi/default.nix | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/gpapi/default.nix b/pkgs/development/python-modules/gpapi/default.nix index a7e7ca5a3219..9399e547a050 100644 --- a/pkgs/development/python-modules/gpapi/default.nix +++ b/pkgs/development/python-modules/gpapi/default.nix @@ -7,16 +7,17 @@ pycryptodome, requests, protobuf_27, + setuptools, }: buildPythonPackage rec { version = "0.4.4"; - format = "setuptools"; pname = "gpapi"; + pyproject = true; src = fetchPypi { inherit version pname; - sha256 = "0ampvsv97r3hy1cakif4kmyk1ynf3scbvh4fbk02x7xrxn4kl38w"; + sha256 = "sha256-HA06ie25ny7AXI7AvZgezvowfZ3ExalY8HDkk7betyo="; }; postPatch = '' @@ -24,30 +25,32 @@ buildPythonPackage rec { --replace-fail 'PROTOC_EXEC = "protoc"' 'PROTOC_EXEC = "${lib.getExe protobuf_27}"' ''; + build-system = [ setuptools ]; + + buildInputs = [ + protobuf_27 + ]; + + dependencies = [ + cryptography + protobuf + pycryptodome + requests + ]; + + preBuild = '' + export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" + ''; + # package doesn't contain unit tests # scripts in ./test require networking doCheck = false; pythonImportsCheck = [ "gpapi.googleplay" ]; - preBuild = '' - export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" - ''; - - buildInputs = [ - protobuf_27 - ]; - - propagatedBuildInputs = [ - cryptography - protobuf - pycryptodome - requests - ]; - - meta = with lib; { + meta = { homepage = "https://github.com/NoMore201/googleplay-api"; - license = licenses.gpl3Only; + license = lib.licenses.gpl3Only; description = "Google Play Unofficial Python API"; maintainers = [ ]; };