From f3bd0106abd9f4fbf8ef0e5afbe0dc1e90c065d5 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 27 Nov 2022 10:21:30 +0000 Subject: [PATCH] sway: update to 1.8 Co-authored-by: SupervisedThinking --- packages/wayland/compositor/sway/package.mk | 6 +-- .../sway-100.02-allow-running-as-root.patch | 40 +++++++++++++++---- .../sway-100.03-do-not-use-git-version.patch | 22 ++++++++++ 3 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 packages/wayland/compositor/sway/patches/sway-100.03-do-not-use-git-version.patch diff --git a/packages/wayland/compositor/sway/package.mk b/packages/wayland/compositor/sway/package.mk index bfcbcd47a8..d9a685f12f 100644 --- a/packages/wayland/compositor/sway/package.mk +++ b/packages/wayland/compositor/sway/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) PKG_NAME="sway" -PKG_VERSION="1.7" -PKG_SHA256="0c64536fb2883ec518e75cfb119f9300115fb49b084e3fde62b794fe2c6c8d84" +PKG_VERSION="1.8" +PKG_SHA256="fae0422bca8f528027f77e3a7bbea2be0498bba2ad3f0d22554ff8827e37f04e" PKG_LICENSE="MIT" PKG_SITE="https://swaywm.org/" PKG_URL="https://github.com/swaywm/sway/archive/${PKG_VERSION}.tar.gz" @@ -24,7 +24,7 @@ PKG_MESON_OPTS_TARGET="-Ddefault-wallpaper=false \ pre_configure_target() { # sway does not build without -Wno flags as all warnings being treated as errors - export TARGET_CFLAGS=$(echo "${TARGET_CFLAGS} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-maybe-uninitialized -Wno-stringop-truncation -Wno-address") + export TARGET_CFLAGS=$(echo "${TARGET_CFLAGS} -Wno-unused-variable") } post_makeinstall_target() { diff --git a/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch b/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch index 36526dc558..b499b6bf83 100644 --- a/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch +++ b/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch @@ -1,13 +1,37 @@ --- a/sway/main.c +++ b/sway/main.c -@@ -152,6 +152,10 @@ static void log_kernel(void) { +@@ -151,7 +151,8 @@ + } - - static bool drop_permissions(void) { -+ if (getuid() == 0 || getgid() == 0) { + static bool detect_suid(void) { +- if (geteuid() != 0 && getegid() != 0) { ++ if (geteuid() == 0 && getegid() == 0) { + sway_log(SWAY_INFO, "Running sway as root user"); -+ return true; + return false; + } + +@@ -309,11 +310,6 @@ + } + } + +- // SUID operation is deprecated, so block it for now. +- if (detect_suid()) { +- exit(EXIT_FAILURE); +- } +- + // Since wayland requires XDG_RUNTIME_DIR to be set, abort with just the + // clear error message (when not running as an IPC client). + if (!getenv("XDG_RUNTIME_DIR") && optind == argc) { +@@ -363,6 +359,11 @@ + return 0; + } + ++ // SUID operation is deprecated, so block it for now. ++ if (detect_suid()) { ++ exit(EXIT_FAILURE); + } - if (getuid() != geteuid() || getgid() != getegid()) { - sway_log(SWAY_ERROR, "!!! DEPRECATION WARNING: " - "SUID privilege drop will be removed in a future release, please migrate to seatd-launch"); ++ + detect_proprietary(allow_unsupported_gpu); + increase_nofile_limit(); + + diff --git a/packages/wayland/compositor/sway/patches/sway-100.03-do-not-use-git-version.patch b/packages/wayland/compositor/sway/patches/sway-100.03-do-not-use-git-version.patch new file mode 100644 index 0000000000..1468a05813 --- /dev/null +++ b/packages/wayland/compositor/sway/patches/sway-100.03-do-not-use-git-version.patch @@ -0,0 +1,22 @@ +--- a/meson.build ++++ b/meson.build +@@ -158,18 +158,6 @@ + add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c') + + version = '"@0@"'.format(meson.project_version()) +-git = find_program('git', native: true, required: false) +-if git.found() +- git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false) +- git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) +- if git_commit.returncode() == 0 and git_branch.returncode() == 0 +- version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format( +- meson.project_version(), +- git_commit.stdout().strip(), +- git_branch.stdout().strip(), +- ) +- endif +-endif + add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') + + # Compute the relative path used by compiler invocations. +