pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/wayland/sway



Module Name:    pkgsrc
Committed By:   kikadf
Date:           Tue Apr 14 11:32:15 UTC 2026

Added Files:
        pkgsrc/wayland/sway: DESCR Makefile PLIST distinfo
        pkgsrc/wayland/sway/files: startsway.sh
        pkgsrc/wayland/sway/patches: patch-common_stringop.c
            patch-common_util.c patch-meson.build patch-sway_commands.c
            patch-sway_commands_move.c patch-sway_commands_rename.c
            patch-sway_commands_workspace.c patch-sway_input_input-manager.c
            patch-sway_ipc-json.c patch-sway_tree_output.c
            patch-sway_tree_workspace.c patch-swaybar_i3bar.c
            patch-swaybar_tray_icon.c

Log Message:
sway: new package

Sway is a tiling Wayland compositor and a drop-in replacement
for the i3 window manager for X11. It works with your existing
i3 configuration and supports most of i3's features, plus
a few extras.
Sway allows you to arrange your application windows logically,
rather than spatially. Windows are arranged into a grid by
default which maximizes the efficiency of your screen and can
be quickly manipulated using only the keyboard.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/wayland/sway/DESCR pkgsrc/wayland/sway/Makefile \
    pkgsrc/wayland/sway/PLIST pkgsrc/wayland/sway/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/wayland/sway/files/startsway.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/wayland/sway/patches/patch-common_stringop.c \
    pkgsrc/wayland/sway/patches/patch-common_util.c \
    pkgsrc/wayland/sway/patches/patch-meson.build \
    pkgsrc/wayland/sway/patches/patch-sway_commands.c \
    pkgsrc/wayland/sway/patches/patch-sway_commands_move.c \
    pkgsrc/wayland/sway/patches/patch-sway_commands_rename.c \
    pkgsrc/wayland/sway/patches/patch-sway_commands_workspace.c \
    pkgsrc/wayland/sway/patches/patch-sway_input_input-manager.c \
    pkgsrc/wayland/sway/patches/patch-sway_ipc-json.c \
    pkgsrc/wayland/sway/patches/patch-sway_tree_output.c \
    pkgsrc/wayland/sway/patches/patch-sway_tree_workspace.c \
    pkgsrc/wayland/sway/patches/patch-swaybar_i3bar.c \
    pkgsrc/wayland/sway/patches/patch-swaybar_tray_icon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/wayland/sway/DESCR
