From 3d73326f1ad95307d62927278020375257172e11 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sat, 14 Dec 2024 15:37:16 +0000 Subject: [PATCH] new package: labwc --- x11-packages/labwc/0001-fix-path.patch | 22 ++ x11-packages/labwc/0002-fix-build.patch | 427 ++++++++++++++++++++++++ x11-packages/labwc/build.sh | 9 + 3 files changed, 458 insertions(+) create mode 100644 x11-packages/labwc/0001-fix-path.patch create mode 100644 x11-packages/labwc/0002-fix-build.patch create mode 100644 x11-packages/labwc/build.sh diff --git a/x11-packages/labwc/0001-fix-path.patch b/x11-packages/labwc/0001-fix-path.patch new file mode 100644 index 0000000000..389719ce2a --- /dev/null +++ b/x11-packages/labwc/0001-fix-path.patch @@ -0,0 +1,22 @@ +diff --git a/src/common/dir.c b/src/common/dir.c +index 59db410..fdce0ed 100644 +--- a/src/common/dir.c ++++ b/src/common/dir.c +@@ -30,7 +30,7 @@ static struct dir config_dirs[] = { + .path = "labwc" + }, { + .prefix = "XDG_CONFIG_DIRS", +- .default_prefix = "/etc/xdg", ++ .default_prefix = "@TERMUX_PREFIX@/etc/xdg", + .path = "labwc", + }, { + .path = NULL, +@@ -47,7 +47,7 @@ static struct dir theme_dirs[] = { + .path = ".themes", + }, { + .prefix = "XDG_DATA_DIRS", +- .default_prefix = "/usr/share:/usr/local/share:/opt/share", ++ .default_prefix = "@TERMUX_PREFIX@/share:@TERMUX_PREFIX@/local/share:@TERMUX_PREFIX@/opt/share", + .path = "themes", + }, { + .path = NULL, diff --git a/x11-packages/labwc/0002-fix-build.patch b/x11-packages/labwc/0002-fix-build.patch new file mode 100644 index 0000000000..09643968bc --- /dev/null +++ b/x11-packages/labwc/0002-fix-build.patch @@ -0,0 +1,427 @@ +diff --git a/include/config/libinput.h b/include/config/libinput.h +index 0c21161..bc4baf0 100644 +--- a/include/config/libinput.h ++++ b/include/config/libinput.h +@@ -2,6 +2,8 @@ + #ifndef LABWC_LIBINPUT_H + #define LABWC_LIBINPUT_H + ++#include ++#if WLR_HAS_LIBINPUT_BACKEND + #include + #include + #include +@@ -38,4 +40,5 @@ enum lab_libinput_device_type get_device_type(const char *s); + struct libinput_category *libinput_category_create(void); + struct libinput_category *libinput_category_get_default(void); + ++#endif + #endif /* LABWC_LIBINPUT_H */ +diff --git a/include/labwc.h b/include/labwc.h +index a19f824..cd1b3de 100644 +--- a/include/labwc.h ++++ b/include/labwc.h +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -36,7 +37,9 @@ + #include + #include + #include ++#if WLR_HAS_DRM_BACKEND + #include ++#endif + #include + #include + #include +@@ -328,8 +331,10 @@ struct server { + + struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager; + ++#if WLR_HAS_DRM_BACKEND + struct wlr_drm_lease_v1_manager *drm_lease_manager; + struct wl_listener drm_lease_request; ++#endif + + struct wlr_output_power_manager_v1 *output_power_manager_v1; + struct wl_listener output_power_manager_set_mode; +diff --git a/meson.build b/meson.build +index eddce0c..287efa3 100644 +--- a/meson.build ++++ b/meson.build +@@ -67,7 +67,7 @@ xml2 = dependency('libxml-2.0') + glib = dependency('glib-2.0') + cairo = dependency('cairo') + pangocairo = dependency('pangocairo') +-input = dependency('libinput', version: '>=1.14') ++input = dependency('libinput', required: false, version: '>=1.14') + pixman = dependency('pixman-1') + math = cc.find_library('m') + png = dependency('libpng') +diff --git a/src/config/libinput.c b/src/config/libinput.c +index af4f1bd..0ce1103 100644 +--- a/src/config/libinput.c ++++ b/src/config/libinput.c +@@ -8,6 +8,7 @@ + #include "config/libinput.h" + #include "config/rcxml.h" + ++#if WLR_HAS_LIBINPUT_BACKEND + static void + libinput_category_init(struct libinput_category *l) + { +@@ -74,3 +75,4 @@ libinput_category_get_default(void) + } + return NULL; + } ++#endif +diff --git a/src/config/rcxml.c b/src/config/rcxml.c +index d263cb9..96fc325 100644 +--- a/src/config/rcxml.c ++++ b/src/config/rcxml.c +@@ -497,6 +497,7 @@ fill_touch(char *nodename, char *content) + } + } + ++#if WLR_HAS_LIBINPUT_BACKEND + static int + get_accel_profile(const char *s) + { +@@ -679,6 +680,7 @@ fill_libinput_category(char *nodename, char *content) + g_strfreev(elements); + } + } ++#endif + + static void + set_font_attr(struct font *font, const char *nodename, const char *content) +@@ -829,10 +831,12 @@ entry(xmlNode *node, char *nodename, char *content) + fill_touch(nodename, content); + return; + } ++#if WLR_HAS_LIBINPUT_BACKEND + if (in_libinput_category) { + fill_libinput_category(nodename, content); + return; + } ++#endif + if (in_regions) { + fill_region(nodename, content); + return; +@@ -1485,6 +1489,7 @@ post_processing(void) + if (!rc.font_osd.name) { + rc.font_osd.name = xstrdup("sans"); + } ++#if WLR_HAS_LIBINPUT_BACKEND + if (!libinput_category_get_default()) { + /* So we still allow tap to click by default */ + struct libinput_category *l = libinput_category_create(); +@@ -1492,6 +1497,7 @@ post_processing(void) + (void)l; + assert(l && libinput_category_get_default() == l); + } ++#endif + + int nr_workspaces = wl_list_length(&rc.workspace_config.workspaces); + if (nr_workspaces < rc.workspace_config.min_nr_workspaces) { +@@ -1721,12 +1727,14 @@ rcxml_finish(void) + + zfree(rc.tablet.output_name); + ++#if WLR_HAS_LIBINPUT_BACKEND + struct libinput_category *l, *l_tmp; + wl_list_for_each_safe(l, l_tmp, &rc.libinput_categories, link) { + wl_list_remove(&l->link); + zfree(l->name); + zfree(l); + } ++#endif + + struct workspace *w, *w_tmp; + wl_list_for_each_safe(w, w_tmp, &rc.workspace_config.workspaces, link) { +diff --git a/src/config/session.c b/src/config/session.c +index db58943..8fcaaa5 100644 +--- a/src/config/session.c ++++ b/src/config/session.c +@@ -8,7 +8,10 @@ + #include + #include + #include ++#include ++#if WLR_HAS_DRM_BACKEND + #include ++#endif + #include + #include + #include "common/buf.h" +@@ -154,9 +157,11 @@ env_dir_cleanup: + static void + backend_check_drm(struct wlr_backend *backend, void *is_drm) + { ++#if WLR_HAS_DRM_BACKEND + if (wlr_backend_is_drm(backend)) { + *(bool *)is_drm = true; + } ++#endif + } + + static bool +diff --git a/src/input/keyboard.c b/src/input/keyboard.c +index 5806441..011ae64 100644 +--- a/src/input/keyboard.c ++++ b/src/input/keyboard.c +@@ -3,7 +3,6 @@ + #include + #include + #include +-#include + #include + #include "action.h" + #include "idle.h" +@@ -17,6 +16,10 @@ + #include "view.h" + #include "workspaces.h" + ++#if WLR_HAS_SESSION ++#include ++#endif ++ + enum lab_key_handled { + LAB_KEY_HANDLED_FALSE = 0, + LAB_KEY_HANDLED_TRUE = 1, +@@ -50,7 +53,9 @@ keyboard_reset_current_keybind(void) + static void + change_vt(struct server *server, unsigned int vt) + { ++#if WLR_HAS_SESSION + wlr_session_change_vt(server->session, vt); ++#endif + } + + bool +diff --git a/src/input/tablet-pad.c b/src/input/tablet-pad.c +index 37f597f..bdd70ed 100644 +--- a/src/input/tablet-pad.c ++++ b/src/input/tablet-pad.c +@@ -1,7 +1,10 @@ + // SPDX-License-Identifier: GPL-2.0-only + #include + #include ++#include ++#if WLR_HAS_LIBINPUT_BACKEND + #include ++#endif + #include + #include + #include +@@ -22,6 +25,7 @@ tablet_pad_attach_tablet(struct seat *seat) + pad->tablet = NULL; + } + ++#if WLR_HAS_LIBINPUT_BACKEND + /* loop over all tablets and all pads and link by device group */ + struct drawing_tablet *tablet; + wl_list_for_each(tablet, &seat->tablets, link) { +@@ -55,6 +59,7 @@ tablet_pad_attach_tablet(struct seat *seat) + } + } + } ++#endif + } + + static void +diff --git a/src/output.c b/src/output.c +index 1bf0142..8ab22ec 100644 +--- a/src/output.c ++++ b/src/output.c +@@ -9,10 +9,8 @@ + #define _POSIX_C_SOURCE 200809L + #include + #include +-#include + #include + #include +-#include + #include + #include + #include +@@ -29,6 +27,11 @@ + #include "view.h" + #include "xwayland.h" + ++#if WLR_HAS_DRM_BACKEND ++#include ++#include ++#endif ++ + static bool + get_tearing_preference(struct output *output) + { +@@ -268,7 +271,7 @@ new_output_notify(struct wl_listener *listener, void *data) + return; + } + } +- ++#if WLR_HAS_DRM_BACKEND + /* + * We offer any display as available for lease, some apps like + * gamescope want to take ownership of a display when they can +@@ -280,7 +283,7 @@ new_output_notify(struct wl_listener *listener, void *data) + wlr_drm_lease_v1_manager_offer_output( + server->drm_lease_manager, wlr_output); + } +- ++#endif + /* + * Don't configure any non-desktop displays, such as VR headsets; + */ +@@ -564,6 +567,7 @@ verify_output_config_v1(const struct wlr_output_configuration_v1 *config) + if (!head->state.mode) { + int32_t refresh = head->state.custom_mode.refresh; + ++#if WLR_HAS_DRM_BACKEND + if (wlr_output_is_drm(head->state.output) && refresh == 0) { + /* + * wlroots has a bug which causes a divide by zero +@@ -577,6 +581,7 @@ verify_output_config_v1(const struct wlr_output_configuration_v1 *config) + err_msg = "DRM backend does not support a refresh rate of 0"; + goto custom_mode_failed; + } ++#endif + + if (wlr_output_is_wl(head->state.output) && refresh != 0) { + /* Wayland backend does not support refresh rates */ +diff --git a/src/seat.c b/src/seat.c +index ce1751c..5a1365e 100644 +--- a/src/seat.c ++++ b/src/seat.c +@@ -2,7 +2,10 @@ + #include + #include + #include ++#include ++#if WLR_HAS_LIBINPUT_BACKEND + #include ++#endif + #include + #include + #include +@@ -35,6 +38,7 @@ input_device_destroy(struct wl_listener *listener, void *data) + free(input); + } + ++#if WLR_HAS_LIBINPUT_BACKEND + static enum lab_libinput_device_type + device_type_from_wlr_device(struct wlr_input_device *wlr_input_device) + { +@@ -58,12 +62,14 @@ device_type_from_wlr_device(struct wlr_input_device *wlr_input_device) + + return LAB_LIBINPUT_DEVICE_NON_TOUCH; + } ++#endif + + /* + * Get applicable profile (category) by matching first by name and secondly be + * type (e.g. 'touch' and 'non-touch'). If not suitable match is found based on + * those two criteria we fallback on 'default'. + */ ++#if WLR_HAS_LIBINPUT_BACKEND + static struct libinput_category * + get_category(struct wlr_input_device *device) + { +@@ -88,10 +94,12 @@ get_category(struct wlr_input_device *device) + /* Use default profile as a fallback */ + return libinput_category_get_default(); + } ++#endif + + static void + configure_libinput(struct wlr_input_device *wlr_input_device) + { ++#if WLR_HAS_LIBINPUT_BACKEND + /* + * TODO: We do not check any return values for the various + * libinput_device_config_*_set_*() calls. It would +@@ -247,6 +255,7 @@ configure_libinput(struct wlr_input_device *wlr_input_device) + wlr_log(WLR_INFO, "calibration matrix configured"); + libinput_device_config_calibration_set_matrix(libinput_dev, dc->calibration_matrix); + } ++#endif + } + + static struct wlr_output * +diff --git a/src/server.c b/src/server.c +index 0a09393..f87bc49 100644 +--- a/src/server.c ++++ b/src/server.c +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -22,7 +23,9 @@ + #include + #include "xwayland-shell-v1-protocol.h" + #endif ++#if WLR_HAS_DRM_BACKEND + #include "drm-lease-v1-protocol.h" ++#endif + #include "config/rcxml.h" + #include "config/session.h" + #include "decorations.h" +@@ -205,6 +208,7 @@ handle_input_disinhibit(struct wl_listener *listener, void *data) + seat_disinhibit_input(&server->seat); + } + ++#if WLR_HAS_DRM_BACKEND + static void + handle_drm_lease_request(struct wl_listener *listener, void *data) + { +@@ -232,6 +236,7 @@ handle_drm_lease_request(struct wl_listener *listener, void *data) + output->leased = true; + } + } ++#endif + + static bool + server_global_filter(const struct wl_client *client, const struct wl_global *global, void *data) +@@ -247,6 +252,7 @@ server_global_filter(const struct wl_client *client, const struct wl_global *glo + : NULL; + + if (client == xwayland_client) { ++#if WLR_HAS_DRM_BACKEND + /* + * Filter out wp_drm_lease_device_v1 for now as it is resulting in + * issues with Xwayland applications lagging over time. +@@ -256,6 +262,7 @@ server_global_filter(const struct wl_client *client, const struct wl_global *glo + if (!strcmp(iface->name, wp_drm_lease_device_v1_interface.name)) { + return false; + } ++#endif + } else if (!strcmp(iface->name, xwayland_shell_v1_interface.name)) { + /* Filter out the xwayland shell for usual clients */ + return false; +@@ -541,6 +548,7 @@ server_init(struct server *server) + + session_lock_init(server); + ++#if WLR_HAS_DRM_BACKEND + server->drm_lease_manager = wlr_drm_lease_v1_manager_create( + server->wl_display, server->backend); + if (server->drm_lease_manager) { +@@ -551,6 +559,7 @@ server_init(struct server *server) + wlr_log(WLR_DEBUG, "Failed to create wlr_drm_lease_device_v1"); + wlr_log(WLR_INFO, "VR will not be available"); + } ++#endif + + server->output_power_manager_v1 = + wlr_output_power_manager_v1_create(server->wl_display); diff --git a/x11-packages/labwc/build.sh b/x11-packages/labwc/build.sh new file mode 100644 index 0000000000..f737b56190 --- /dev/null +++ b/x11-packages/labwc/build.sh @@ -0,0 +1,9 @@ +TERMUX_PKG_HOMEPAGE="https://github.com/labwc/labwc" +TERMUX_PKG_DESCRIPTION="A Wayland window-stacking compositor" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="xMeM " +TERMUX_PKG_VERSION=0.8.0 +TERMUX_PKG_SRCURL="https://github.com/labwc/labwc/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz" +TERMUX_PKG_SHA256=1bfe5791c6002c1355821046623fa64231afd42e4d2ec1f6a9af44ef3b24f780 +TERMUX_PKG_DEPENDS="wlroots, libwayland, libxml2, libcairo, pango, glib, libpng, libxcb, librsvg, xwayland" +TERMUX_PKG_BUILD_DEPENDS="libwayland-cross-scanner, libwayland-protocols"