2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cffi,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
xorg,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "xcffib";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.5.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-qVyUZfL5e0/O3mBr0eCEB6Mt9xy3YP1Xv+U2d9tpGsw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedNativeBuildInputs = [ cffi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ cffi ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "xcffib" ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Tests use xvfb
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Drop in replacement for xpyb, an XCB python binding";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/tych0/xcffib";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/tych0/xcffib/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin ++ platforms.windows;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
|
|
};
|
|
|
|
}
|