diff -u /dev/null pkgsrc/wayland/sway/DESCR:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/DESCR   Tue Apr 14 11:32:14 2026
@@ -0,0 +1,8 @@
+Sway is a tiling Wayland compositor and a drop-in replacement
+for the i3 window manager for X11. It works with your existing
+i3 configuration and supports most of i3's features, plus
+a few extras.
+Sway allows you to arrange your application windows logically,
+rather than spatially. Windows are arranged into a grid by
+default which maximizes the efficiency of your screen and can
+be quickly manipulated using only the keyboard.
Index: pkgsrc/wayland/sway/Makefile
diff -u /dev/null pkgsrc/wayland/sway/Makefile:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/Makefile        Tue Apr 14 11:32:14 2026
@@ -0,0 +1,36 @@
+# $NetBSD: Makefile,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+DISTNAME=      sway-1.11
+CATEGORIES=    wayland
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=swaywm/}
+
+MAINTAINER=    dan%alt.md@localhost
+HOMEPAGE=      https://swaywm.org/
+COMMENT=       Tilling, i3-compatible Wayland compositor
+LICENSE=       mit
+
+USE_TOOLS+=    pkg-config
+
+EGDIR=         ${PREFIX}/share/examples/sway
+OWN_DIRS+=     ${PKG_SYSCONFDIR}/sway
+CONF_FILES=    ${EGDIR}/config ${PKG_SYSCONFDIR}/sway/config
+
+post-install:
+       ${INSTALL_SCRIPT} ${FILESDIR}/startsway.sh \
+               ${DESTDIR}${PREFIX}/bin/startsway
+
+.include "../../devel/meson/build.mk"
+.include "../../textproc/scdoc/tool.mk"
+.include "../../devel/basu/buildlink3.mk"
+.include "../../devel/libevdev-chunk/buildlink3.mk"
+.include "../../devel/pango/buildlink3.mk"
+.include "../../devel/pcre/buildlink3.mk"
+.include "../../devel/wayland/buildlink3.mk"
+.include "../../devel/wayland-protocols/buildlink3.mk"
+.include "../../graphics/cairo/buildlink3.mk"
+.include "../../graphics/gdk-pixbuf2/buildlink3.mk"
+.include "../../sysutils/seatd/buildlink3.mk"
+.include "../../textproc/json-c/buildlink3.mk"
+.include "../../wayland/wlroots/buildlink3.mk"
+.include "../../x11/libxkbcommon/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/wayland/sway/PLIST
diff -u /dev/null pkgsrc/wayland/sway/PLIST:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/PLIST   Tue Apr 14 11:32:14 2026
@@ -0,0 +1,34 @@
+@comment $NetBSD: PLIST,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+bin/startsway
+bin/sway
+bin/swaybar
+bin/swaymsg
+bin/swaynag
+man/man1/sway.1
+man/man1/swaymsg.1
+man/man1/swaynag.1
+man/man5/sway-bar.5
+man/man5/sway-input.5
+man/man5/sway-output.5
+man/man5/sway.5
+man/man5/swaynag.5
+man/man7/sway-ipc.7
+man/man7/swaybar-protocol.7
+share/backgrounds/sway/Sway_Wallpaper_Blue_1136x640.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1136x640_Portrait.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1366x768.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_2048x1536.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_2048x1536_Portrait.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_768x1024.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_768x1024_Portrait.png
+share/bash-completion/completions/sway
+share/bash-completion/completions/swaybar
+share/bash-completion/completions/swaymsg
+share/examples/sway/config
+share/fish/vendor_completions.d/sway.fish
+share/fish/vendor_completions.d/swaymsg.fish
+share/fish/vendor_completions.d/swaynag.fish
+share/wayland-sessions/sway.desktop
+share/zsh/site-functions/_sway
+share/zsh/site-functions/_swaymsg
Index: pkgsrc/wayland/sway/distinfo
diff -u /dev/null pkgsrc/wayland/sway/distinfo:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/distinfo        Tue Apr 14 11:32:14 2026
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+BLAKE2s (sway-1.11.tar.gz) = 08578ebdaaafd31f89219294389dcad8e918b80181444b47f927a09e1132c737
+SHA512 (sway-1.11.tar.gz) = 7366b494308b8773e6051a67286e7abe422bb390f58def8df143d6334b949ef4c5df7e8086332053ff57ec65518f5b04f11a2c31bb57a31dd234eda82457aed5
+Size (sway-1.11.tar.gz) = 5583731 bytes
+SHA1 (patch-common_stringop.c) = 1d89d81d0e665dec83b312e4d47645923dedbea3
+SHA1 (patch-common_util.c) = 6092b87d425096740409e00b0d9dac3bc5dae8f7
+SHA1 (patch-meson.build) = 40b74709af65b55b4f3e93a5fa45b783f88b6463
+SHA1 (patch-sway_commands.c) = 792b1746fcfccafa1ac2bb7386012a31e327d63a
+SHA1 (patch-sway_commands_move.c) = 8b5682f523ccc626e376c4dcceac53a2c2a739f3
+SHA1 (patch-sway_commands_rename.c) = 831cd230384eecba4bd86696163eb4fa385f4cf4
+SHA1 (patch-sway_commands_workspace.c) = ae2389a3d5d9ff453de3d55e5be5ff6fa447c1d3
+SHA1 (patch-sway_input_input-manager.c) = 911f6a14325ba87130cef81e5bc3ad4772e07613
+SHA1 (patch-sway_ipc-json.c) = 8baeb0f81994ec456161d164a28b3dc6a33953c7
+SHA1 (patch-sway_tree_output.c) = 5e8aa608a2a77013d7d0ceef7b74bf1c8a334bf3
+SHA1 (patch-sway_tree_workspace.c) = c62b76e90b3ae1cbaf958fb4cf42a5d8fee4705a
+SHA1 (patch-swaybar_i3bar.c) = b71e4c995ab4b64f76d6604f1010e83d459e4c29
+SHA1 (patch-swaybar_tray_icon.c) = 4cb661059fb46e207e0da1f3a716c1f8a63d8604

