From e008fa8e533a02489aa72168c5475f249a4073b6 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sun, 13 Mar 2022 15:10:53 +0300 Subject: [PATCH 01/10] pcre2: new package at 10.39 --- extra/pcre2/README | 42 ++++++++++++++++++++++++++++++++++++++++++ extra/pcre2/build | 12 ++++++++++++ extra/pcre2/checksums | 1 + extra/pcre2/sources | 1 + extra/pcre2/version | 1 + 5 files changed, 57 insertions(+) create mode 100644 extra/pcre2/README create mode 100755 extra/pcre2/build create mode 100644 extra/pcre2/checksums create mode 100644 extra/pcre2/sources create mode 100644 extra/pcre2/version diff --git a/extra/pcre2/README b/extra/pcre2/README new file mode 100644 index 00000000..7388a19d --- /dev/null +++ b/extra/pcre2/README @@ -0,0 +1,42 @@ +pcre2 +________________________________________________________________________________ + +Perl Compatible Regular Expressions (PCRE) is a library written in C, which +implements a regular expression engine, inspired by the capabilities of the +Perl programming language. Philip Hazel started writing PCRE in summer 1997. +PCRE's syntax is much more powerful and flexible than either of the POSIX +regular expression flavors (BRE, ERE) and than that of many other +regular-expression libraries. [0] + +Upstream: https://www.pcre.org/ + + +[000] Index +________________________________________________________________________________ + +* Installation ........................................................... [001] +* Usage .................................................................. [002] +* References ............................................................. [003] + + +[001] Installation +________________________________________________________________________________ + ++------------------------------------------------------------------------------+ +| | +| $ kiss b pcre2 | +| | ++------------------------------------------------------------------------------+ + + +[002] Usage +________________________________________________________________________________ + +Refer to the manual pages and command help output. + + +[003] References +________________________________________________________________________________ + +[0] https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions + diff --git a/extra/pcre2/build b/extra/pcre2/build new file mode 100755 index 00000000..f086ea76 --- /dev/null +++ b/extra/pcre2/build @@ -0,0 +1,12 @@ +#!/bin/sh -e + +./configure \ + --prefix=/usr \ + --enable-pcre2-16 \ + --enable-pcre2-32 \ + --enable-pcre2grep-libz \ + --enable-pcre2grep-libbz2 \ + --enable-jit + +make +make DESTDIR="$1" install diff --git a/extra/pcre2/checksums b/extra/pcre2/checksums new file mode 100644 index 00000000..47e5d82c --- /dev/null +++ b/extra/pcre2/checksums @@ -0,0 +1 @@ +0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440 diff --git a/extra/pcre2/sources b/extra/pcre2/sources new file mode 100644 index 00000000..1e02d442 --- /dev/null +++ b/extra/pcre2/sources @@ -0,0 +1 @@ +https://github.com/PhilipHazel/pcre2/releases/download/pcre2-VERSION/pcre2-VERSION.tar.bz2 diff --git a/extra/pcre2/version b/extra/pcre2/version new file mode 100644 index 00000000..356404f7 --- /dev/null +++ b/extra/pcre2/version @@ -0,0 +1 @@ +10.39 1 From d0e9f0b4652a894c46a2dbb4803826949deebd19 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sun, 13 Mar 2022 15:12:48 +0300 Subject: [PATCH 02/10] glib: replace pcre with pcre2 --- extra/glib/depends | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/glib/depends b/extra/glib/depends index c9febaee..29ad1a54 100644 --- a/extra/glib/depends +++ b/extra/glib/depends @@ -1,5 +1,5 @@ libffi meson make -pcre +pcre2 pkgconf make zlib From 7cb3931cd82b188c114d64ddb54904f420515229 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sun, 13 Mar 2022 15:28:35 +0300 Subject: [PATCH 03/10] sway: replace pcre with pcre2 --- wayland/sway/depends | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland/sway/depends b/wayland/sway/depends index 00bb92dd..ec560b6b 100644 --- a/wayland/sway/depends +++ b/wayland/sway/depends @@ -8,7 +8,7 @@ linux-headers make mesa meson make pango -pcre +pcre2 pixman pkgconf make wayland From d800bb61799b6436169ec3955d123caf09943998 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sun, 13 Mar 2022 15:28:53 +0300 Subject: [PATCH 04/10] sway-no-seat: replace pcre with pcre2 --- wayland/sway-no-seat/depends | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland/sway-no-seat/depends b/wayland/sway-no-seat/depends index 56221282..565a6aa0 100644 --- a/wayland/sway-no-seat/depends +++ b/wayland/sway-no-seat/depends @@ -7,7 +7,7 @@ linux-headers make mesa meson make pango -pcre +pcre2 pixman pkgconf make wayland From 150d30279703c5cb087b32161acd513cf2bdb9d4 Mon Sep 17 00:00:00 2001 From: illiliti Date: Sun, 13 Mar 2022 15:31:49 +0300 Subject: [PATCH 05/10] pcre: drop --- extra/pcre/README | 42 ------------------------------------------ extra/pcre/build | 10 ---------- extra/pcre/checksums | 1 - extra/pcre/sources | 1 - extra/pcre/version | 1 - 5 files changed, 55 deletions(-) delete mode 100644 extra/pcre/README delete mode 100755 extra/pcre/build delete mode 100644 extra/pcre/checksums delete mode 100644 extra/pcre/sources delete mode 100644 extra/pcre/version diff --git a/extra/pcre/README b/extra/pcre/README deleted file mode 100644 index 712abdc2..00000000 --- a/extra/pcre/README +++ /dev/null @@ -1,42 +0,0 @@ -pcre -________________________________________________________________________________ - -Perl Compatible Regular Expressions (PCRE) is a library written in C, which -implements a regular expression engine, inspired by the capabilities of the -Perl programming language. Philip Hazel started writing PCRE in summer 1997. -PCRE's syntax is much more powerful and flexible than either of the POSIX -regular expression flavors (BRE, ERE) and than that of many other -regular-expression libraries. [0] - -Upstream: https://www.pcre.org/ - - -[000] Index -________________________________________________________________________________ - -* Installation ........................................................... [001] -* Usage .................................................................. [002] -* References ............................................................. [003] - - -[001] Installation -________________________________________________________________________________ - -+------------------------------------------------------------------------------+ -| | -| $ kiss b pcre | -| | -+------------------------------------------------------------------------------+ - - -[002] Usage -________________________________________________________________________________ - -Refer to the manual pages and command help output. - - -[003] References -________________________________________________________________________________ - -[0] https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions - diff --git a/extra/pcre/build b/extra/pcre/build deleted file mode 100755 index 4a375d24..00000000 --- a/extra/pcre/build +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -e - -./configure \ - --prefix=/usr \ - --enable-unicode-properties - -make -make install - -rm -rf "$1/usr/share/doc" diff --git a/extra/pcre/checksums b/extra/pcre/checksums deleted file mode 100644 index cae22a40..00000000 --- a/extra/pcre/checksums +++ /dev/null @@ -1 +0,0 @@ -4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 diff --git a/extra/pcre/sources b/extra/pcre/sources deleted file mode 100644 index 4b146162..00000000 --- a/extra/pcre/sources +++ /dev/null @@ -1 +0,0 @@ -https://downloads.sourceforge.net/pcre/pcre-VERSION.tar.gz diff --git a/extra/pcre/version b/extra/pcre/version deleted file mode 100644 index d300bfb9..00000000 --- a/extra/pcre/version +++ /dev/null @@ -1 +0,0 @@ -8.45 1 From 2405dbcdb0f1b80140ae4e153d10af69ac90e136 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Thu, 28 Apr 2022 12:23:54 -0500 Subject: [PATCH 06/10] sway[-no-seat]: backport pcre2 commits --- wayland/sway-no-seat/build | 5 +- wayland/sway-no-seat/checksums | 3 +- wayland/sway-no-seat/patches/pcre2.patch | 215 +++++++++++++++++++++++ wayland/sway-no-seat/sources | 3 +- wayland/sway/build | 1 + wayland/sway/checksums | 1 + wayland/sway/patches/pcre2.patch | 215 +++++++++++++++++++++++ wayland/sway/sources | 1 + wayland/sway/version | 2 +- 9 files changed, 441 insertions(+), 5 deletions(-) create mode 100644 wayland/sway-no-seat/patches/pcre2.patch create mode 100644 wayland/sway/patches/pcre2.patch diff --git a/wayland/sway-no-seat/build b/wayland/sway-no-seat/build index eecc2b49..9a595fb7 100755 --- a/wayland/sway-no-seat/build +++ b/wayland/sway-no-seat/build @@ -1,7 +1,8 @@ #!/bin/sh -e -patch -p1 < sway-static.patch -patch -p1 < no-evdev.patch +for p in *.patch; do + patch -p1 < "$p" +done # Build fails in subprojects/seatd with clang # due to -Werror -> -Wsign-compare. diff --git a/wayland/sway-no-seat/checksums b/wayland/sway-no-seat/checksums index f2de0523..8a2e9c8e 100644 --- a/wayland/sway-no-seat/checksums +++ b/wayland/sway-no-seat/checksums @@ -1,5 +1,6 @@ 8ac605dd25204dcd87ab352c8639b75361dc9ed276673797ef9c92bfd7cd18b5 1b999077290f3f5aa86cf98e3610df56834fbc23b12b4f2ead5bf31ecad0372f 210ddf8efa1149cde4dd35908bef8e9e63c2edaa0cdb5435f2e6db277fafff3c -0c0777dc70569be07bf602b55628c474a5ceb256650e4bcccaefd4038ae4a655 884c36e3184fc41ddd9353c667e85ba27843ad3f392344b0fd70e2a81bf503b6 +78719bb6c8accabf18418631911624164c4164c72bb37381922668f6f635463b +0c0777dc70569be07bf602b55628c474a5ceb256650e4bcccaefd4038ae4a655 diff --git a/wayland/sway-no-seat/patches/pcre2.patch b/wayland/sway-no-seat/patches/pcre2.patch new file mode 100644 index 00000000..ada85034 --- /dev/null +++ b/wayland/sway-no-seat/patches/pcre2.patch @@ -0,0 +1,215 @@ +diff --git a/include/sway/criteria.h b/include/sway/criteria.h +index ad8610cd..59f57f94 100644 +--- a/include/sway/criteria.h ++++ b/include/sway/criteria.h +@@ -1,7 +1,8 @@ + #ifndef _SWAY_CRITERIA_H + #define _SWAY_CRITERIA_H + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "config.h" + #include "list.h" + #include "tree/view.h" +@@ -15,13 +16,13 @@ enum criteria_type { + }; + + enum pattern_type { +- PATTERN_PCRE, ++ PATTERN_PCRE2, + PATTERN_FOCUSED, + }; + + struct pattern { + enum pattern_type match_type; +- pcre *regex; ++ pcre2_code *regex; + }; + + struct criteria { +diff --git a/meson.build b/meson.build +index 5e4de87f..c59e4142 100644 +--- a/meson.build ++++ b/meson.build +@@ -36,7 +36,7 @@ if is_freebsd + endif + + jsonc = dependency('json-c', version: '>=0.13') +-pcre = dependency('libpcre') ++pcre2 = dependency('libpcre2-8') + wayland_server = dependency('wayland-server') + wayland_client = dependency('wayland-client') + wayland_cursor = dependency('wayland-cursor') +diff --git a/sway/criteria.c b/sway/criteria.c +index d2a5566f..94751c5f 100644 +--- a/sway/criteria.c ++++ b/sway/criteria.c +@@ -3,7 +3,8 @@ + #include + #include + #include +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sway/criteria.h" + #include "sway/tree/container.h" + #include "sway/config.h" +@@ -40,17 +41,19 @@ bool criteria_is_empty(struct criteria *criteria) { + char *error = NULL; + + // Returns error string on failure or NULL otherwise. +-static bool generate_regex(pcre **regex, char *value) { +- const char *reg_err; +- int offset; +- +- *regex = pcre_compile(value, PCRE_UTF8 | PCRE_UCP, ®_err, &offset, NULL); ++static bool generate_regex(pcre2_code **regex, char *value) { ++ int errorcode; ++ PCRE2_SIZE offset; + ++ *regex = pcre2_compile((PCRE2_SPTR)value, PCRE2_ZERO_TERMINATED, PCRE2_UTF | PCRE2_UCP, &errorcode, &offset, NULL); + if (!*regex) { ++ PCRE2_UCHAR buffer[256]; ++ pcre2_get_error_message(errorcode, buffer, sizeof(buffer)); ++ + const char *fmt = "Regex compilation for '%s' failed: %s"; +- int len = strlen(fmt) + strlen(value) + strlen(reg_err) - 3; ++ int len = strlen(fmt) + strlen(value) + strlen((char*) buffer) - 3; + error = malloc(len); +- snprintf(error, len, fmt, value, reg_err); ++ snprintf(error, len, fmt, value, buffer); + return false; + } + +@@ -66,7 +69,7 @@ static bool pattern_create(struct pattern **pattern, char *value) { + if (strcmp(value, "__focused__") == 0) { + (*pattern)->match_type = PATTERN_FOCUSED; + } else { +- (*pattern)->match_type = PATTERN_PCRE; ++ (*pattern)->match_type = PATTERN_PCRE2; + if (!generate_regex(&(*pattern)->regex, value)) { + return false; + }; +@@ -77,7 +80,7 @@ static bool pattern_create(struct pattern **pattern, char *value) { + static void pattern_destroy(struct pattern *pattern) { + if (pattern) { + if (pattern->regex) { +- pcre_free(pattern->regex); ++ pcre2_code_free(pattern->regex); + } + free(pattern); + } +@@ -99,8 +102,11 @@ void criteria_destroy(struct criteria *criteria) { + free(criteria); + } + +-static int regex_cmp(const char *item, const pcre *regex) { +- return pcre_exec(regex, NULL, item, strlen(item), 0, 0, NULL, 0); ++static int regex_cmp(const char *item, const pcre2_code *regex) { ++ pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(regex, NULL); ++ int result = pcre2_match(regex, (PCRE2_SPTR)item, strlen(item), 0, 0, match_data, NULL); ++ pcre2_match_data_free(match_data); ++ return result; + } + + #if HAVE_XWAYLAND +@@ -155,7 +161,7 @@ static bool criteria_matches_container(struct criteria *criteria, + bool exists = false; + struct sway_container *con = container; + for (int i = 0; i < con->marks->length; ++i) { +- if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) == 0) { ++ if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) >= 0) { + exists = true; + break; + } +@@ -192,8 +198,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(title, criteria->title->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(title, criteria->title->regex) < 0) { + return false; + } + break; +@@ -212,8 +218,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(shell, criteria->shell->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(shell, criteria->shell->regex) < 0) { + return false; + } + break; +@@ -232,8 +238,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(app_id, criteria->app_id->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(app_id, criteria->app_id->regex) < 0) { + return false; + } + break; +@@ -264,8 +270,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(class, criteria->class->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(class, criteria->class->regex) < 0) { + return false; + } + break; +@@ -284,8 +290,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(instance, criteria->instance->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(instance, criteria->instance->regex) < 0) { + return false; + } + break; +@@ -304,8 +310,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(window_role, criteria->window_role->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(window_role, criteria->window_role->regex) < 0) { + return false; + } + break; +@@ -363,8 +369,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(ws->name, criteria->workspace->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(ws->name, criteria->workspace->regex) < 0) { + return false; + } + break; +diff --git a/sway/meson.build b/sway/meson.build +index 8eab31a2..5f34ce6b 100644 +--- a/sway/meson.build ++++ b/sway/meson.build +@@ -213,7 +213,7 @@ sway_deps = [ + libudev, + math, + pango, +- pcre, ++ pcre2, + glesv2, + pixman, + server_protos, diff --git a/wayland/sway-no-seat/sources b/wayland/sway-no-seat/sources index e0012f9e..98b63e09 100644 --- a/wayland/sway-no-seat/sources +++ b/wayland/sway-no-seat/sources @@ -1,5 +1,6 @@ https://github.com/swaywm/sway/archive/VERSION.tar.gz https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/e5063ef3a3b12d4384595cb0554cf1f84d5be6f8.tar.gz subprojects/wlroots https://git.sr.ht/~kennylevinsen/seatd/archive/0.7.0.tar.gz subprojects/seatd -patches/sway-static.patch patches/no-evdev.patch +patches/pcre2.patch +patches/sway-static.patch diff --git a/wayland/sway/build b/wayland/sway/build index c1ad52e9..1127d094 100755 --- a/wayland/sway/build +++ b/wayland/sway/build @@ -4,6 +4,7 @@ export CFLAGS="$CFLAGS -Wno-error" patch -p1 < no-evdev.patch +patch -p1 < pcre2.patch # Default background color. sed 's/0.25f, 0.25f, 0.25f/0.929, 0.870, 0.678/' \ diff --git a/wayland/sway/checksums b/wayland/sway/checksums index ad0122d4..480f64ed 100644 --- a/wayland/sway/checksums +++ b/wayland/sway/checksums @@ -1,2 +1,3 @@ 0c64536fb2883ec518e75cfb119f9300115fb49b084e3fde62b794fe2c6c8d84 089a4e120c4c99ff784f7e5fc0f050f8416b4d5b98d418c2d36afe3f31da3349 +82095453e072da69ee26d9f221f7c25ecf5f092882727e4d2c755d8ad6aa78ee diff --git a/wayland/sway/patches/pcre2.patch b/wayland/sway/patches/pcre2.patch new file mode 100644 index 00000000..91704a34 --- /dev/null +++ b/wayland/sway/patches/pcre2.patch @@ -0,0 +1,215 @@ +diff --git a/include/sway/criteria.h b/include/sway/criteria.h +index ad8610cd..59f57f94 100644 +--- a/include/sway/criteria.h ++++ b/include/sway/criteria.h +@@ -1,7 +1,8 @@ + #ifndef _SWAY_CRITERIA_H + #define _SWAY_CRITERIA_H + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "config.h" + #include "list.h" + #include "tree/view.h" +@@ -15,13 +16,13 @@ enum criteria_type { + }; + + enum pattern_type { +- PATTERN_PCRE, ++ PATTERN_PCRE2, + PATTERN_FOCUSED, + }; + + struct pattern { + enum pattern_type match_type; +- pcre *regex; ++ pcre2_code *regex; + }; + + struct criteria { +diff --git a/meson.build b/meson.build +index 5e4de87f..c59e4142 100644 +--- a/meson.build ++++ b/meson.build +@@ -36,7 +36,7 @@ if is_freebsd + endif + + jsonc = dependency('json-c', version: '>=0.13') +-pcre = dependency('libpcre') ++pcre2 = dependency('libpcre2-8') + wayland_server = dependency('wayland-server', version: '>=1.20.0') + wayland_client = dependency('wayland-client') + wayland_cursor = dependency('wayland-cursor') +diff --git a/sway/criteria.c b/sway/criteria.c +index d2a5566f..94751c5f 100644 +--- a/sway/criteria.c ++++ b/sway/criteria.c +@@ -3,7 +3,8 @@ + #include + #include + #include +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sway/criteria.h" + #include "sway/tree/container.h" + #include "sway/config.h" +@@ -40,17 +41,19 @@ bool criteria_is_empty(struct criteria *criteria) { + char *error = NULL; + + // Returns error string on failure or NULL otherwise. +-static bool generate_regex(pcre **regex, char *value) { +- const char *reg_err; +- int offset; +- +- *regex = pcre_compile(value, PCRE_UTF8 | PCRE_UCP, ®_err, &offset, NULL); ++static bool generate_regex(pcre2_code **regex, char *value) { ++ int errorcode; ++ PCRE2_SIZE offset; + ++ *regex = pcre2_compile((PCRE2_SPTR)value, PCRE2_ZERO_TERMINATED, PCRE2_UTF | PCRE2_UCP, &errorcode, &offset, NULL); + if (!*regex) { ++ PCRE2_UCHAR buffer[256]; ++ pcre2_get_error_message(errorcode, buffer, sizeof(buffer)); ++ + const char *fmt = "Regex compilation for '%s' failed: %s"; +- int len = strlen(fmt) + strlen(value) + strlen(reg_err) - 3; ++ int len = strlen(fmt) + strlen(value) + strlen((char*) buffer) - 3; + error = malloc(len); +- snprintf(error, len, fmt, value, reg_err); ++ snprintf(error, len, fmt, value, buffer); + return false; + } + +@@ -66,7 +69,7 @@ static bool pattern_create(struct pattern **pattern, char *value) { + if (strcmp(value, "__focused__") == 0) { + (*pattern)->match_type = PATTERN_FOCUSED; + } else { +- (*pattern)->match_type = PATTERN_PCRE; ++ (*pattern)->match_type = PATTERN_PCRE2; + if (!generate_regex(&(*pattern)->regex, value)) { + return false; + }; +@@ -77,7 +80,7 @@ static bool pattern_create(struct pattern **pattern, char *value) { + static void pattern_destroy(struct pattern *pattern) { + if (pattern) { + if (pattern->regex) { +- pcre_free(pattern->regex); ++ pcre2_code_free(pattern->regex); + } + free(pattern); + } +@@ -99,8 +102,11 @@ void criteria_destroy(struct criteria *criteria) { + free(criteria); + } + +-static int regex_cmp(const char *item, const pcre *regex) { +- return pcre_exec(regex, NULL, item, strlen(item), 0, 0, NULL, 0); ++static int regex_cmp(const char *item, const pcre2_code *regex) { ++ pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(regex, NULL); ++ int result = pcre2_match(regex, (PCRE2_SPTR)item, strlen(item), 0, 0, match_data, NULL); ++ pcre2_match_data_free(match_data); ++ return result; + } + + #if HAVE_XWAYLAND +@@ -155,7 +161,7 @@ static bool criteria_matches_container(struct criteria *criteria, + bool exists = false; + struct sway_container *con = container; + for (int i = 0; i < con->marks->length; ++i) { +- if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) == 0) { ++ if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) >= 0) { + exists = true; + break; + } +@@ -192,8 +198,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(title, criteria->title->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(title, criteria->title->regex) < 0) { + return false; + } + break; +@@ -212,8 +218,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(shell, criteria->shell->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(shell, criteria->shell->regex) < 0) { + return false; + } + break; +@@ -232,8 +238,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(app_id, criteria->app_id->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(app_id, criteria->app_id->regex) < 0) { + return false; + } + break; +@@ -264,8 +270,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(class, criteria->class->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(class, criteria->class->regex) < 0) { + return false; + } + break; +@@ -284,8 +290,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(instance, criteria->instance->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(instance, criteria->instance->regex) < 0) { + return false; + } + break; +@@ -304,8 +310,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(window_role, criteria->window_role->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(window_role, criteria->window_role->regex) < 0) { + return false; + } + break; +@@ -363,8 +369,8 @@ static bool criteria_matches_view(struct criteria *criteria, + return false; + } + break; +- case PATTERN_PCRE: +- if (regex_cmp(ws->name, criteria->workspace->regex) != 0) { ++ case PATTERN_PCRE2: ++ if (regex_cmp(ws->name, criteria->workspace->regex) < 0) { + return false; + } + break; +diff --git a/sway/meson.build b/sway/meson.build +index 8eab31a2..5f34ce6b 100644 +--- a/sway/meson.build ++++ b/sway/meson.build +@@ -213,7 +213,7 @@ sway_deps = [ + libudev, + math, + pango, +- pcre, ++ pcre2, + glesv2, + pixman, + server_protos, diff --git a/wayland/sway/sources b/wayland/sway/sources index 1d0d2061..08c8fdef 100644 --- a/wayland/sway/sources +++ b/wayland/sway/sources @@ -1,2 +1,3 @@ https://github.com/swaywm/sway/releases/download/VERSION/sway-VERSION.tar.gz patches/no-evdev.patch +patches/pcre2.patch diff --git a/wayland/sway/version b/wayland/sway/version index 46b73aef..13be318a 100644 --- a/wayland/sway/version +++ b/wayland/sway/version @@ -1 +1 @@ -1.7 1 +1.7 2 From 5c89d30bb1754cb73d63908f1224fa3f0f02b6fd Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 12 Jul 2022 20:10:17 -0500 Subject: [PATCH 07/10] glib: 2.73.2 --- extra/glib/build | 2 ++ extra/glib/checksums | 3 ++- extra/glib/patches/musl.patch | 17 +++++++++++++++++ extra/glib/sources | 1 + extra/glib/version | 2 +- 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 extra/glib/patches/musl.patch diff --git a/extra/glib/build b/extra/glib/build index eb1f4610..76b06522 100755 --- a/extra/glib/build +++ b/extra/glib/build @@ -1,5 +1,7 @@ #!/bin/sh -e +patch -p1 < musl.patch + # Remove 'util-linux' dependency. sed 's/libmount_dep.found()/false/' meson.build > _ mv -f _ meson.build diff --git a/extra/glib/checksums b/extra/glib/checksums index fd36f1e5..b064c818 100644 --- a/extra/glib/checksums +++ b/extra/glib/checksums @@ -1 +1,2 @@ -77b21da5bd195a8e5f751206a2acab477636e3d02fe4f3796ede5788255382ae +5f3ee36e34f4aaab393c3e3dc46fb01b32f7ead6c88d41d7f20d88a49cdef1d9 +5476b0c742dc348812de45f0a26dc9f471c432e56aec2c2074a23a8488c1caf6 diff --git a/extra/glib/patches/musl.patch b/extra/glib/patches/musl.patch new file mode 100644 index 00000000..654e9303 --- /dev/null +++ b/extra/glib/patches/musl.patch @@ -0,0 +1,17 @@ +diff --git a/glib/gmain.c b/glib/gmain.c +index fcf0b3dba..af1ed66b4 100644 +--- a/glib/gmain.c ++++ b/glib/gmain.c +@@ -73,6 +73,12 @@ + #include + #include + #include /* P_PIDFD */ ++#ifndef W_EXITCODE ++#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) ++#endif ++#ifndef W_STOPCODE ++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) ++#endif + #endif /* HAVE_PIDFD */ + + #ifdef G_OS_WIN32 diff --git a/extra/glib/sources b/extra/glib/sources index defa65c7..c5fbd0c2 100644 --- a/extra/glib/sources +++ b/extra/glib/sources @@ -1 +1,2 @@ https://download.gnome.org/sources/glib/MAJOR.MINOR/glib-VERSION.tar.xz +patches/musl.patch diff --git a/extra/glib/version b/extra/glib/version index de6a94bb..6ba906e5 100644 --- a/extra/glib/version +++ b/extra/glib/version @@ -1 +1 @@ -2.73.1 1 +2.73.2 1 From ea9a21a733f33fc8222070f020fe3aeed9314bc4 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 12 Jul 2022 20:10:38 -0500 Subject: [PATCH 08/10] pcre2: 10.40 --- extra/pcre2/checksums | 2 +- extra/pcre2/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/pcre2/checksums b/extra/pcre2/checksums index 47e5d82c..37e93612 100644 --- a/extra/pcre2/checksums +++ b/extra/pcre2/checksums @@ -1 +1 @@ -0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440 +14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68 diff --git a/extra/pcre2/version b/extra/pcre2/version index 356404f7..059d7483 100644 --- a/extra/pcre2/version +++ b/extra/pcre2/version @@ -1 +1 @@ -10.39 1 +10.40 1 From dcdbc0219bf93487f973c0c9f299ca301a18ee41 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 12 Jul 2022 20:13:40 -0500 Subject: [PATCH 09/10] sway-no-seat: bump version --- wayland/sway-no-seat/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland/sway-no-seat/version b/wayland/sway-no-seat/version index fe0a6460..4721d6b1 100644 --- a/wayland/sway-no-seat/version +++ b/wayland/sway-no-seat/version @@ -1 +1 @@ -6ffa4b1f7000cd90d63213820039ee432803e66a 2 +6ffa4b1f7000cd90d63213820039ee432803e66a 3 From b20697500803e0e5a10344aa8144d9ea36d44341 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 12 Jul 2022 20:17:59 -0500 Subject: [PATCH 10/10] pcre2: update source --- extra/pcre2/sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/pcre2/sources b/extra/pcre2/sources index 1e02d442..8b28922e 100644 --- a/extra/pcre2/sources +++ b/extra/pcre2/sources @@ -1 +1 @@ -https://github.com/PhilipHazel/pcre2/releases/download/pcre2-VERSION/pcre2-VERSION.tar.bz2 +https://github.com/PCRE2Project/pcre2/releases/download/pcre2-VERSION/pcre2-VERSION.tar.bz2