From e2b54ce4497e393412d83e1bffbbc456bb19b1bd Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 12 Jan 2022 10:31:30 +0100 Subject: [PATCH] python3Packages.pywlroots: 0.14.12 -> 0.15.3 --- .../python-modules/pywlroots/default.nix | 13 +++++++--- .../python-modules/pywlroots/xwayland.patch | 25 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 +-- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/python-modules/pywlroots/xwayland.patch diff --git a/pkgs/development/python-modules/pywlroots/default.nix b/pkgs/development/python-modules/pywlroots/default.nix index 901161d634fe..a1f466cfe67a 100644 --- a/pkgs/development/python-modules/pywlroots/default.nix +++ b/pkgs/development/python-modules/pywlroots/default.nix @@ -12,21 +12,27 @@ , wayland , pywayland , xkbcommon +, xorg , pytestCheckHook }: buildPythonPackage rec { pname = "pywlroots"; - version = "0.14.12"; + version = "0.15.3"; src = fetchPypi { inherit pname version; - sha256 = "80v1kuiYL3OdtDVJj0EvgrO9x1eN8xxUyRuI4Wb4giI="; + sha256 = "sCHeiD6KugHZLtxcVcLggdHC1gqCxStuHy1065TbGiY="; }; + # The XWayland detection uses some hard-coded FHS paths. Since we + # know wlroots was built with xwayland support, replace its + # detection with `return True`. + patches = [ ./xwayland.patch ]; + nativeBuildInputs = [ pkg-config ]; propagatedNativeBuildInputs = [ cffi ]; - buildInputs = [ libinput libxkbcommon pixman udev wayland wlroots ]; + buildInputs = [ libinput libxkbcommon pixman xorg.libxcb udev wayland wlroots ]; propagatedBuildInputs = [ cffi pywayland xkbcommon ]; checkInputs = [ pytestCheckHook ]; @@ -40,6 +46,7 @@ buildPythonPackage rec { homepage = "https://github.com/flacjacket/pywlroots"; description = "Python bindings to wlroots using cffi"; license = licenses.ncsa; + platforms = platforms.linux; maintainers = with maintainers; [ chvp ]; }; } diff --git a/pkgs/development/python-modules/pywlroots/xwayland.patch b/pkgs/development/python-modules/pywlroots/xwayland.patch new file mode 100644 index 000000000000..f3aaecca2642 --- /dev/null +++ b/pkgs/development/python-modules/pywlroots/xwayland.patch @@ -0,0 +1,25 @@ +diff --git a/wlroots/ffi_build.py b/wlroots/ffi_build.py +index bb07ff8..f19efe3 100644 +--- a/wlroots/ffi_build.py ++++ b/wlroots/ffi_build.py +@@ -55,19 +55,7 @@ def has_xwayland() -> bool: + Check for XWayland headers. If present, wlroots was built with XWayland support, so + pywlroots can be too. + """ +- try: +- FFI().verify( +- "#include ", +- define_macros=[("WLR_USE_UNSTABLE", 1)], +- include_dirs=["/usr/include/pixman-1", include_dir.as_posix()], +- ) +- return True +- except VerificationError: +- print("If XWayland support is not required, ignore the above error message.") +- print( +- "If support is required, ensure wlroots was built with -Dxwayland=enabled." +- ) +- return False ++ return True + + + # backend.h diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5244fb8caf10..55b0ad935869 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8278,9 +8278,7 @@ in { pywizlight = callPackage ../development/python-modules/pywizlight { }; - pywlroots = callPackage ../development/python-modules/pywlroots { - wlroots = pkgs.wlroots_0_14; - }; + pywlroots = callPackage ../development/python-modules/pywlroots { }; pyxattr = callPackage ../development/python-modules/pyxattr { };