* [PR PATCH] [DON'T MERGE] elogind: update to 252.9.
@ 2023-07-06 13:05 motorto
2023-07-06 13:07 ` [PR REVIEW] " abenson
` (24 more replies)
0 siblings, 25 replies; 26+ messages in thread
From: motorto @ 2023-07-06 13:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 702 bytes --]
There is a new pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
[DON'T MERGE] elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**NO**, opening for testers (will test soon on my x86_64-glibc system)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 19175 bytes --]
From 3aa1902f62e60994d52e0b83817410f0d854d2e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/template | 24 ++---
14 files changed, 268 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..ef76a9a7dfc8
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.c b/src/shared/copy.c
+index 8dc34e9..6082149 100644
+--- a/src/shared/copy.c
++++ b/src/shared/copy.c
+@@ -47,6 +47,11 @@
+ * case of bind mount cycles and suchlike. */
+ #define COPY_DEPTH_MAX 2048U
+
++#ifndef __GLIBC__
++# define SEEK_DATA 3 /* Seek to next data. */
++# define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
+ static ssize_t try_copy_file_range(
+ int fd_in, loff_t *off_in,
+ int fd_out, loff_t *off_out,
+
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..c0fb207bcdd0 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+-Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+-Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+-Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+-Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] [DON'T MERGE] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
@ 2023-07-06 13:07 ` abenson
2023-07-06 13:10 ` [PR PATCH] [Updated] " motorto
` (23 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: abenson @ 2023-07-06 13:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
New review comment by abenson on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#discussion_r1254411800
Comment:
Indent these lines with a space
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] [DON'T MERGE] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
2023-07-06 13:07 ` [PR REVIEW] " abenson
@ 2023-07-06 13:10 ` motorto
2023-07-06 13:10 ` [PR REVIEW] " motorto
` (22 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-06 13:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
[DON'T MERGE] elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**NO**, opening for testers (will test soon on my x86_64-glibc system)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 19269 bytes --]
From 894f42f4baf7096ee755b4dacc206121a94a4358 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/template | 24 ++---
14 files changed, 268 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] [DON'T MERGE] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
2023-07-06 13:07 ` [PR REVIEW] " abenson
2023-07-06 13:10 ` [PR PATCH] [Updated] " motorto
@ 2023-07-06 13:10 ` motorto
2023-07-06 13:11 ` pang422
` (21 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-06 13:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
New review comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#discussion_r1254415272
Comment:
thanks !
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [DON'T MERGE] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (2 preceding siblings ...)
2023-07-06 13:10 ` [PR REVIEW] " motorto
@ 2023-07-06 13:11 ` pang422
2023-07-06 13:16 ` [PR PATCH] [Updated] " motorto
` (20 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: pang422 @ 2023-07-06 13:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 151 bytes --]
New comment by pang422 on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1623655408
Comment:
pangsi422
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] [DON'T MERGE] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (3 preceding siblings ...)
2023-07-06 13:11 ` pang422
@ 2023-07-06 13:16 ` motorto
2023-07-06 16:55 ` [PR PATCH] [Updated] " motorto
` (19 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-06 13:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
[DON'T MERGE] elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**NO**, opening for testers (will test soon on my x86_64-glibc system)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 20286 bytes --]
From 5321ff99bd190fed56bc1538962cf0b22b84ff1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rpath.patch | 17 ++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/template | 24 ++---
15 files changed, 285 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rpath.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rpath.patch b/srcpkgs/elogind/patches/rpath.patch
new file mode 100644
index 000000000000..1063c453d948
--- /dev/null
+++ b/srcpkgs/elogind/patches/rpath.patch
@@ -0,0 +1,17 @@
+They changed the install for this but not the rpath added to any executable,
+which still is the rootlibexecdir
+
+Issue: https://github.com/elogind/elogind/issues/258
+Patch-Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/rootlibexecdir.patch
+
+--
+diff --git a/src/shared/meson.build b/src/shared/meson.build
+index bb7be41..e349ca4 100644
+--- a/src/shared/meson.build
++++ b/src/shared/meson.build
+@@ -625,4 +625,4 @@ libshared = shared_library(
+ #endif // 0
+ dependencies : libshared_deps,
+ install : true,
+- install_dir : rootpkglibdir)
++ install_dir : rootlibexecdir)
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (4 preceding siblings ...)
2023-07-06 13:16 ` [PR PATCH] [Updated] " motorto
@ 2023-07-06 16:55 ` motorto
2023-07-09 17:03 ` mhmdanas
` (18 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-06 16:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Briefly**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 24644 bytes --]
From 25a96d3d151a73a1da294cd19c47ce42095dd0c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rpath.patch | 17 ++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 374 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rpath.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rpath.patch b/srcpkgs/elogind/patches/rpath.patch
new file mode 100644
index 000000000000..1063c453d948
--- /dev/null
+++ b/srcpkgs/elogind/patches/rpath.patch
@@ -0,0 +1,17 @@
+They changed the install for this but not the rpath added to any executable,
+which still is the rootlibexecdir
+
+Issue: https://github.com/elogind/elogind/issues/258
+Patch-Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/rootlibexecdir.patch
+
+--
+diff --git a/src/shared/meson.build b/src/shared/meson.build
+index bb7be41..e349ca4 100644
+--- a/src/shared/meson.build
++++ b/src/shared/meson.build
+@@ -625,4 +625,4 @@ libshared = shared_library(
+ #endif // 0
+ dependencies : libshared_deps,
+ install : true,
+- install_dir : rootpkglibdir)
++ install_dir : rootlibexecdir)
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 000000000000..ec9fd3562802
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (5 preceding siblings ...)
2023-07-06 16:55 ` [PR PATCH] [Updated] " motorto
@ 2023-07-09 17:03 ` mhmdanas
2023-07-09 21:14 ` motorto
` (17 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: mhmdanas @ 2023-07-09 17:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
New comment by mhmdanas on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1627773773
Comment:
Tested on x86_64-glibc. Seems to be working fine overall, but for some reason I can't dismiss mako notifications:
```console
$ makoctl dismiss
busctl: error while loading shared libraries: libelogind-shared-252.9.so: cannot open shared object file: No such file or directory
```
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (6 preceding siblings ...)
2023-07-09 17:03 ` mhmdanas
@ 2023-07-09 21:14 ` motorto
2023-07-09 21:16 ` motorto
` (16 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 21:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
New comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1627827030
Comment:
Hum weird, the file is installed
```
$ xbps-query -f elogind
...
/usr/libexec/elogind/libelogind-shared-252.9.so
...
```
Even diffing the `xbps-query -{Rf|f} elogind` returns the file was in the proper place:
```
$ diff a b
2c2
< /etc/pam.d/elogind-user
---
> /etc/elogind/sleep.conf
8a9
> /usr/lib/pam.d/elogind-user
18c19
< /usr/libexec/elogind/libelogind-shared-246.10.so
---
> /usr/libexec/elogind/libelogind-shared-252.9.so
...
```
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (7 preceding siblings ...)
2023-07-09 21:14 ` motorto
@ 2023-07-09 21:16 ` motorto
2023-07-09 21:40 ` [PR PATCH] [Updated] " motorto
` (15 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 21:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
New comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1627827030
Comment:
Hum weird, the file is installed
```
$ xbps-query -f elogind
...
/usr/libexec/elogind/libelogind-shared-252.9.so
...
```
Even diffing the `xbps-query -{Rf|f} elogind` returns the file was in the proper place:
```
$ diff a b
2c2
< /etc/pam.d/elogind-user
---
> /etc/elogind/sleep.conf
8a9
> /usr/lib/pam.d/elogind-user
18c19
< /usr/libexec/elogind/libelogind-shared-246.10.so
---
> /usr/libexec/elogind/libelogind-shared-252.9.so
...
```
But can confirm it is happening
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (8 preceding siblings ...)
2023-07-09 21:16 ` motorto
@ 2023-07-09 21:40 ` motorto
2023-07-09 21:41 ` motorto
` (14 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 21:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Briefly**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25773 bytes --]
From 85e328272d23be0667991a19e303dbac3d942da4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 000000000000..11650a1f31bc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 000000000000..ec9fd3562802
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (9 preceding siblings ...)
2023-07-09 21:40 ` [PR PATCH] [Updated] " motorto
@ 2023-07-09 21:41 ` motorto
2023-07-09 22:00 ` [PR PATCH] [Updated] " motorto
` (13 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 21:41 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
New comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1627832539
Comment:
@mhmdanas give it a try please now
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (10 preceding siblings ...)
2023-07-09 21:41 ` motorto
@ 2023-07-09 22:00 ` motorto
2023-07-09 22:02 ` motorto
` (12 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 22:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Briefly**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 27273 bytes --]
From 85e328272d23be0667991a19e303dbac3d942da4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH 1/2] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 000000000000..11650a1f31bc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 000000000000..ec9fd3562802
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
From cd899b807668d8a852b7d8ee1e5b881f22c621ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Sun, 9 Jul 2023 22:59:20 +0100
Subject: [PATCH 2/2] busctl: new package.
---
common/shlibs | 1 +
srcpkgs/busctl | 1 +
srcpkgs/elogind/template | 9 +++++++++
3 files changed, 11 insertions(+)
create mode 120000 srcpkgs/busctl
diff --git a/common/shlibs b/common/shlibs
index 4b2122d1b199..34c58310ff2a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2969,6 +2969,7 @@ libstilview.so.0 libsidplayfp-1.8.7_1
libczmq.so.4 czmq-4.0.1_1
liblz.so.1 lzlib-1.8_1
libelogind.so.0 libelogind-238.1_2
+libelogind-shared-252.9.so libelogind-252.9_1
libseat.so.1 libseat-0.3.0_1
libnma.so.0 libnma-1.8.30_1
libnma-gtk4.so.0 libnma-1.8.36_1
diff --git a/srcpkgs/busctl b/srcpkgs/busctl
new file mode 120000
index 000000000000..49be2e0cf598
--- /dev/null
+++ b/srcpkgs/busctl
@@ -0,0 +1 @@
+elogind
\ No newline at end of file
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 97d129f1f323..0da909dbe190 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -74,3 +74,12 @@ libelogind_package() {
vmove "usr/lib/libelogind.so.*"
}
}
+
+busctl_package() {
+ short_desc="Tool for monitoring and introspecting the D-Bus bus"
+ pkg_install() {
+ vmove "usr/bin/busctl"
+ vcompletion shell-completion/bash/busctl bash busctl
+ vcompletion shell-completion/zsh/_busctl zsh busctl
+ }
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (11 preceding siblings ...)
2023-07-09 22:00 ` [PR PATCH] [Updated] " motorto
@ 2023-07-09 22:02 ` motorto
2023-07-21 19:23 ` mhmdanas
` (11 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-07-09 22:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Briefly**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25773 bytes --]
From 85e328272d23be0667991a19e303dbac3d942da4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 000000000000..01e1cfee6ecb
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 000000000000..485145f83eca
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 000000000000..a890917ddfe6
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979..ab892cd63f6a 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb86..000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268..000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45e..000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db9..000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 000000000000..a0b01d516375
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 000000000000..11650a1f31bc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 000000000000..787eeac9bc80
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 000000000000..b568bbb66e98
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 000000000000..a29ef7880d99
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 000000000000..c6cfd799353f
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 000000000000..ec9fd3562802
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a..97d129f1f323 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (12 preceding siblings ...)
2023-07-09 22:02 ` motorto
@ 2023-07-21 19:23 ` mhmdanas
2023-09-17 14:15 ` [PR PATCH] [Updated] " motorto
` (10 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: mhmdanas @ 2023-07-21 19:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
New comment by mhmdanas on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1646147988
Comment:
Seems to be working now.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (13 preceding siblings ...)
2023-07-21 19:23 ` mhmdanas
@ 2023-09-17 14:15 ` motorto
2023-09-21 14:53 ` motorto
` (9 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-09-17 14:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Yes**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25805 bytes --]
From ffe984c7f7ff18bb2bb01fb090dda8c7c566ee73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 0000000000000..01e1cfee6ecb6
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 0000000000000..485145f83eca1
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 0000000000000..a890917ddfe61
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979f..ab892cd63f6a6 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb868..0000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268f..0000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45ea..0000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db94..0000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 0000000000000..a0b01d5163754
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 0000000000000..11650a1f31bcc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 0000000000000..787eeac9bc80e
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 0000000000000..b568bbb66e98a
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 0000000000000..a29ef7880d99b
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 0000000000000..c6cfd799353f1
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 0000000000000..ec9fd35628020
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a7..97d129f1f3239 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (14 preceding siblings ...)
2023-09-17 14:15 ` [PR PATCH] [Updated] " motorto
@ 2023-09-21 14:53 ` motorto
2023-10-11 12:01 ` motorto
` (8 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-09-21 14:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Yes**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25805 bytes --]
From d156892db9ba8f2b23c59a0124e881d02d2a8c5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 0000000000000..01e1cfee6ecb6
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 0000000000000..485145f83eca1
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 0000000000000..a890917ddfe61
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979f..ab892cd63f6a6 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb868..0000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268f..0000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45ea..0000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db94..0000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 0000000000000..a0b01d5163754
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 0000000000000..11650a1f31bcc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 0000000000000..787eeac9bc80e
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 0000000000000..b568bbb66e98a
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 0000000000000..a29ef7880d99b
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 0000000000000..c6cfd799353f1
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 0000000000000..ec9fd35628020
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a7..97d129f1f3239 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (15 preceding siblings ...)
2023-09-21 14:53 ` motorto
@ 2023-10-11 12:01 ` motorto
2023-10-15 13:20 ` [PR REVIEW] " ahesford
` (7 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-10-11 12:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Yes**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25805 bytes --]
From 358f2d53cba39505a710209845322accfdfe2245 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 23 +++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 399 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 0000000000000..01e1cfee6ecb6
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,23 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+
+--
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..60c63f8 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -70,6 +70,12 @@ static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags cop
+ return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
+ }
+
++#ifndef __GLIBC__
++#define SEEK_DATA 3 /* Seek to next data. */
++#define SEEK_HOLE 4 /* Seek to next hole. */
++#endif
++
++
+ #if 0 /// UNNEEDED by elogind
+ int copy_times(int fdf, int fdt, CopyFlags flags);
+ int copy_access(int fdf, int fdt);
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 0000000000000..485145f83eca1
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 0000000000000..a890917ddfe61
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979f..ab892cd63f6a6 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb868..0000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268f..0000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45ea..0000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db94..0000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 0000000000000..a0b01d5163754
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 0000000000000..11650a1f31bcc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 0000000000000..787eeac9bc80e
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 0000000000000..b568bbb66e98a
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 0000000000000..a29ef7880d99b
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 0000000000000..c6cfd799353f1
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 0000000000000..ec9fd35628020
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a7..97d129f1f3239 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (16 preceding siblings ...)
2023-10-11 12:01 ` motorto
@ 2023-10-15 13:20 ` ahesford
2023-10-15 13:32 ` [PR PATCH] [Updated] " motorto
` (6 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2023-10-15 13:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#discussion_r1359877484
Comment:
It seems better to do `#ifndef SEEK_DATA` and `#ifndef SEEK_HOLE` here.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (17 preceding siblings ...)
2023-10-15 13:20 ` [PR REVIEW] " ahesford
@ 2023-10-15 13:32 ` motorto
2023-10-15 13:34 ` [PR REVIEW] " motorto
` (5 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-10-15 13:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
There is an updated pull request by motorto against master on the void-packages repository
https://github.com/motorto/void-packages elogind-252.9
https://github.com/void-linux/void-packages/pull/44876
elogind: update to 252.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Yes**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
A patch file from https://github.com/void-linux/void-packages/pull/44876.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-elogind-252.9-44876.patch --]
[-- Type: text/x-diff, Size: 25669 bytes --]
From 68d83a9521cee0a129b0aeaa97d9c36b7dc3ef78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Wed, 5 Jul 2023 20:28:51 +0100
Subject: [PATCH] elogind: update to 252.9.
---
srcpkgs/elogind/patches/SEEK_DATA.patch | 26 ++++++
srcpkgs/elogind/patches/getdents.patch | 32 +++++++
srcpkgs/elogind/patches/gshadow.patch | 12 +++
srcpkgs/elogind/patches/id-nobody.patch | 1 -
srcpkgs/elogind/patches/mips.patch | 11 ---
srcpkgs/elogind/patches/polkit.patch | 27 ------
srcpkgs/elogind/patches/ppc64-bad-tuple.patch | 25 ------
srcpkgs/elogind/patches/ppcle.patch | 25 ------
srcpkgs/elogind/patches/rlim-max.patch | 14 +++
srcpkgs/elogind/patches/rootlibexecdir.patch | 42 +++++++++
srcpkgs/elogind/patches/sigfillset.patch | 12 +++
srcpkgs/elogind/patches/statx.patch | 30 +++++++
srcpkgs/elogind/patches/strerror_r.patch | 90 +++++++++++++++++++
srcpkgs/elogind/patches/strerror_r_1.patch | 43 +++++++++
srcpkgs/elogind/patches/tests.patch | 89 ++++++++++++++++++
srcpkgs/elogind/template | 24 ++---
16 files changed, 402 insertions(+), 101 deletions(-)
create mode 100644 srcpkgs/elogind/patches/SEEK_DATA.patch
create mode 100644 srcpkgs/elogind/patches/getdents.patch
create mode 100644 srcpkgs/elogind/patches/gshadow.patch
delete mode 100644 srcpkgs/elogind/patches/mips.patch
delete mode 100644 srcpkgs/elogind/patches/polkit.patch
delete mode 100644 srcpkgs/elogind/patches/ppc64-bad-tuple.patch
delete mode 100644 srcpkgs/elogind/patches/ppcle.patch
create mode 100644 srcpkgs/elogind/patches/rlim-max.patch
create mode 100644 srcpkgs/elogind/patches/rootlibexecdir.patch
create mode 100644 srcpkgs/elogind/patches/sigfillset.patch
create mode 100644 srcpkgs/elogind/patches/statx.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r.patch
create mode 100644 srcpkgs/elogind/patches/strerror_r_1.patch
create mode 100644 srcpkgs/elogind/patches/tests.patch
diff --git a/srcpkgs/elogind/patches/SEEK_DATA.patch b/srcpkgs/elogind/patches/SEEK_DATA.patch
new file mode 100644
index 0000000000000..f1e308ca90a70
--- /dev/null
+++ b/srcpkgs/elogind/patches/SEEK_DATA.patch
@@ -0,0 +1,26 @@
+Upstream:no
+
+Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
+Only version >= 1.2.3 do that.
+---
+ src/shared/copy.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/shared/copy.h b/src/shared/copy.h
+index a34a87c..d258afc 100644
+--- a/src/shared/copy.h
++++ b/src/shared/copy.h
+@@ -79,3 +79,11 @@ static inline int copy_rights(int fdf, int fdt) {
+ }
+ int copy_xattr(int fdf, int fdt, CopyFlags copy_flags);
+ #endif // 0
++
++#ifndef SEEK_DATA
++#define SEEK_DATA 3
++#endif
++
++#ifndef SEEK_HOLE
++#define SEEK_HOLE 4
++#endif
+--
+2.42.0
diff --git a/srcpkgs/elogind/patches/getdents.patch b/srcpkgs/elogind/patches/getdents.patch
new file mode 100644
index 0000000000000..485145f83eca1
--- /dev/null
+++ b/srcpkgs/elogind/patches/getdents.patch
@@ -0,0 +1,32 @@
+Upstream: no
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/getdents.patch
+
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Jan 2022 15:15:11 -0800
+Subject: [PATCH] pass correct parameters to getdents64
+
+Fixes musl system only
+../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
+ n = getdents64(fd, &buffer, sizeof(buffer));
+
+diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
+index d16ca98..0480a69 100644
+--- a/src/basic/recurse-dir.c
++++ b/src/basic/recurse-dir.c
+@@ -54,7 +54,11 @@ int readdir_all(int dir_fd,
+ bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
+ assert(bs > de->buffer_size);
+
++ #ifdef __GLIBC__
+ n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
++ #else
++ n = getdents(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
++ #endif
+ if (n < 0)
+ return -errno;
+ if (n == 0)
diff --git a/srcpkgs/elogind/patches/gshadow.patch b/srcpkgs/elogind/patches/gshadow.patch
new file mode 100644
index 0000000000000..a890917ddfe61
--- /dev/null
+++ b/srcpkgs/elogind/patches/gshadow.patch
@@ -0,0 +1,12 @@
+diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
+index 7a41be7..3a970a6 100644
+--- a/src/shared/user-record-nss.h
++++ b/src/shared/user-record-nss.h
+@@ -2,7 +2,6 @@
+ #pragma once
+
+ #include <grp.h>
+-#include <gshadow.h>
+ #include <pwd.h>
+ #include <shadow.h>
+
diff --git a/srcpkgs/elogind/patches/id-nobody.patch b/srcpkgs/elogind/patches/id-nobody.patch
index 5e9e5cdea979f..ab892cd63f6a6 100644
--- a/srcpkgs/elogind/patches/id-nobody.patch
+++ b/srcpkgs/elogind/patches/id-nobody.patch
@@ -10,4 +10,3 @@
+#define GID_NOBODY ((gid_t) 99U)
#define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock"
-
diff --git a/srcpkgs/elogind/patches/mips.patch b/srcpkgs/elogind/patches/mips.patch
deleted file mode 100644
index ca1c0974cb868..0000000000000
--- a/srcpkgs/elogind/patches/mips.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100
-+++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100
-@@ -11,7 +11,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
-
--#ifdef ARCH_MIPS
-+#if defined(_MIPSEL) || defined(_MIPSEB)
- #include <asm/sgidefs.h>
- #endif
-
diff --git a/srcpkgs/elogind/patches/polkit.patch b/srcpkgs/elogind/patches/polkit.patch
deleted file mode 100644
index 4bdf1289f268f..0000000000000
--- a/srcpkgs/elogind/patches/polkit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 2b09e13f7aec13105380d9d9fddc96ae51911b0c
-Author: Daniel Kolesa <daniel@octaforge.org>
-Date: Sat Dec 18 02:53:26 2021 +0100
-
- reenable polkit
-
-diff --git a/meson.build b/meson.build
-index 72825a2..b14cb64 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1155,15 +1155,6 @@ if want_polkit != 'false' and not skip_deps
- message('Old polkit detected, will install pkla files')
- install_polkit_pkla = true
- endif
--#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
-- if not libpolkit.found()
-- if want_polkit != 'auto'
-- error('Polkit requested but libpolkit was not found.')
-- endif
-- install_polkit = false
-- want_polkit = false
-- endif
--#endif // 1
- endif
- conf.set10('ENABLE_POLKIT', install_polkit)
-
-
diff --git a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch b/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
deleted file mode 100644
index f6237ffff45ea..0000000000000
--- a/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 22:22:28 +0100
-Subject: [PATCH] fix ppc64 arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..3ea6e52 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -77,7 +77,7 @@ int uname_architecture(void);
- #elif defined(__powerpc64__)
- # if __BYTE_ORDER == __BIG_ENDIAN
- # define native_architecture() ARCHITECTURE_PPC64
--# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
-+# define LIB_ARCH_TUPLE "powerpc64-linux-gnu"
- # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC
- # else
- # define native_architecture() ARCHITECTURE_PPC64_LE
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/ppcle.patch b/srcpkgs/elogind/patches/ppcle.patch
deleted file mode 100644
index b986b0f37db94..0000000000000
--- a/srcpkgs/elogind/patches/ppcle.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Thu, 21 Jan 2021 21:59:12 +0100
-Subject: [PATCH] add ppcle arch tuple
-
----
- src/basic/architecture.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git src/basic/architecture.h src/basic/architecture.h
-index 620b522..afdff7a 100644
---- a/src/basic/architecture.h
-+++ b/src/basic/architecture.h
-@@ -94,7 +94,7 @@ int uname_architecture(void);
- # endif
- # else
- # define native_architecture() ARCHITECTURE_PPC_LE
--# error "Missing LIB_ARCH_TUPLE for PPCLE"
-+# define LIB_ARCH_TUPLE "powerpcle-linux-gnu"
- # endif
- #elif defined(__ia64__)
- # define native_architecture() ARCHITECTURE_IA64
---
-2.30.0
-
diff --git a/srcpkgs/elogind/patches/rlim-max.patch b/srcpkgs/elogind/patches/rlim-max.patch
new file mode 100644
index 0000000000000..a0b01d5163754
--- /dev/null
+++ b/srcpkgs/elogind/patches/rlim-max.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index afd74ac..3a731f4 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
+ fixed.rlim_max == highest.rlim_max)
+ return 0;
+
+- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
++ log_debug("Failed at setting rlimit %ju for resource RLIMIT_%s. Will attempt setting value %ju instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
+
+ return RET_NERRNO(setrlimit(resource, &fixed));
+ }
+
diff --git a/srcpkgs/elogind/patches/rootlibexecdir.patch b/srcpkgs/elogind/patches/rootlibexecdir.patch
new file mode 100644
index 0000000000000..11650a1f31bcc
--- /dev/null
+++ b/srcpkgs/elogind/patches/rootlibexecdir.patch
@@ -0,0 +1,42 @@
+Patch-Source: https://github.com/elogind/elogind/issues/258
+--
+diff --git a/meson.build b/meson.build
+index 694a2fd..a575f69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2903,7 +2903,7 @@ executable('elogind',
+ dependencies : [threads,
+ libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+
+@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
+ link_with : [libshared],
+ dependencies : [threads,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [threads],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootbindir)
+ public_programs += [exe]
+@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
+ libshared],
+ dependencies: [libacl,
+ libudev],
+- install_rpath : rootlibexecdir,
++ install_rpath : rootpkglibdir,
+ install : true,
+ install_dir : rootlibexecdir)
+ #endif // 0
diff --git a/srcpkgs/elogind/patches/sigfillset.patch b/srcpkgs/elogind/patches/sigfillset.patch
new file mode 100644
index 0000000000000..787eeac9bc80e
--- /dev/null
+++ b/srcpkgs/elogind/patches/sigfillset.patch
@@ -0,0 +1,12 @@
+diff --git a/src/basic/async.h b/src/basic/async.h
+index cf80acf..d22e77d 100644
+--- a/src/basic/async.h
++++ b/src/basic/async.h
+@@ -2,6 +2,7 @@
+ #pragma once
+
+ #include <sys/types.h>
++#include <signal.h>
+
+ #include "macro.h"
+
diff --git a/srcpkgs/elogind/patches/statx.patch b/srcpkgs/elogind/patches/statx.patch
new file mode 100644
index 0000000000000..b568bbb66e98a
--- /dev/null
+++ b/srcpkgs/elogind/patches/statx.patch
@@ -0,0 +1,30 @@
+Upstream: no, musl only
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
+
+diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
+index ab8744b..59ff466 100644
+--- a/src/basic/mountpoint-util.c
++++ b/src/basic/mountpoint-util.c
+@@ -11,7 +11,7 @@
+ //#include "filesystems.h"
+ #include "fs-util.h"
+ #include "missing_stat.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ //#include "mkdir.h"
+ #include "mountpoint-util.h"
+ #include "nulstr-util.h"
+diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
+index d8e0693..f8324ed 100644
+--- a/src/basic/stat-util.c
++++ b/src/basic/stat-util.c
+@@ -18,7 +18,7 @@
+ #include "macro.h"
+ //#include "missing_fs.h"
+ #include "missing_magic.h"
+-//#include "missing_syscall.h"
++#include "missing_syscall.h"
+ #include "nulstr-util.h"
+ //#include "parse-util.h"
+ #include "stat-util.h"
+
diff --git a/srcpkgs/elogind/patches/strerror_r.patch b/srcpkgs/elogind/patches/strerror_r.patch
new file mode 100644
index 0000000000000..a29ef7880d99b
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r.patch
@@ -0,0 +1,90 @@
+fix strerror_r use instead of whatever this define is meant to be doing
+--
+From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ src/libsystemd/sd-journal/journal-send.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/basic/musl_missing.h b/src/basic/musl_missing.h
+index 41c66c9..a2e1d7e 100644
+--- a/src/basic/musl_missing.h
++++ b/src/basic/musl_missing.h
+@@ -26,8 +26,6 @@ void elogind_set_program_name(const char* pcall);
+ #include <unistd.h>
+ #include <pthread.h> /* for pthread_atfork */
+
+-#define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m);
+-
+ /*
+ * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html
+ * + test if the process's effective user ID does not match its real user ID or
+diff --git a/src/libelogind/sd-bus/bus-error.c b/src/libelogind/sd-bus/bus-error.c
+index 4d687cf..1459396 100644
+--- a/src/libelogind/sd-bus/bus-error.c
++++ b/src/libelogind/sd-bus/bus-error.c
+@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+@@ -594,8 +599,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+
+ if (e && e->message)
+ return e->message;
+-
++#ifndef __GLIBC__
++ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++ return buf;
++#else
+ return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++#endif
+ }
+
+ static bool map_ok(const sd_bus_error_map *map) {
+diff --git a/src/libelogind/sd-journal/journal-send.c b/src/libelogind/sd-journal/journal-send.c
+index 4010197..1d49868 100644
+--- a/src/libelogind/sd-journal/journal-send.c
++++ b/src/libelogind/sd-journal/journal-send.c
+@@ -444,7 +444,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+
diff --git a/srcpkgs/elogind/patches/strerror_r_1.patch b/srcpkgs/elogind/patches/strerror_r_1.patch
new file mode 100644
index 0000000000000..c6cfd799353f1
--- /dev/null
+++ b/srcpkgs/elogind/patches/strerror_r_1.patch
@@ -0,0 +1,43 @@
+From f66b5c802ce0a3310f5580cfc1b02446f8087568 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Jan 2023 23:39:46 -0800
+Subject: [PATCH] errno-util: Make STRERROR portable for musl
+
+Sadly, systemd has decided to use yet another GNU extention in a macro
+lets make this such that we can use XSI compliant strerror_r() for
+non-glibc hosts
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/errno-util.h | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
+index 091f99c590..eb5c1f9961 100644
+--- a/src/basic/errno-util.h
++++ b/src/basic/errno-util.h
+@@ -14,8 +14,16 @@
+ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
+ *
+ * Note that we use the GNU variant of strerror_r() here. */
+-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-
++static inline const char * STRERROR(int errnum);
++
++static inline const char * STRERROR(int errnum) {
++#ifdef __GLIBC__
++ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++#else
++ static __thread char buf[ERRNO_BUF_LEN];
++ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++#endif
++}
+ /* A helper to print an error message or message for functions that return 0 on EOF.
+ * Note that we can't use ({ … }) to define a temporary variable, so errnum is
+ * evaluated twice. */
+--
+2.39.1
+
+
diff --git a/srcpkgs/elogind/patches/tests.patch b/srcpkgs/elogind/patches/tests.patch
new file mode 100644
index 0000000000000..ec9fd35628020
--- /dev/null
+++ b/srcpkgs/elogind/patches/tests.patch
@@ -0,0 +1,89 @@
+Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/tests.patch
+
+--
+diff --git a/src/libelogind/sd-bus/test-bus-error.c b/src/libelogind/sd-bus/test-bus-error.c
+index 4956dd7..d60ae0a 100644
+--- a/src/libelogind/sd-bus/test-bus-error.c
++++ b/src/libelogind/sd-bus/test-bus-error.c
+@@ -223,6 +223,8 @@ TEST(sd_bus_error_set_errnof) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *str = NULL;
+
++ return;
++
+ assert_se(sd_bus_error_set_errnof(NULL, 0, NULL) == 0);
+ assert_se(sd_bus_error_set_errnof(NULL, ENOANO, NULL) == -ENOANO);
+
+diff --git a/src/libelogind/sd-device/test-sd-device-thread.c b/src/libelogind/sd-device/test-sd-device-thread.c
+index 644f3c2..c0c17f2 100644
+--- a/src/libelogind/sd-device/test-sd-device-thread.c
++++ b/src/libelogind/sd-device/test-sd-device-thread.c
+@@ -30,6 +30,8 @@ int main(int argc, char *argv[]) {
+ const char *key, *value;
+ int r;
+
++ return 0;
++
+ r = sd_device_new_from_syspath(&loopback, "/sys/class/net/lo");
+ if (r < 0)
+ return handle_error_errno(r, "Failed to create loopback device object");
+diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
+index 4b70a85..5a0eb51 100644
+--- a/src/test/test-cgroup.c
++++ b/src/test/test-cgroup.c
+@@ -50,6 +50,9 @@ TEST(cg_create) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
++
++ return;
++
+ assert_se(r >= 0);
+
+ _cleanup_free_ char *here = NULL;
+diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
+index 7c4f693..dbb03dc 100644
+--- a/src/test/test-hostname-util.c
++++ b/src/test/test-hostname-util.c
+@@ -25,8 +25,10 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", 0));
+ assert_se(!hostname_is_valid("foo..bar", 0));
+ assert_se(!hostname_is_valid("foo.bar..", 0));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0));
+ assert_se(!hostname_is_valid("au-xph5-rvgrdsb5hcxc-47et3a5vvkrc-server-wyoz4elpdpe3.openstack.local", 0));
++#endif
+
+ assert_se(hostname_is_valid("foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(hostname_is_valid("foobar.com", VALID_HOSTNAME_TRAILING_DOT));
+@@ -43,7 +45,9 @@ TEST(hostname_is_valid) {
+ assert_se(!hostname_is_valid(".foobar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo..bar", VALID_HOSTNAME_TRAILING_DOT));
+ assert_se(!hostname_is_valid("foo.bar..", VALID_HOSTNAME_TRAILING_DOT));
++#if 0
+ assert_se(!hostname_is_valid("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", VALID_HOSTNAME_TRAILING_DOT));
++#endif
+ }
+
+ #if 0 /// UNNEEDED by elogind
+diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
+index 75d4aa1..f2ffd86 100644
+--- a/src/test/test-mountpoint-util.c
++++ b/src/test/test-mountpoint-util.c
+@@ -134,6 +134,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("//", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("//", NULL, 0) > 0);
+
++#if 0
+ assert_se(path_is_mount_point("/proc", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/proc", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/proc/", NULL, AT_SYMLINK_FOLLOW) > 0);
+@@ -148,6 +149,7 @@ TEST(path_is_mount_point) {
+ assert_se(path_is_mount_point("/sys", NULL, 0) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, AT_SYMLINK_FOLLOW) > 0);
+ assert_se(path_is_mount_point("/sys/", NULL, 0) > 0);
++#endif
+
+ /* we'll create a hierarchy of different kinds of dir/file/link
+ * layouts:
+
diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index 73dc786ad70a7..97d129f1f3239 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -1,24 +1,24 @@
# Template file for 'elogind'
pkgname=elogind
-version=246.10
-revision=3
+version=252.9
+revision=1
build_style=meson
-configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
- -Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
- -Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy
- -Ddefault-kill-user-processes=false -Dman=true
- -Dpolkit=true"
-hostmakedepends="docbook-xsl gettext-devel gperf intltool libxslt m4
- pkg-config shadow glib-devel"
-makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
- libseccomp-devel pam-devel"
+configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
+ -Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
+ -Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
+ -Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/libexec/elogind"
+hostmakedepends="docbook-xsl gettext-devel glib-devel gperf intltool libxslt
+ m4 pkg-config python3-Jinja2 shadow"
+makedepends="acl-devel eudev-libudev-devel gettext-devel libcap-devel
+ libglib-devel libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
-checksum=c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922
+checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (18 preceding siblings ...)
2023-10-15 13:32 ` [PR PATCH] [Updated] " motorto
@ 2023-10-15 13:34 ` motorto
2023-11-02 8:20 ` mhmdanas
` (4 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-10-15 13:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
New review comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#discussion_r1359879563
Comment:
at the time, because its musl only, made sense to use `__GLIBC__` but you are absolutely right !
Updated the PR
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (19 preceding siblings ...)
2023-10-15 13:34 ` [PR REVIEW] " motorto
@ 2023-11-02 8:20 ` mhmdanas
2023-11-02 9:29 ` motorto
` (3 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: mhmdanas @ 2023-11-02 8:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
New comment by mhmdanas on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1790266690
Comment:
Testing on x86_64-glibc on a different laptop than what I tested with, and still working fine. :)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (20 preceding siblings ...)
2023-11-02 8:20 ` mhmdanas
@ 2023-11-02 9:29 ` motorto
2023-11-02 10:46 ` ahesford
` (2 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: motorto @ 2023-11-02 9:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
New comment by motorto on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1790368902
Comment:
> Testing on x86_64-glibc on a different laptop than what I tested with, and still working fine. :)
Yeah it has been battle tested since ~ July.
I will talk again on IRC but I think no one wants to pull the switch and be blamed :)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (21 preceding siblings ...)
2023-11-02 9:29 ` motorto
@ 2023-11-02 10:46 ` ahesford
2023-11-02 10:48 ` [PR PATCH] [Merged]: " ahesford
2023-11-02 13:18 ` mhmdanas
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2023-11-02 10:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 151 bytes --]
New comment by pang422 on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1623655408
Comment:
pangsi422
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Merged]: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (22 preceding siblings ...)
2023-11-02 10:46 ` ahesford
@ 2023-11-02 10:48 ` ahesford
2023-11-02 13:18 ` mhmdanas
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2023-11-02 10:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
There's a merged pull request on the void-packages repository
elogind: update to 252.9.
https://github.com/void-linux/void-packages/pull/44876
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR:**Yes**, opening for testers (testing on my system x86_64-glibc, currently no issues)
Because our musl version doesn't expose them in `unisted.h` (only musl >= 1.2.3), I added a patch please check if is working properly in musl systems.
#### Local build testing
- I built this PR locally for my native architecture, x86-64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl (cross)
- aarch64(cross)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: elogind: update to 252.9.
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
` (23 preceding siblings ...)
2023-11-02 10:48 ` [PR PATCH] [Merged]: " ahesford
@ 2023-11-02 13:18 ` mhmdanas
24 siblings, 0 replies; 26+ messages in thread
From: mhmdanas @ 2023-11-02 13:18 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 185 bytes --]
New comment by mhmdanas on void-packages repository
https://github.com/void-linux/void-packages/pull/44876#issuecomment-1790709330
Comment:
Huzzah, thanks for the good work @motorto!
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2023-11-02 13:18 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] elogind: update to 252.9 motorto
2023-07-06 13:07 ` [PR REVIEW] " abenson
2023-07-06 13:10 ` [PR PATCH] [Updated] " motorto
2023-07-06 13:10 ` [PR REVIEW] " motorto
2023-07-06 13:11 ` pang422
2023-07-06 13:16 ` [PR PATCH] [Updated] " motorto
2023-07-06 16:55 ` [PR PATCH] [Updated] " motorto
2023-07-09 17:03 ` mhmdanas
2023-07-09 21:14 ` motorto
2023-07-09 21:16 ` motorto
2023-07-09 21:40 ` [PR PATCH] [Updated] " motorto
2023-07-09 21:41 ` motorto
2023-07-09 22:00 ` [PR PATCH] [Updated] " motorto
2023-07-09 22:02 ` motorto
2023-07-21 19:23 ` mhmdanas
2023-09-17 14:15 ` [PR PATCH] [Updated] " motorto
2023-09-21 14:53 ` motorto
2023-10-11 12:01 ` motorto
2023-10-15 13:20 ` [PR REVIEW] " ahesford
2023-10-15 13:32 ` [PR PATCH] [Updated] " motorto
2023-10-15 13:34 ` [PR REVIEW] " motorto
2023-11-02 8:20 ` mhmdanas
2023-11-02 9:29 ` motorto
2023-11-02 10:46 ` ahesford
2023-11-02 10:48 ` [PR PATCH] [Merged]: " ahesford
2023-11-02 13:18 ` mhmdanas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).