2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-03-15 16:39:30 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, xorg
|
|
|
|
, cffi
|
2023-01-20 10:41:00 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "1.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "xcffib";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-8yMCFEf55zB40hu5KMSPTavq6z87N+gDxta5hzXoFIM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "remove-leftover-six-import.patch";
|
|
|
|
url = "https://github.com/tych0/xcffib/commit/8a488867d30464913706376ca3a9f4c98ca6c5cf.patch";
|
|
|
|
hash = "sha256-wEms0gC7tVqtmKMjjpH/34kdQ6HUV0h67bUGbgijlqw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# Hardcode cairo library path
|
|
|
|
sed -e 's,ffi\.dlopen(,&"${xorg.libxcb.out}/lib/" + ,' -i xcffib/__init__.py
|
|
|
|
'';
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
propagatedBuildInputs = [ cffi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedNativeBuildInputs = [ cffi ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
pytestCheckHook
|
|
|
|
xorg.xeyes
|
|
|
|
xorg.xorgserver
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
preCheck = ''
|
|
|
|
# import from $out
|
|
|
|
rm -r xcffib
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
pythonImportsCheck = [ "xcffib" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A drop in replacement for xpyb, an XCB python binding";
|
|
|
|
homepage = "https://github.com/tych0/xcffib";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
|
|
};
|
|
|
|
}
|