2022-11-27 09:42:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3 }:
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "py3c";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.4";
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encukou";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-v8+0J56sZVbGdBlOotObUa10/zFMTvfXdMYRsKhyZaY=";
|
2021-05-03 20:48:10 +00:00
|
|
|
};
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
# clang and gcc-11 complain about 'register' keywords used by
|
|
|
|
# python-2.7. Let's avoid blanket -Werror.
|
2021-05-03 20:48:10 +00:00
|
|
|
substituteInPlace test/setup.py \
|
|
|
|
--replace "'-Werror', " ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
checkTarget = "test-python";
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/encukou/py3c";
|
|
|
|
description = "Python 2/3 compatibility layer for C extensions";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ajs124 dotlambda ];
|
|
|
|
};
|
|
|
|
}
|