aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Buschsieweke <marian.buschsieweke@ovgu.de>2020-05-21 20:57:56 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-05-26 13:53:15 +0000
commit6f609c3bde2cad85c2a33765b14bda04f39cc94f (patch)
tree6eec0e6400d036701034157eb52ce7cc45ee626f
parentd23bb3d885f4f82b8957e66d233e029d1bdbd4ff (diff)
downloadalpine_aports-6f609c3bde2cad85c2a33765b14bda04f39cc94f.tar.bz2
alpine_aports-6f609c3bde2cad85c2a33765b14bda04f39cc94f.tar.xz
alpine_aports-6f609c3bde2cad85c2a33765b14bda04f39cc94f.zip
testing/xdg-desktop-portal-wlr: new aport
-rw-r--r--testing/xdg-desktop-portal-wlr/0001-core-fix-error-handling-in-main.patch51
-rw-r--r--testing/xdg-desktop-portal-wlr/APKBUILD30
2 files changed, 81 insertions, 0 deletions
diff --git a/testing/xdg-desktop-portal-wlr/0001-core-fix-error-handling-in-main.patch b/testing/xdg-desktop-portal-wlr/0001-core-fix-error-handling-in-main.patch
new file mode 100644
index 0000000000..804a97dce7
--- /dev/null
+++ b/testing/xdg-desktop-portal-wlr/0001-core-fix-error-handling-in-main.patch
@@ -0,0 +1,51 @@
1https://github.com/emersion/xdg-desktop-portal-wlr/commit/a105e0e36356fe3743975054e07318a93ec9bcb4
2From a105e0e36356fe3743975054e07318a93ec9bcb4 Mon Sep 17 00:00:00 2001
3From: Marian Buschsieweke <maribu@users.noreply.github.com>
4Date: Thu, 21 May 2020 16:44:47 +0200
5Subject: core: fix error handling in main
6
7The error handling at the `error:` label tears down the whole state. Thus, the
8state needs to be fully initialized in order for the tear down to succeed.
9Currently, if e.g. `sd_bus_open_user()` fails, a `segfault` is triggered by
10the tear down. This commit adds individual tear down code that only touches
11stuff that until that point was successfully initialized.
12---
13 src/core/main.c | 9 ++++++---
14 1 file changed, 6 insertions(+), 3 deletions(-)
15
16diff --git a/src/core/main.c b/src/core/main.c
17index 6421b17..b86e79a 100644
18--- a/src/core/main.c
19+++ b/src/core/main.c
20@@ -70,14 +70,15 @@ int main(int argc, char *argv[]) {
21 ret = sd_bus_open_user(&bus);
22 if (ret < 0) {
23 logprint(ERROR, "dbus: failed to connect to user bus: %s", strerror(-ret));
24- goto error;
25+ return EXIT_FAILURE;
26 }
27 logprint(DEBUG, "dbus: connected");
28
29 struct wl_display *wl_display = wl_display_connect(NULL);
30 if (!wl_display) {
31 logprint(ERROR, "wayland: failed to connect to display");
32- goto error;
33+ sd_bus_unref(bus);
34+ return EXIT_FAILURE;
35 }
36 logprint(DEBUG, "wlroots: wl_display connected");
37
38@@ -85,7 +86,9 @@ int main(int argc, char *argv[]) {
39 struct pw_loop *pw_loop = pw_loop_new(NULL);
40 if (!pw_loop) {
41 logprint(ERROR, "pipewire: failed to create loop");
42- goto error;
43+ wl_display_disconnect(wl_display);
44+ sd_bus_unref(bus);
45+ return EXIT_FAILURE;
46 }
47 logprint(DEBUG, "pipewire: pw_loop created");
48
49--
502.26.2
51
diff --git a/testing/xdg-desktop-portal-wlr/APKBUILD b/testing/xdg-desktop-portal-wlr/APKBUILD
new file mode 100644
index 0000000000..3614f36aed
--- /dev/null
+++ b/testing/xdg-desktop-portal-wlr/APKBUILD
@@ -0,0 +1,30 @@
1# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
3pkgname=xdg-desktop-portal-wlr
4pkgver=0.1.0
5pkgrel=0
6pkgdesc="wlroots implementation of xdg-desktop-portal"
7url="https://github.com/emersion/xdg-desktop-portal-wlr"
8arch="all"
9license="MIT"
10depends="xdg-desktop-portal elogind"
11makedepends="wlroots-dev pipewire-dev meson"
12source="
13 https://github.com/emersion/xdg-desktop-portal-wlr/releases/download/v0.1.0/xdg-desktop-portal-wlr-$pkgver.tar.gz
14 0001-core-fix-error-handling-in-main.patch
15 "
16subpackages="$pkgname-dbg"
17options="!check" # No check yet
18
19build() {
20 abuild-meson build
21 ninja -C build
22}
23
24package() {
25 DESTDIR="$pkgdir" ninja -C build install
26 rm -rf "$pkgdir"/usr/lib/systemd
27}
28
29sha512sums="07ae2ba3583e53f3b0e5b97cb60cb85ae835c403906f3b214f6feedc615e3266f5a0f9dc12997802834fdeb2958f6b22c195eebe420a93b3a697460a2a4e3367 xdg-desktop-portal-wlr-0.1.0.tar.gz
30719d1a8e9f61e95bad9af068221bee0f1383bee424071459cd1a676281f663c33cad8b45604c53ede9bdaeb5bbfe26a0b6100d2349e1cff0ac3ec4e9d96102ba 0001-core-fix-error-handling-in-main.patch"