diff --git a/community/swaylock-effects/APKBUILD b/community/swaylock-effects/APKBUILD index 93dc3dee258a773a8651852d937bac9a1403bc23..956e94a3063459d6bf02c76800cba5a4c9845ce5 100644 --- a/community/swaylock-effects/APKBUILD +++ b/community/swaylock-effects/APKBUILD @@ -3,11 +3,10 @@ # Contributor: Michał Polański <michal@polanski.me> # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=swaylock-effects -pkgver=1.6.3 -_pkgver=${pkgver%.*}-${pkgver##*.} -pkgrel=2 +pkgver=1.6.10 +pkgrel=0 pkgdesc="Screen locker for Wayland with fancy effects" -url="https://github.com/mortie/swaylock-effects" +url="https://github.com/jirutka/swaylock-effects" arch="all" license="MIT" options="!check" # no test suite @@ -25,13 +24,8 @@ provider_priority=10 # lowest (other provider is swaylock aport) provides="swaylock" install="$pkgname.post-install" subpackages="$pkgname-dbg $pkgname-doc" -source="https://github.com/mortie/swaylock-effects/archive/v$_pkgver/$pkgname-$_pkgver.tar.gz - ungit-version.patch - backport-patches-from-swaylock.patch - fix-build.patch - meson-remove-mtune-native.patch - " -builddir="$srcdir/$pkgname-$_pkgver" +source="https://github.com/jirutka/swaylock-effects/archive/v$pkgver/$pkgname-$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" prepare() { default_prepare @@ -81,9 +75,5 @@ doc() { } sha512sums=" -397729c830c75ed569d0a45a794a5d426aa803212ed47ee28c28a5f7a277265116b6e456a0712842937e7465b3d92e46979a200d8773e0ad1ca7f558a9928e89 swaylock-effects-1.6-3.tar.gz -9919bb17e2cf2c8dc4fbac3ba91434f775574caca345026bd8f56e6e9caeff85fa5ad86a9485b103da9be7e393734c37c20c32141cd42cc7f479273ca2147f6b ungit-version.patch -59df03584dfc053c7fadf5515d6334b8d19be0e4c2b487e115d03819d30b079a6a14f081d9f017aa8128d3591601d5321839ae984900f36c00ff5e0dfffcafd7 backport-patches-from-swaylock.patch -d28cbe501ec03af0d732813f758555e489718c88cd13029ef2714fe8b27397725213966c1635c12932955bec4d57ae23d079d2621ae65e15b2e2235b843c9743 fix-build.patch -b213fc861df56d8802993b64d3b8104e6ef527f57a704622cdcfadb47364d719bdb9ffd0c117a9992d85c801030cf576f7698d92314a95bc6c2dd83ed6a27c23 meson-remove-mtune-native.patch +7ac696d999606e14ea2ca30b1c290c361d327ce091281af36ae03fa31cf0793b63d994bf6260879f2d7c8d421d52d6e6e9ddd72633dc21fb7f3c2f262be00cc1 swaylock-effects-1.6.10.tar.gz " diff --git a/community/swaylock-effects/backport-patches-from-swaylock.patch b/community/swaylock-effects/backport-patches-from-swaylock.patch deleted file mode 100644 index dcc5657c6eaf70124c2467182d18fe1502c1ad8f..0000000000000000000000000000000000000000 --- a/community/swaylock-effects/backport-patches-from-swaylock.patch +++ /dev/null @@ -1,354 +0,0 @@ -From 7050dd3b448fa23a496b23f92aa2baf7f9dca84d Mon Sep 17 00:00:00 2001 -From: Simon Ser <contact@emersion.fr> -Date: Wed, 10 Feb 2021 17:41:50 +0100 -Subject: [PATCH 01/10] pool-buffer: handle zero-sized buffers - -mako does something similar. ---- - pool-buffer.c | 30 ++++++++++++++++-------------- - 1 file changed, 16 insertions(+), 14 deletions(-) - -Patch-Source: https://github.com/mortie/swaylock-effects/pull/64 - -diff --git a/pool-buffer.c b/pool-buffer.c -index aada4c07..76722834 100644 ---- a/pool-buffer.c -+++ b/pool-buffer.c -@@ -72,18 +72,22 @@ static struct pool_buffer *create_buffer(struct wl_shm *shm, - uint32_t stride = width * 4; - size_t size = stride * height; - -- char *name; -- int fd = create_pool_file(size, &name); -- assert(fd != -1); -- void *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -- struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, size); -- buf->buffer = wl_shm_pool_create_buffer(pool, 0, -- width, height, stride, format); -- wl_shm_pool_destroy(pool); -- close(fd); -- unlink(name); -- free(name); -- fd = -1; -+ void *data = NULL; -+ if (size > 0) { -+ char *name; -+ int fd = create_pool_file(size, &name); -+ assert(fd != -1); -+ data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -+ struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, size); -+ buf->buffer = wl_shm_pool_create_buffer(pool, 0, -+ width, height, stride, format); -+ wl_buffer_add_listener(buf->buffer, &buffer_listener, buf); -+ wl_shm_pool_destroy(pool); -+ close(fd); -+ unlink(name); -+ free(name); -+ fd = -1; -+ } - - buf->size = size; - buf->width = width; -@@ -92,8 +96,6 @@ static struct pool_buffer *create_buffer(struct wl_shm *shm, - buf->surface = cairo_image_surface_create_for_data(data, - CAIRO_FORMAT_ARGB32, width, height, stride); - buf->cairo = cairo_create(buf->surface); -- -- wl_buffer_add_listener(buf->buffer, &buffer_listener, buf); - return buf; - } - - -From 6ad41707847c04a555f803605c112a43d6b014ea Mon Sep 17 00:00:00 2001 -From: Simon Ser <contact@emersion.fr> -Date: Wed, 10 Feb 2021 17:42:36 +0100 -Subject: [PATCH 02/10] Initialize indicator size to zero - -Initializing to 1 is incorrect when the surface scale is > 1. ---- - main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/main.c b/main.c -index 27621874..23ba1526 100644 ---- a/main.c -+++ b/main.c -@@ -351,8 +351,8 @@ static void layer_surface_configure(void *data, - struct swaylock_surface *surface = data; - surface->width = width; - surface->height = height; -- surface->indicator_width = 1; -- surface->indicator_height = 1; -+ surface->indicator_width = 0; -+ surface->indicator_height = 0; - zwlr_layer_surface_v1_ack_configure(layer_surface, serial); - - if (--surface->events_pending == 0) { - -From e4f37a214956928b2134fb4455de1156d962dd1e Mon Sep 17 00:00:00 2001 -From: Simon Ser <contact@emersion.fr> -Date: Wed, 10 Feb 2021 17:45:42 +0100 -Subject: [PATCH 03/10] Use wl_surface.damage_buffer - -We incorrectly used the buffer size instead of the surface size. -Let's not bother and just damage the maximum region. ---- - main.c | 2 +- - render.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/main.c b/main.c -index 23ba1526..f62a3a0f 100644 ---- a/main.c -+++ b/main.c -@@ -707,7 +707,7 @@ static void handle_global(void *data, struct wl_registry *registry, - struct swaylock_state *state = data; - if (strcmp(interface, wl_compositor_interface.name) == 0) { - state->compositor = wl_registry_bind(registry, name, -- &wl_compositor_interface, 3); -+ &wl_compositor_interface, 4); - } else if (strcmp(interface, wl_subcompositor_interface.name) == 0) { - state->subcompositor = wl_registry_bind(registry, name, - &wl_subcompositor_interface, 1); -diff --git a/render.c b/render.c -index 8866f6b8..47eda318 100644 ---- a/render.c -+++ b/render.c -@@ -95,7 +95,7 @@ void render_frame_background(struct swaylock_surface *surface) { - - wl_surface_set_buffer_scale(surface->surface, surface->scale); - wl_surface_attach(surface->surface, surface->current_buffer->buffer, 0, 0); -- wl_surface_damage(surface->surface, 0, 0, surface->width, surface->height); -+ wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX); - wl_surface_commit(surface->surface); - } - -@@ -454,7 +454,7 @@ void render_frame(struct swaylock_surface *surface) { - - wl_surface_set_buffer_scale(surface->child, surface->scale); - wl_surface_attach(surface->child, surface->current_buffer->buffer, 0, 0); -- wl_surface_damage(surface->child, 0, 0, surface->current_buffer->width, surface->current_buffer->height); -+ wl_surface_damage_buffer(surface->child, 0, 0, INT32_MAX, INT32_MAX); - wl_surface_commit(surface->child); - - wl_surface_commit(surface->surface); - -From 14baedc92de9b97f00aa6c35c2291a3af2d08ccd Mon Sep 17 00:00:00 2001 -From: Elyes HAOUAS <ehaouas@noos.fr> -Date: Mon, 12 Apr 2021 18:21:01 +0200 -Subject: [PATCH 04/10] Fix some typos - -Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> ---- - render.c | 2 +- - wlr-layer-shell-unstable-v1.xml | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/render.c b/render.c -index 47eda318..56b042bb 100644 ---- a/render.c -+++ b/render.c -@@ -408,7 +408,7 @@ void render_frame(struct swaylock_surface *surface) { - arc_radius + arc_thickness / 2, 0, 2 * M_PI); - cairo_stroke(cairo); - -- // display layout text seperately -+ // display layout text separately - if (layout_text) { - cairo_text_extents_t extents; - cairo_font_extents_t fe; -diff --git a/wlr-layer-shell-unstable-v1.xml b/wlr-layer-shell-unstable-v1.xml -index 2bb72edd..f29eb879 100644 ---- a/wlr-layer-shell-unstable-v1.xml -+++ b/wlr-layer-shell-unstable-v1.xml -@@ -140,7 +140,7 @@ - how they should interact with surfaces that do. If set to zero, the - surface indicates that it would like to be moved to avoid occluding - surfaces with a positive excluzive zone. If set to -1, the surface -- indicates that it would not like to be moved to accomodate for other -+ indicates that it would not like to be moved to accommodate for other - surfaces, and the compositor should extend it all the way to the edges - it is anchored to. - - -From db2e60a8767dff6820c1633d3076213205d0352a Mon Sep 17 00:00:00 2001 -From: loserMcloser <reebydobalina@gmail.com> -Date: Mon, 31 May 2021 15:01:59 -0600 -Subject: [PATCH 05/10] Draw ring and inner fill separately - ---- - render.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/render.c b/render.c -index 56b042bb..846cc076 100644 ---- a/render.c -+++ b/render.c -@@ -214,12 +214,18 @@ void render_frame(struct swaylock_surface *surface) { - - if (state->args.indicator || - (upstream_show_indicator && state->auth_state != AUTH_STATE_GRACE)) { -- // Draw circle -+ // Fill inner circle -+ cairo_set_line_width(cairo, 0); -+ cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2, -+ arc_radius - arc_thickness / 2, 0, 2 * M_PI); -+ set_color_for_state(cairo, state, &state->args.colors.inside); -+ cairo_fill_preserve(cairo); -+ cairo_stroke(cairo); -+ -+ // Draw ring - cairo_set_line_width(cairo, arc_thickness); - cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2, arc_radius, - 0, 2 * M_PI); -- set_color_for_state(cairo, state, &state->args.colors.inside); -- cairo_fill_preserve(cairo); - set_color_for_state(cairo, state, &state->args.colors.ring); - cairo_stroke(cairo); - - -From b834e01b51816096867797a3d36ed69b4ce226f5 Mon Sep 17 00:00:00 2001 -From: Simon Plakolb <s.plakolb@gmail.com> -Date: Tue, 1 Jun 2021 01:49:58 +0200 -Subject: [PATCH 06/10] Ensure buffer size is multiple of buffer scale - -An odd value of fe.height lead to the indicator disappearing. This was -due to the buffer size no longer being a multiple of the buffer scale. -This commit fixes the issue by checking both height and width to be a -multiple of scale. - -This is done early to avoid excessive re-calls of create_buffer if the -buffer_height != new_height in render.c line 314 (now 318). ---- - render.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/render.c b/render.c -index 846cc076..e2449e71 100644 ---- a/render.c -+++ b/render.c -@@ -450,6 +450,10 @@ void render_frame(struct swaylock_surface *surface) { - } - } - -+ // Ensure buffer size is multiple of buffer scale - required by protocol -+ new_height += surface->scale - (new_height % surface->scale); -+ new_width += surface->scale - (new_width % surface->scale); -+ - if (buffer_width != new_width || buffer_height != new_height) { - destroy_buffer(surface->current_buffer); - surface->indicator_width = new_width; - -From 7b3212761d0eef56a8cfb4b1034a3129220b7819 Mon Sep 17 00:00:00 2001 -From: Michael Swiger <mokkan@gmail.com> -Date: Sun, 27 Jun 2021 20:46:01 -0700 -Subject: [PATCH 07/10] Fix indicator buffer not resizing after display powers - off - ---- - render.c | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/render.c b/render.c -index e2449e71..241367e7 100644 ---- a/render.c -+++ b/render.c -@@ -449,17 +449,17 @@ void render_frame(struct swaylock_surface *surface) { - new_width = extents.width + 2 * box_padding; - } - } -+ } - -- // Ensure buffer size is multiple of buffer scale - required by protocol -- new_height += surface->scale - (new_height % surface->scale); -- new_width += surface->scale - (new_width % surface->scale); -+ // Ensure buffer size is multiple of buffer scale - required by protocol -+ new_height += surface->scale - (new_height % surface->scale); -+ new_width += surface->scale - (new_width % surface->scale); - -- if (buffer_width != new_width || buffer_height != new_height) { -- destroy_buffer(surface->current_buffer); -- surface->indicator_width = new_width; -- surface->indicator_height = new_height; -- render_frame(surface); -- } -+ if (buffer_width != new_width || buffer_height != new_height) { -+ destroy_buffer(surface->current_buffer); -+ surface->indicator_width = new_width; -+ surface->indicator_height = new_height; -+ render_frame(surface); - } - - wl_surface_set_buffer_scale(surface->child, surface->scale); - -From 1271020bc51353bfd96c8de393579da8670c8d75 Mon Sep 17 00:00:00 2001 -From: Michael Swiger <mokkan@gmail.com> -Date: Mon, 5 Jul 2021 13:52:47 -0700 -Subject: [PATCH 08/10] Prevent attaching and committing the surface twice - ---- - render.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/render.c b/render.c -index 241367e7..ebf8bfb7 100644 ---- a/render.c -+++ b/render.c -@@ -460,6 +460,7 @@ void render_frame(struct swaylock_surface *surface) { - surface->indicator_width = new_width; - surface->indicator_height = new_height; - render_frame(surface); -+ return; - } - - wl_surface_set_buffer_scale(surface->child, surface->scale); - -From dfff235b09b475e79d75a040a0307a359974d360 Mon Sep 17 00:00:00 2001 -From: grumpey <grumpey0@gmail.com> -Date: Sun, 11 Jul 2021 13:40:46 -0400 -Subject: [PATCH 09/10] Call fclose vice free, fixes #198 - ---- - main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/main.c b/main.c -index f62a3a0f..50504ce9 100644 ---- a/main.c -+++ b/main.c -@@ -1667,7 +1667,7 @@ static int load_config(char *path, struct swaylock_state *state, - char *flag = malloc(nread + 3); - if (flag == NULL) { - free(line); -- free(config); -+ fclose(config); - swaylock_log(LOG_ERROR, "Failed to allocate memory"); - return 0; - } - -From d16fad6453c2ea3ca349713b6d275426ea094a3b Mon Sep 17 00:00:00 2001 -From: Simon Ser <contact@emersion.fr> -Date: Thu, 29 Jul 2021 09:08:39 +0200 -Subject: [PATCH 10/10] Check for poll errors - ---- - loop.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/loop.c b/loop.c -index 5cce8677..674b3107 100644 ---- a/loop.c -+++ b/loop.c -@@ -81,7 +81,11 @@ void loop_poll(struct loop *loop) { - ms = 0; - } - -- poll(loop->fds, loop->fd_length, ms); -+ int ret = poll(loop->fds, loop->fd_length, ms); -+ if (ret < 0) { -+ swaylock_log_errno(LOG_ERROR, "poll failed"); -+ exit(1); -+ } - - // Dispatch fds - size_t fd_index = 0; diff --git a/community/swaylock-effects/fix-build.patch b/community/swaylock-effects/fix-build.patch deleted file mode 100644 index fb6b6092cab0865e4b123c34f2c13b162923a512..0000000000000000000000000000000000000000 --- a/community/swaylock-effects/fix-build.patch +++ /dev/null @@ -1,21 +0,0 @@ -error: implicit declaration of function 'malloc' -Werror=implicit-function-declaration - 83 | fade->original_buffer = malloc(size); - | ^~~~~~[ -../fade.c:83:26: error: incompatible implicit declaration of built-in function 'malloc' -Werror -../fade.c:8:1: note: include '<stdlib.h>' or provide a declaration of 'malloc' - 7 | #include <string.h> - +++ | #include <stdlib.h> - 8 | - -diff --git a/fade.c b/fade.c -index 946209a..94cd47d 100644 ---- a/fade.c -+++ b/fade.c -@@ -1,6 +1,7 @@ - #include "fade.h" - #include "pool-buffer.h" - #include "swaylock.h" -+#include <stdlib.h> - #include <stdio.h> - #include <omp.h> - #include <stdalign.h> diff --git a/community/swaylock-effects/meson-remove-mtune-native.patch b/community/swaylock-effects/meson-remove-mtune-native.patch deleted file mode 100644 index 47656dc917eaee25e19963821323879561db751b..0000000000000000000000000000000000000000 --- a/community/swaylock-effects/meson-remove-mtune-native.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/meson.build -+++ b/meson.build -@@ -18,7 +18,6 @@ - '-Wundef', - '-Wvla', - '-fopenmp', -- '-mtune=native', - ], - language: 'c', - ) diff --git a/community/swaylock-effects/ungit-version.patch b/community/swaylock-effects/ungit-version.patch deleted file mode 100644 index fe542d8be5aeba74b11a52892364d52b66e9f7f0..0000000000000000000000000000000000000000 --- a/community/swaylock-effects/ungit-version.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/meson.build -+++ b/meson.build -@@ -46,18 +46,10 @@ - crypt = cc.find_library('crypt', required: not libpam.found()) - math = cc.find_library('m') - --git = find_program('git', required: false) - scdoc = find_program('scdoc', required: get_option('man-pages')) - wayland_scanner = find_program('wayland-scanner') - - version = '"@0@"'.format(meson.project_version()) --if git.found() -- git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']) -- git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']) -- if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0 -- version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip()) -- endif --endif - add_project_arguments('-DSWAYLOCK_VERSION=@0@'.format(version), language: 'c') - - wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')