hi,

here's two diffs to update wlroots to the recently released 0.17.0, and
update sway to a more recent commit (eg last commit before they started
using wlroots apis not in 0.17.0).

Both ports now use upstream sources, and i've added your commits as
patches in most places, taken from
https://gitlab.freedesktop.org/mherrb/wlroots/-/compare/master...obsd?from_project_id=12103
and
https://github.com/mherrb/sway/commit/1f64b183d3c12aaf54f43c474a709cc79ccbbb59
for the latter, some of the work that was done to find config files in
swayidle/swaylock can be reused.

sway runs fine here - ive reseted the version since it's still UNLINKED,
but i've bumped EPOCH for wlroots.

feedback and testing welcome :)

Landry
Index: Makefile
===================================================================
RCS file: /cvs/ports/wayland/sway/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile    12 Nov 2023 10:46:11 -0000      1.6
+++ Makefile    24 Nov 2023 17:57:58 -0000
@@ -1,13 +1,10 @@
 COMMENT =      i3-compatible Wayland compositor
 UNLINKED       = wayland
 
-V =            20231108
-PKGNAME =      sway-${V}
-
-GH_ACCOUNT =   mherrb
+GH_ACCOUNT =   swaywm
 GH_PROJECT =   sway
-GH_TAGNAME =   sway-obsd-${V}
-
+GH_COMMIT =    bff991dfdc63ca3785a810ff4d913ddfd71677a1
+DISTNAME =     ${GH_PROJECT}-1.8.1pl20231121
 CATEGORIES =   wayland
 
 HOMEPAGE =     https://github.com/swaywm/sway
