Skip to content

Commit

Permalink
python311Packages.keyutils: fix build
Browse files Browse the repository at this point in the history
This fixes the build for keyutils on Python 3.11 and higher.

It appears this package is affected by changes that were made to CPython
that were causing code generated by certain earlier versions of Cython
to fail.

This update simply re-generates the relevant code with the up-to-date
Cython 0.29.x series during the pre-build phase, allowing the build to
succeed.

Fixes NixOS#263482.
Fixes NixOS#263506.

Co-authored-by: Robert Schütz <[email protected]>
Co-authored-by: Martin Weinelt <[email protected]>
  • Loading branch information
3 people committed Oct 26, 2023
1 parent 93021a1 commit 03170e3
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions pkgs/development/python-modules/keyutils/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ lib, buildPythonPackage, fetchFromGitHub, keyutils, pytest-runner, pytest }:
{ lib
, buildPythonPackage
, cython
, fetchFromGitHub
, keyutils
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "keyutils";
Expand All @@ -16,8 +22,19 @@ buildPythonPackage rec {
substituteInPlace setup.py --replace '"pytest-runner"' ""
'';

preBuild = ''
cython keyutils/_keyutils.pyx
'';

preCheck = ''
rm -rf keyutils
'';

buildInputs = [ keyutils ];
nativeCheckInputs = [ pytest pytest-runner ];
nativeBuildInputs = [ cython ];
nativeCheckInputs = [
pytestCheckHook
];

meta = {
description = "A set of python bindings for keyutils";
Expand Down

0 comments on commit 03170e3

Please sign in to comment.