Merge pull request #220385 from dotlambda/xcffib-fix

python310Packages.xcffib: fix tests
This commit is contained in:
Martin Weinelt
2023-03-10 00:01:20 +00:00
committed by GitHub
@@ -1,9 +1,9 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, xorg
, cffi
, six
, pytestCheckHook
}:
@@ -16,12 +16,20 @@ buildPythonPackage rec {
hash = "sha256-8yMCFEf55zB40hu5KMSPTavq6z87N+gDxta5hzXoFIM=";
};
patchPhase = ''
patches = [
(fetchpatch {
name = "remove-leftover-six-import.patch";
url = "https://github.com/tych0/xcffib/commit/8a488867d30464913706376ca3a9f4c98ca6c5cf.patch";
hash = "sha256-wEms0gC7tVqtmKMjjpH/34kdQ6HUV0h67bUGbgijlqw=";
})
];
postPatch = ''
# Hardcode cairo library path
sed -e 's,ffi\.dlopen(,&"${xorg.libxcb.out}/lib/" + ,' -i xcffib/__init__.py
'';
propagatedBuildInputs = [ cffi six ];
propagatedBuildInputs = [ cffi ];
propagatedNativeBuildInputs = [ cffi ];
@@ -31,6 +39,11 @@ buildPythonPackage rec {
xorg.xorgserver
];
preCheck = ''
# import from $out
rm -r xcffib
'';
pythonImportsCheck = [ "xcffib" ];
meta = with lib; {