Index: pkgsrc/wayland/sway/files/startsway.sh
diff -u /dev/null pkgsrc/wayland/sway/files/startsway.sh:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/files/startsway.sh      Tue Apr 14 11:32:14 2026
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eu
+
+: ${XDG_CURRENT_DESKTOP:=sway}
+: ${XDG_RUNTIME_DIR:=/tmp/$(id -un)-runtime}
+: ${QT_QPA_PLATFORM:=wayland;xcb}
+
+export XDG_CURRENT_DESKTOP XDG_RUNTIME_DIR QT_QPA_PLATFORM
+
+[ -d "${XDG_RUNTIME_DIR}" ] || mkdir -p -m 700 "${XDG_RUNTIME_DIR}"
+
+exec /usr/pkg/bin/seatd-launch \
+     /usr/pkg/bin/dbus-run-session \
+     /usr/pkg/bin/sway "$@"

Index: pkgsrc/wayland/sway/patches/patch-common_stringop.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-common_stringop.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-common_stringop.c Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_stringop.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- common/stringop.c.orig     2026-02-06 15:04:53.573026504 +0000
++++ common/stringop.c
+@@ -18,7 +18,7 @@ void strip_whitespace(char *str) {
+       memmove(str, &str[start], len + 1 - start);
+ 
+       if (*str) {
+-              for (len -= start + 1; isspace(str[len]); --len) {}
++              for (len -= start + 1; isspace((unsigned char)str[len]); --len) {}
+               str[len + 1] = '\0';
+       }
+ }
Index: pkgsrc/wayland/sway/patches/patch-common_util.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-common_util.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-common_util.c     Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_util.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- common/util.c.orig 2026-02-06 14:12:13.396723268 +0000
++++ common/util.c
+@@ -18,7 +18,7 @@ bool parse_color(const char *color, uint
+               ++color;
+       }
+       int len = strlen(color);
+-      if ((len != 6 && len != 8) || !isxdigit(color[0]) || !isxdigit(color[1])) {
++      if ((len != 6 && len != 8) || !isxdigit((unsigned char)color[0]) || !isxdigit((unsigned char)color[1])) {
+               return false;
+       }
+       char *ptr;
Index: pkgsrc/wayland/sway/patches/patch-meson.build
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-meson.build:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-meson.build       Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson.build,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Install config files to examples
+
+--- meson.build.orig   2025-12-13 15:37:00.995711394 +0000
++++ meson.build
+@@ -214,7 +214,7 @@ configure_file(
+       configuration: config,
+       input: 'config.in',
+       output: '@BASENAME@',
+-      install_dir: join_paths(sysconfdir, 'sway')
++      install_dir: join_paths(datadir, 'examples', 'sway')
+ )
+ 
+ install_data(
Index: pkgsrc/wayland/sway/patches/patch-sway_commands.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_commands.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_commands.c   Tue Apr 14 11:32:14 2026
@@ -0,0 +1,30 @@
+$NetBSD: patch-sway_commands.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands.c.orig       2026-02-06 14:32:11.294383795 +0000
++++ sway/commands.c
+@@ -228,7 +228,7 @@ list_t *execute_command(char *_exec, str
+       config->handler_context.seat = seat;
+ 
+       do {
+-              for (; isspace(*head); ++head) {}
++              for (; isspace((unsigned char)*head); ++head) {}
+               // Extract criteria (valid for this command list only).
+               if (matched_delim == ';') {
+                       using_criteria = false;
+@@ -247,12 +247,12 @@ list_t *execute_command(char *_exec, str
+                               criteria_destroy(criteria);
+                               using_criteria = true;
+                               // Skip leading whitespace
+-                              for (; isspace(*head); ++head) {}
++                              for (; isspace((unsigned char)*head); ++head) {}
+                       }
+               }
+               // Split command list
+               cmd = argsep(&head, ";,", &matched_delim);
+-              for (; isspace(*cmd); ++cmd) {}
++              for (; isspace((unsigned char)*cmd); ++cmd) {}
+ 
+               if (strcmp(cmd, "") == 0) {
+                       sway_log(SWAY_INFO, "Ignoring empty command.");
Index: pkgsrc/wayland/sway/patches/patch-sway_commands_move.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_commands_move.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_commands_move.c      Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_move.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/move.c.orig  2026-02-06 14:59:39.044165905 +0000
++++ sway/commands/move.c
+@@ -472,7 +472,7 @@ static struct cmd_results *cmd_move_cont
+                               if (argc < 3) {
+                                       return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
+                               }
+-                              if (!isdigit(argv[2][0])) {
++                              if (!isdigit((unsigned char)argv[2][0])) {
+                                       return cmd_results_new(CMD_INVALID,
+                                                       "Invalid workspace number '%s'", argv[2]);
+                               }
Index: pkgsrc/wayland/sway/patches/patch-sway_commands_rename.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_commands_rename.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_commands_rename.c    Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_rename.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/rename.c.orig        2026-02-06 15:17:20.504788687 +0000
++++ sway/commands/rename.c
+@@ -37,7 +37,7 @@ struct cmd_results *cmd_rename(int argc,
+               workspace = config->handler_context.workspace;
+       } else if (strcasecmp(argv[1], "number") == 0) {
+               // 'rename workspace number x to new_name'
+-              if (!isdigit(argv[2][0])) {
++              if (!isdigit((unsigned char)argv[2][0])) {
+                       return cmd_results_new(CMD_INVALID,
+                                       "Invalid workspace number '%s'", argv[2]);
+               }
Index: pkgsrc/wayland/sway/patches/patch-sway_commands_workspace.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_commands_workspace.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_commands_workspace.c Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_workspace.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/workspace.c.orig     2026-02-06 14:28:42.650855570 +0000
++++ sway/commands/workspace.c
+@@ -194,7 +194,7 @@ struct cmd_results *cmd_workspace(int ar
+                               return cmd_results_new(CMD_INVALID,
+                                               "Expected workspace number");
+                       }
+-                      if (!isdigit(argv[1][0])) {
++                      if (!isdigit((unsigned char)argv[1][0])) {
+                               return cmd_results_new(CMD_INVALID,
+                                               "Invalid workspace number '%s'", argv[1]);
+                       }
Index: pkgsrc/wayland/sway/patches/patch-sway_input_input-manager.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_input_input-manager.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_input_input-manager.c        Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_input_input-manager.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/input/input-manager.c.orig    2026-02-06 14:46:35.813870635 +0000
++++ sway/input/input-manager.c
+@@ -81,7 +81,7 @@ char *input_device_get_identifier(struct
+       char *p = name;
+       for (; *p; ++p) {
+               // There are in fact input devices with unprintable characters in its name
+-              if (*p == ' ' || !isprint(*p)) {
++              if (*p == ' ' || !isprint((unsigned char)*p)) {
+                       *p = '_';
+               }
+       }
Index: pkgsrc/wayland/sway/patches/patch-sway_ipc-json.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_ipc-json.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_ipc-json.c   Tue Apr 14 11:32:14 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_ipc-json.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/ipc-json.c.orig       2026-02-06 14:36:33.994077551 +0000
++++ sway/ipc-json.c
+@@ -494,7 +494,7 @@ static json_object *ipc_json_describe_sc
+ static void ipc_json_describe_workspace(struct sway_workspace *workspace,
+               json_object *object) {
+       int num;
+-      if (isdigit(workspace->name[0])) {
++      if (isdigit((unsigned char)workspace->name[0])) {
+               errno = 0;
+               char *endptr = NULL;
+               long long parsed_num = strtoll(workspace->name, &endptr, 10);
Index: pkgsrc/wayland/sway/patches/patch-sway_tree_output.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_tree_output.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_tree_output.c        Tue Apr 14 11:32:14 2026
@@ -0,0 +1,23 @@
+$NetBSD: patch-sway_tree_output.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/tree/output.c.orig    2026-02-06 15:15:06.294449317 +0000
++++ sway/tree/output.c
+@@ -381,13 +381,13 @@ static int sort_workspace_cmp_qsort(cons
+       struct sway_workspace *a = *(void **)_a;
+       struct sway_workspace *b = *(void **)_b;
+ 
+-      if (isdigit(a->name[0]) && isdigit(b->name[0])) {
++      if (isdigit((unsigned char)a->name[0]) && isdigit((unsigned char)b->name[0])) {
+               int a_num = strtol(a->name, NULL, 10);
+               int b_num = strtol(b->name, NULL, 10);
+               return (a_num < b_num) ? -1 : (a_num > b_num);
+-      } else if (isdigit(a->name[0])) {
++      } else if (isdigit((unsigned char)a->name[0])) {
+               return -1;
+-      } else if (isdigit(b->name[0])) {
++      } else if (isdigit((unsigned char)b->name[0])) {
+               return 1;
+       }
+       return 0;
Index: pkgsrc/wayland/sway/patches/patch-sway_tree_workspace.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-sway_tree_workspace.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-sway_tree_workspace.c     Tue Apr 14 11:32:15 2026
@@ -0,0 +1,30 @@
+$NetBSD: patch-sway_tree_workspace.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/tree/workspace.c.orig 2026-02-06 15:19:36.101349296 +0000
++++ sway/tree/workspace.c
+@@ -256,7 +256,7 @@ static void workspace_name_from_binding(
+                       sway_log(SWAY_DEBUG, "Isolated name from workspace number: '%s'", _target);
+ 
+                       // Make sure the workspace number doesn't already exist
+-                      if (isdigit(_target[0]) && workspace_by_number(_target)) {
++                      if (isdigit((unsigned char)_target[0]) && workspace_by_number(_target)) {
+                               free(_target);
+                               free(dup);
+                               return;
+@@ -346,12 +346,12 @@ char *workspace_next_name(const char *ou
+ static bool _workspace_by_number(struct sway_workspace *ws, void *data) {
+       char *name = data;
+       char *ws_name = ws->name;
+-      while (isdigit(*name)) {
++      while (isdigit((unsigned char)*name)) {
+               if (*name++ != *ws_name++) {
+                       return false;
+               }
+       }
+-      return !isdigit(*ws_name);
++      return !isdigit((unsigned char)*ws_name);
+ }
+ 
+ struct sway_workspace *workspace_by_number(const char* name) {
Index: pkgsrc/wayland/sway/patches/patch-swaybar_i3bar.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-swaybar_i3bar.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-swaybar_i3bar.c   Tue Apr 14 11:32:15 2026
@@ -0,0 +1,33 @@
+$NetBSD: patch-swaybar_i3bar.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- swaybar/i3bar.c.orig       2026-02-06 15:09:17.576197045 +0000
++++ swaybar/i3bar.c
+@@ -126,7 +126,7 @@ bool i3bar_handle_readable(struct status
+                               status->buffer_index -= ++c;
+                               memmove(status->buffer, &status->buffer[c], status->buffer_index);
+                               break;
+-                      } else if (!isspace(status->buffer[c])) {
++                      } else if (!isspace((unsigned char)status->buffer[c])) {
+                               sway_log(SWAY_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'",
+                                               status->buffer[c]);
+                               status_error(status, "[invalid i3bar json]");
+@@ -166,7 +166,7 @@ bool i3bar_handle_readable(struct status
+                                       status->expecting_comma = false;
+                                       ++buffer_pos;
+                                       break;
+-                              } else if (!isspace(status->buffer[buffer_pos])) {
++                              } else if (!isspace((unsigned char)status->buffer[buffer_pos])) {
+                                       sway_log(SWAY_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'",
+                                                       status->buffer[buffer_pos]);
+                                       status_error(status, "[invalid i3bar json]");
+@@ -197,7 +197,7 @@ bool i3bar_handle_readable(struct status
+                               char *last_char_pos =
+                                       &status->buffer[buffer_pos + status->tokener->char_offset - 1];
+                               char last_char = *last_char_pos;
+-                              while (isspace(last_char)) {
++                              while (isspace((unsigned char)last_char)) {
+                                       last_char = *--last_char_pos;
+                               }
+                               *last_char_pos = '\0';
Index: pkgsrc/wayland/sway/patches/patch-swaybar_tray_icon.c
diff -u /dev/null pkgsrc/wayland/sway/patches/patch-swaybar_tray_icon.c:1.1
--- /dev/null   Tue Apr 14 11:32:15 2026
+++ pkgsrc/wayland/sway/patches/patch-swaybar_tray_icon.c       Tue Apr 14 11:32:15 2026
@@ -0,0 +1,48 @@
+$NetBSD: patch-swaybar_tray_icon.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- swaybar/tray/icon.c.orig   2026-02-06 14:22:15.740453549 +0000
++++ swaybar/tray/icon.c
+@@ -228,17 +228,17 @@ static struct icon_theme *read_theme_fil
+               ++line_no;
+ 
+               char *line = full_line - 1;
+-              while (isspace(*++line)) {} // remove leading whitespace
++              while (isspace((unsigned char)*++line)) {} // remove leading whitespace
+               if (!*line || line[0] == '#') continue; // ignore blank lines & comments
+ 
+               int len = nread - (line - full_line);
+-              while (isspace(line[--len])) {}
++              while (isspace((unsigned char)line[--len])) {}
+               line[++len] = '\0'; // remove trailing whitespace
+ 
+               if (line[0] == '[') { // group header
+                       // check well-formed
+                       int i = 1;
+-                      for (; !iscntrl(line[i]) && line[i] != '[' && line[i] != ']'; ++i) {}
++                      for (; !iscntrl((unsigned char)line[i]) && line[i] != '[' && line[i] != ']'; ++i) {}
+                       if (i != --len || line[i] != ']') {
+                               error = "malformed group header";
+                               break;
+@@ -268,9 +268,9 @@ static struct icon_theme *read_theme_fil
+ 
+                       // check well-formed
+                       int eok = 0;
+-                      for (; isalnum(line[eok]) || line[eok] == '-'; ++eok) {} // TODO locale?
++                      for (; isalnum((unsigned char)line[eok]) || line[eok] == '-'; ++eok) {} // TODO locale?
+                       int i = eok - 1;
+-                      while (isspace(line[++i])) {}
++                      while (isspace((unsigned char)line[++i])) {}
+                       if (line[i] != '=') {
+                               error = "malformed key-value pair";
+                               break;
+@@ -278,7 +278,7 @@ static struct icon_theme *read_theme_fil
+ 
+                       line[eok] = '\0'; // split into key-value pair
+                       char *value = &line[i];
+-                      while (isspace(*++value)) {}
++                      while (isspace((unsigned char)*++value)) {}
+                       // TODO unescape value
+ 
+                       error = entry_handler(groups->items[groups->length - 1], line,



Home | Main Index | Thread Index | Old Index