python3Packages.pyaxmlparser: fix build

The build is currently broken on master[1] due to a major bump of
`click` in fe0af1ce77.

Manually patching `setup.py` temporarily fixes the issue. To ensure that
succeeding builds don't deliver packages breaking at runtime due to
dependency issues I switched to the GitHub archive as source since it
contains tests as well.

Additionally, Python 2.7 support has been dropped. It seems as it
was never intended to support Python3 here, I simply forgot to disable
the Python2 build.

```
TypeError: AXMLParser object is not an iterator
```

[1] https://hydra.nixos.org/build/86108813
This commit is contained in:
Maximilian Bosch 2018-12-23 22:56:58 +01:00
parent 772759173d
commit 30c6234e15
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -1,16 +1,30 @@
{ buildPythonPackage, stdenv, lxml, click, fetchPypi }:
{ buildPythonPackage, stdenv, lxml, click, fetchFromGitHub, pytest, isPy3k }:
buildPythonPackage rec {
version = "0.3.13";
pname = "pyaxmlparser";
src = fetchPypi {
inherit pname version;
sha256 = "1mzdrifnaky57vkmdvg0rgjss55xkxaramci3wpv4h65lmk95988";
# the PyPI tarball doesn't ship tests.
src = fetchFromGitHub {
owner = "appknox";
repo = pname;
rev = "v${version}";
sha256 = "0jfjhxc6b57npsidknxmhj1x813scg47aaw90ybyr90fpdz5rlwk";
};
disabled = !isPy3k;
postPatch = ''
substituteInPlace setup.py --replace "click==6.7" "click"
'';
propagatedBuildInputs = [ lxml click ];
checkInputs = [ pytest ];
checkPhase = ''
py.test tests/
'';
meta = with stdenv.lib; {
description = "Python3 Parser for Android XML file and get Application Name without using Androguard";
homepage = https://github.com/appknox/pyaxmlparser;