From 6c9f17eed16fa615d8ddedf8defcb6bd58c47502 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Fri, 1 Jan 2021 00:31:47 +0000 Subject: [PATCH] pythonPackages.pycapnp: Fix build for Py3k Also: - Disabled Py27: New versions don't support it - Fetch from github repo instead of PyPi --- .../python-modules/pycapnp/default.nix | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/pycapnp/default.nix b/pkgs/development/python-modules/pycapnp/default.nix index 1997021ce01..0d8dc6b53d8 100644 --- a/pkgs/development/python-modules/pycapnp/default.nix +++ b/pkgs/development/python-modules/pycapnp/default.nix @@ -1,34 +1,35 @@ { stdenv , buildPythonPackage -, fetchPypi , capnproto , cython +, fetchFromGitHub +, isPy27 , isPyPy -, isPy3k +, pkgconfig }: buildPythonPackage rec { pname = "pycapnp"; version = "1.0.0"; - disabled = isPyPy || isPy3k; + disabled = isPyPy || isPy27; - src = fetchPypi { - inherit pname version; - sha256 = "9f6fcca349ebf2ec04ca7eacb076aea3e4fcdc010ac33c98b54f0a19d4e5d3e0"; + src = fetchFromGitHub { + owner = "capnproto"; + repo = pname; + rev = "v${version}"; + sha256 = "1n6dq2fbagi3wvrpkyb7wx4y15nkm2grln4y75hrqgmnli8ggi9v"; }; - buildInputs = [ capnproto cython ]; + buildInputs = [ capnproto cython pkgconfig ]; - # import setuptools as soon as possible, to minimize monkeypatching mayhem. - postConfigure = '' - sed -i '3iimport setuptools' setup.py - ''; + # Tests disabled due to dependency on jinja and various other libraries. + doCheck = false; + + pythonImportsCheck = [ "capnp" ]; meta = with stdenv.lib; { - maintainers = with maintainers; [ cstrahan ]; + maintainers = with maintainers; [ cstrahan lukeadams ]; license = licenses.bsd2; - homepage = "http://jparyani.github.io/pycapnp/index.html"; - broken = true; # 2018-04-11 + homepage = "https://capnproto.github.io/pycapnp/"; }; - }