Index: distinfo
===================================================================
RCS file: /cvs/ports/wayland/sway/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo    8 Nov 2023 14:04:07 -0000       1.2
+++ distinfo    24 Nov 2023 17:57:58 -0000
@@ -1,2 +1,2 @@
-SHA256 (sway-sway-obsd-20231108.tar.gz) = 
YC2EMMvJDzJ/XHaz+sve1ND1JhDp7HEYnD4wQyPYhfE=
-SIZE (sway-sway-obsd-20231108.tar.gz) = 5580535
+SHA256 (sway-1.8.1pl20231121-bff991df.tar.gz) = 
6WbJ34/vaJ6cwLp6BYh/ogpnz2a0Qz/FPXA9CwhT9WA=
+SIZE (sway-1.8.1pl20231121-bff991df.tar.gz) = 5581167
Index: patches/patch-common_stringop_c
===================================================================
RCS file: patches/patch-common_stringop_c
diff -N patches/patch-common_stringop_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-common_stringop_c     24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,20 @@
+Index: common/stringop.c
+--- common/stringop.c.orig
++++ common/stringop.c
+@@ -6,7 +6,16 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <strings.h>
++#ifndef __OpenBSD__
+ #include <wordexp.h>
++#else
++#include <glob.h>
++#define wordexp_t glob_t
++#define wordfree globfree
++#define wordexp(s,p,f) glob((s), GLOB_DOOFFS, NULL, (p))
++#define we_wordc gl_pathc
++#define we_wordv gl_pathv
++#endif
+ #include "list.h"
+ #include "log.h"
+ #include "stringop.h"
Index: patches/patch-include_stringop_h
===================================================================
RCS file: patches/patch-include_stringop_h
diff -N patches/patch-include_stringop_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_stringop_h    24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,11 @@
+Index: include/stringop.h
+--- include/stringop.h.orig
++++ include/stringop.h
+@@ -1,6 +1,7 @@
+ #ifndef _SWAY_STRINGOP_H
+ #define _SWAY_STRINGOP_H
+ 
++#include <stdarg.h>
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include "list.h"
Index: patches/patch-meson_build
===================================================================
RCS file: patches/patch-meson_build
diff -N patches/patch-meson_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-meson_build   24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,11 @@
+Index: meson.build
+--- meson.build.orig
++++ meson.build
+@@ -81,7 +81,6 @@ drm_full = dependency('libdrm') # only needed for drm_
+ drm = drm_full.partial_dependency(compile_args: true, includes: true)
+ libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : 
null_dep
+ math = cc.find_library('m')
+-rt = cc.find_library('rt')
+ xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
+ threads = dependency('threads') # for pthread_setschedparam
+ 
Index: patches/patch-meson_build.orig
===================================================================
RCS file: patches/patch-meson_build.orig
diff -N patches/patch-meson_build.orig
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-meson_build.orig      24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,11 @@
+Index: meson.build
+--- meson.build.orig
++++ meson.build
+@@ -81,7 +81,6 @@ drm_full = dependency('libdrm') # only needed for drm_
+ drm = drm_full.partial_dependency(compile_args: true, includes: true)
+ libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : 
null_dep
+ math = cc.find_library('m')
+-rt = cc.find_library('rt')
+ xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
+ threads = dependency('threads') # for pthread_setschedparam
+ 
Index: patches/patch-sway_config_bar_c
===================================================================
RCS file: patches/patch-sway_config_bar_c
diff -N patches/patch-sway_config_bar_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-sway_config_bar_c     24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,13 @@
+Index: sway/config/bar.c
+--- sway/config/bar.c.orig
++++ sway/config/bar.c
+@@ -9,7 +9,9 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
++#ifndef __OpenBSD__
+ #include <wordexp.h>
++#endif
+ #include "sway/config.h"
+ #include "sway/input/keyboard.h"
+ #include "sway/output.h"
Index: patches/patch-sway_config_c
===================================================================
RCS file: patches/patch-sway_config_c
diff -N patches/patch-sway_config_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-sway_config_c 24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,41 @@
+Index: sway/config.c
+--- sway/config.c.orig
++++ sway/config.c
+@@ -4,7 +4,11 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <libgen.h>
++#ifndef __OpenBSD__
+ #include <wordexp.h>
++#else
++#include <glob.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
+@@ -656,6 +660,7 @@ void load_include_configs(const char *path, struct swa
+               goto cleanup;
+       }
+ 
++#ifndef __OpenBSD__
+       wordexp_t p;
+       if (wordexp(path, &p, 0) == 0) {
+               char **w = p.we_wordv;
+@@ -665,6 +670,17 @@ void load_include_configs(const char *path, struct swa
+               }
+               wordfree(&p);
+       }
++#else
++      glob_t p;
++      if (glob(path, GLOB_DOOFFS, NULL, &p) == 0) {
++              char **w = p.gl_pathv;
++              size_t i;
++              for (i = 0; i < p.gl_pathc; ++i) {
++                      load_include_config(w[i], parent_dir, config, swaynag);
++              }
++              globfree(&p);
++      }
++#endif
+ 
+       // Attempt to restore working directory before returning.
+       if (chdir(wd) < 0) {
Index: patches/patch-swaybar_meson_build
===================================================================
RCS file: patches/patch-swaybar_meson_build
diff -N patches/patch-swaybar_meson_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-swaybar_meson_build   24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,11 @@
+Index: swaybar/meson.build
+--- swaybar/meson.build.orig
++++ swaybar/meson.build
+@@ -13,7 +13,6 @@ swaybar_deps = [
+       math,
+       pango,
+       pangocairo,
+-      rt,
+       wayland_client,
+       wayland_cursor
+ ]
Index: patches/patch-swaynag_config_c
===================================================================
RCS file: patches/patch-swaynag_config_c
diff -N patches/patch-swaynag_config_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-swaynag_config_c      24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,44 @@
+Index: swaynag/config.c
+--- swaynag/config.c.orig
++++ swaynag/config.c
+@@ -2,7 +2,11 @@
+ #include <getopt.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifndef __OpenBSD__
+ #include <wordexp.h>
++#else
++#include <glob.h>
++#endif
+ #include <unistd.h>
+ #include "log.h"
+ #include "list.h"
+@@ -378,6 +382,7 @@ char *swaynag_get_config_path(void) {
+               config_paths[1] = "$HOME/.config/swaynag/config";
+       }
+ 
++#ifndef __OpenBSD__
+       wordexp_t p;
+       for (size_t i = 0; i < sizeof(config_paths) / sizeof(char *); ++i) {
+               if (wordexp(config_paths[i], &p, 0) == 0) {
+@@ -389,7 +394,19 @@ char *swaynag_get_config_path(void) {
+                       free(path);
+               }
+       }
+-
++#else
++      glob_t p;
++      for (size_t i = 0; i < sizeof(config_paths) / sizeof(char *); ++i) {
++              if (glob(config_paths[i], GLOB_DOOFFS, NULL, &p) == 0) {
++                      char *path = strdup(p.gl_pathv[0]);
++                      globfree(&p);
++                      if (file_exists(path)) {
++                              return path;
++                      }
++                      free(path);
++              }
++      }
++#endif
+       return NULL;
+ }
+ 
Index: patches/patch-swaynag_meson_build
===================================================================
RCS file: patches/patch-swaynag_meson_build
diff -N patches/patch-swaynag_meson_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-swaynag_meson_build   24 Nov 2023 17:57:58 -0000
@@ -0,0 +1,11 @@
+Index: swaynag/meson.build
+--- swaynag/meson.build.orig
++++ swaynag/meson.build
+@@ -12,7 +12,6 @@ executable(
+               cairo,
+               pango,
+               pangocairo,
+-              rt,
+               wayland_client,
+               wayland_cursor,
+       ],
? wlroots-0.17.0-libwlroots.so.0.0
Index: Makefile
===================================================================
RCS file: /cvs/ports/wayland/wlroots/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile    20 Nov 2023 07:21:56 -0000      1.5
+++ Makefile    24 Nov 2023 17:56:18 -0000
@@ -1,11 +1,11 @@
 COMMENT =      modular Wayland compositor library
 
-V =            20231108
-PKGNAME =      wlroots-$V
+V =            0.17.0
+EPOCH =                0
+DISTNAME =     wlroots-${V}
 CATEGORIES =   wayland
 
-SITES =        
https://gitlab.freedesktop.org/mherrb/wlroots/-/archive/wlroots-obsd-$V/
-DISTFILES =    wlroots-wlroots-obsd-${V}${EXTRACT_SUFX}
+SITES =                ${HOMEPAGE}/wlroots/-/releases/${V}/downloads/
 
 HOMEPAGE =     https://gitlab.freedesktop.org/wlroots
 
@@ -13,8 +13,6 @@
 PERMIT_PACKAGE = Yes
 
 SHARED_LIBS +=  wlroots 0.0 # 0.0
-
-WRKSRC =       ${WRKDIR}/wlroots-wlroots-obsd-${V}
 
 MODULES =      devel/meson
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/wayland/wlroots/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo    8 Nov 2023 14:03:11 -0000       1.2
+++ distinfo    24 Nov 2023 17:56:18 -0000
@@ -1,2 +1,2 @@
-SHA256 (wlroots-wlroots-obsd-20231108.tar.gz) = 
zIEb9vAbLR3CL6wA9z1wxLNVgmnVe9HEJhGU2ofqr5o=
-SIZE (wlroots-wlroots-obsd-20231108.tar.gz) = 607215
+SHA256 (wlroots-0.17.0.tar.gz) = naNHWmg0pqmo/ZPehPTvkfnuSP9wwwWqlSK/DbnmESg=
+SIZE (wlroots-0.17.0.tar.gz) = 606172
Index: patches/patch-meson_build
===================================================================
RCS file: patches/patch-meson_build
diff -N patches/patch-meson_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-meson_build   24 Nov 2023 17:56:18 -0000
@@ -0,0 +1,19 @@
+Index: meson.build
+--- meson.build.orig
++++ meson.build
+@@ -145,7 +145,6 @@ pixman = dependency('pixman-1',
+       default_options: ['werror=false'],
+ )
+ math = cc.find_library('m')
+-rt = cc.find_library('rt')
+ 
+ wlr_files = []
+ wlr_deps = [
+@@ -154,7 +153,6 @@ wlr_deps = [
+       xkbcommon,
+       pixman,
+       math,
+-      rt,
+ ]
+ 
+ subdir('protocol')
Index: patches/patch-render_vulkan_vulkan_c
===================================================================
RCS file: patches/patch-render_vulkan_vulkan_c
diff -N patches/patch-render_vulkan_vulkan_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-render_vulkan_vulkan_c        24 Nov 2023 17:56:18 -0000
@@ -0,0 +1,11 @@
+otherwise makedev() function isnt found
+
+Index: render/vulkan/vulkan.c
+--- render/vulkan/vulkan.c.orig
++++ render/vulkan/vulkan.c
+@@ -1,4 +1,4 @@
+-#if !defined(__FreeBSD__)
++#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ #define _POSIX_C_SOURCE 200809L
+ #endif
+ #include <assert.h>
Index: patches/patch-xcursor_xcursor_c
===================================================================
RCS file: patches/patch-xcursor_xcursor_c
diff -N patches/patch-xcursor_xcursor_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-xcursor_xcursor_c     24 Nov 2023 17:56:18 -0000
@@ -0,0 +1,12 @@
+Index: xcursor/xcursor.c
+--- xcursor/xcursor.c.orig
++++ xcursor/xcursor.c
+@@ -489,7 +489,7 @@ xcursor_xc_file_load_images(FILE *file, int size)
+ #endif
+ 
+ #ifndef XCURSORPATH
+-#define XCURSORPATH 
"~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"ICONDIR
++#define XCURSORPATH 
"~/.icons:/usr/X11R6/include/pixmaps:/usr/local/share/icons:/usr/local/lib/X11/icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"ICONDIR
+ #endif
+ 
+ #define XDG_DATA_HOME_FALLBACK "~/.local/share"
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/wayland/wlroots/pkg/PLIST,v
retrieving revision 1.2
diff -u -r1.2 PLIST
--- pkg/PLIST   8 Nov 2023 14:03:11 -0000       1.2
+++ pkg/PLIST   24 Nov 2023 17:56:18 -0000
@@ -8,7 +8,6 @@
 include/wlr/backend/multi.h
 include/wlr/backend/session.h
 include/wlr/backend/wayland.h
-include/wlr/backend/wscons.h
 include/wlr/backend/x11.h
 include/wlr/config.h
 include/wlr/interfaces/

Reply via email to