sway: update to 1.8

Co-authored-by: SupervisedThinking <supervisedthinking@gmail.com>
This commit is contained in:
Rudi Heitbaum 2022-11-27 10:21:30 +00:00
parent 0c22fe734d
commit f3bd0106ab
3 changed files with 57 additions and 11 deletions

View File

@ -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() {

View File

@ -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();

View File

@ -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.