pythonPackages.pycapnp: Fix build for Py3k

Also:
- Disabled Py27: New versions don't support it
- Fetch from github repo instead of PyPi
This commit is contained in:
Luke Adams 2021-01-01 00:31:47 +00:00
parent 3f7e683741
commit 6c9f17eed1

View File

@ -1,34 +1,35 @@
{ stdenv { stdenv
, buildPythonPackage , buildPythonPackage
, fetchPypi
, capnproto , capnproto
, cython , cython
, fetchFromGitHub
, isPy27
, isPyPy , isPyPy
, isPy3k , pkgconfig
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pycapnp"; pname = "pycapnp";
version = "1.0.0"; version = "1.0.0";
disabled = isPyPy || isPy3k; disabled = isPyPy || isPy27;
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "capnproto";
sha256 = "9f6fcca349ebf2ec04ca7eacb076aea3e4fcdc010ac33c98b54f0a19d4e5d3e0"; repo = pname;
rev = "v${version}";
sha256 = "1n6dq2fbagi3wvrpkyb7wx4y15nkm2grln4y75hrqgmnli8ggi9v";
}; };
buildInputs = [ capnproto cython ]; buildInputs = [ capnproto cython pkgconfig ];
# import setuptools as soon as possible, to minimize monkeypatching mayhem. # Tests disabled due to dependency on jinja and various other libraries.
postConfigure = '' doCheck = false;
sed -i '3iimport setuptools' setup.py
''; pythonImportsCheck = [ "capnp" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
maintainers = with maintainers; [ cstrahan ]; maintainers = with maintainers; [ cstrahan lukeadams ];
license = licenses.bsd2; license = licenses.bsd2;
homepage = "http://jparyani.github.io/pycapnp/index.html"; homepage = "https://capnproto.github.io/pycapnp/";
broken = true; # 2018-04-11
}; };
} }