overrides.cffi: Fix cross

This commit is contained in:
adisbladis 2022-01-19 17:09:31 +12:00
parent ba1107f46b
commit 30e1dc364c

View file

@ -6,6 +6,7 @@
self: super:
let
inherit (self.python) stdenv;
addFlit =
{ drv
@ -177,8 +178,15 @@ in
(
super.cffi.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ];
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.buildPackages.pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.libffi ];
prePatch = (old.prePatch or "") + lib.optionalString stdenv.isDarwin ''
# Remove setup.py impurities
substituteInPlace setup.py --replace "'-iwithsysroot/usr/include/ffi'" ""
substituteInPlace setup.py --replace "'/usr/include/ffi'," ""
substituteInPlace setup.py --replace '/usr/include/libffi' '${lib.getDev pkgs.libffi}/include'
'';
}
)
);