nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 python3,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "py3c";
10 version = "1.4";
11
12 src = fetchFromGitHub {
13 owner = "encukou";
14 repo = "py3c";
15 rev = "v${version}";
16 sha256 = "sha256-v8+0J56sZVbGdBlOotObUa10/zFMTvfXdMYRsKhyZaY=";
17 };
18
19 postPatch = ''
20 # clang and gcc-11 complain about 'register' keywords used by
21 # python-2.7. Let's avoid blanket -Werror.
22 substituteInPlace test/setup.py \
23 --replace "'-Werror', " ""
24 '';
25
26 makeFlags = [
27 "prefix=${placeholder "out"}"
28 ];
29
30 doCheck = true;
31
32 nativeCheckInputs = [
33 python3
34 python3.pkgs.distutils
35 ];
36
37 checkTarget = "test-python";
38
39 meta = with lib; {
40 homepage = "https://github.com/encukou/py3c";
41 description = "Python 2/3 compatibility layer for C extensions";
42 license = licenses.mit;
43 maintainers = with maintainers; [ dotlambda ];
44 };
45}