about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/py3c/default.nix
blob: f4d2aa95a2e8b6094f9b2cbcd3170e20f82c3e68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation rec {
  pname = "py3c";
  version = "1.4";

  src = fetchFromGitHub {
    owner = "encukou";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-v8+0J56sZVbGdBlOotObUa10/zFMTvfXdMYRsKhyZaY=";
  };

  postPatch = ''
    # clang and gcc-11 complain about 'register' keywords used by
    # python-2.7. Let's avoid blanket -Werror.
    substituteInPlace test/setup.py \
      --replace "'-Werror', " ""
  '';

  makeFlags = [
    "prefix=${placeholder "out"}"
  ];

  doCheck = true;

  nativeCheckInputs = [
    python3
  ];

  checkTarget = "test-python";

  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 ];
  };
}