Github messages for voidlinux
 help / color / mirror / Atom feed
From: motorto <motorto@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] elogind: update to 252.9.
Date: Thu, 06 Jul 2023 18:55:52 +0200	[thread overview]
Message-ID: <20230706165552.2wXtqIktADQIGdv_BO3gMlsjO1Zsoemd8ES6S1ur-sg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44876@inbox.vuxu.org>

[-- 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

  parent reply	other threads:[~2023-07-06 16:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 13:05 [PR PATCH] [DON'T MERGE] " 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 ` motorto [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230706165552.2wXtqIktADQIGdv_BO3gMlsjO1Zsoemd8ES6S1ur-sg@z \
    --to=motorto@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).