diff --git a/srcpkgs/elogind/patches/Use-getenv-when-secure-versions-are-not-available.patch b/srcpkgs/elogind/patches/Use-getenv-when-secure-versions-are-not-available.patch new file mode 100644 index 00000000000..de786bc8cba --- /dev/null +++ b/srcpkgs/elogind/patches/Use-getenv-when-secure-versions-are-not-available.patch @@ -0,0 +1,14 @@ +--- src/shared/musl_missing.h ++++ src/shared/musl_missing.h +@@ -41,9 +41,10 @@ extern char *program_invocation_short_name; + * + test if the effective capability bit was set on the executable file + * + test if the process has a nonempty permitted capability set + */ +-#if !defined(HAVE_SECURE_GETENV) && !defined(HAVE___SECURE_GETENV) ++#if ! HAVE_SECURE_GETENV && ! HAVE___SECURE_GETENV + # define secure_getenv(name) \ + (issetugid() ? NULL : getenv(name)) ++# undef HAVE_SECURE_GETENV + # define HAVE_SECURE_GETENV 1 + #endif // HAVE_[__]SECURE_GETENV + diff --git a/srcpkgs/elogind/patches/Use-utmp-headers-when-available.patch b/srcpkgs/elogind/patches/Use-utmp-headers-when-available.patch new file mode 100644 index 00000000000..f2992ed00de --- /dev/null +++ b/srcpkgs/elogind/patches/Use-utmp-headers-when-available.patch @@ -0,0 +1,11 @@ +--- src/shared/musl_missing.h ++++ src/shared/musl_missing.h +@@ -88,7 +88,7 @@ typedef __compar_fn_t comparison_fn_t; + #endif + + /* Make musl utmp/wtmp stubs visible if needed. */ +-#ifdef HAVE_UTMP ++#if ENABLE_UTMP + # include + # include + # include diff --git a/srcpkgs/elogind/patches/disable-compilation-of-musl-failing-test.patch b/srcpkgs/elogind/patches/disable-compilation-of-musl-failing-test.patch new file mode 100644 index 00000000000..49951dd5c98 --- /dev/null +++ b/srcpkgs/elogind/patches/disable-compilation-of-musl-failing-test.patch @@ -0,0 +1,18 @@ +--- src/test/meson.build ++++ src/test/meson.build +@@ -198,10 +198,11 @@ tests += [ + [], + []], + +- [['src/test/test-hexdecoct.c'], +- [], +- []], +- ++#if 0 /// FAILS TO COMPILE ON MUSL LIBC SYSTEMS ++# [['src/test/test-hexdecoct.c'], ++# [], ++# []], ++#endif //0 + [['src/test/test-alloc-util.c'], + [], + []], diff --git a/srcpkgs/elogind/patches/fix-usage-of-__register_atfork.patch b/srcpkgs/elogind/patches/fix-usage-of-__register_atfork.patch new file mode 100644 index 00000000000..9a411ebc218 --- /dev/null +++ b/srcpkgs/elogind/patches/fix-usage-of-__register_atfork.patch @@ -0,0 +1,36 @@ +--- src/basic/process-util.c ++++ src/basic/process-util.c +@@ -1022,8 +1022,10 @@ static void reset_cached_pid(void) { + /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc + * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against + * libpthread, as it is part of glibc anyway. */ ++#ifdef __GLIBC__ + extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle); + extern void* __dso_handle __attribute__ ((__weak__)); ++#endif + + pid_t getpid_cached(void) { + pid_t current_value; +--- src/shared/musl_missing.h ++++ src/shared/musl_missing.h +@@ -24,6 +24,7 @@ void elogind_set_program_name(const char* pcall); + #include + #include + #include ++#include /* for pthread_atfork */ + + #define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m); + +@@ -99,6 +100,12 @@ typedef __compar_fn_t comparison_fn_t; + # endif + #endif // HAVE_UTMP + ++/* ++ * Systemd makes use of glibc __register_atfork which is not availble on musl ++ * it is mostly equivalent to pthread_atfork, so we link against pthread ++ */ ++#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child) ++ + #endif // !defined(__GLIBC__) + + #endif // ELOGIND_BASIC_MUSL_MISSING_H_INCLUDED diff --git a/srcpkgs/elogind/patches/guard-against-usage-of-specific-glibc-functions.patch b/srcpkgs/elogind/patches/guard-against-usage-of-specific-glibc-functions.patch new file mode 100644 index 00000000000..01e54de03e8 --- /dev/null +++ b/srcpkgs/elogind/patches/guard-against-usage-of-specific-glibc-functions.patch @@ -0,0 +1,23 @@ +--- src/test/test-sizeof.c ++++ src/test/test-sizeof.c +@@ -48,8 +48,10 @@ int main(void) { + info(unsigned); + info(long unsigned); + info(long long unsigned); ++#ifdef __GLIBC__ + info(__syscall_ulong_t); + info(__syscall_slong_t); ++#endif + + info(float); + info(double); +@@ -59,7 +61,9 @@ int main(void) { + info(ssize_t); + info(time_t); + info(usec_t); ++#ifdef __GLIBC__ + info(__time_t); ++#endif + info(pid_t); + info(gid_t); + diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template index b4e1c09218d..c8c2e31f63a 100644 --- a/srcpkgs/elogind/template +++ b/srcpkgs/elogind/template @@ -1,24 +1,42 @@ # Template file for 'elogind' pkgname=elogind -version=234.4 +version=235.2 revision=1 -build_style=gnu-configure -hostmakedepends="automake libxslt intltool libtool pkg-config gperf docbook-xsl gettext-devel" -makedepends="libcap-devel libmount-devel libseccomp-devel libblkid-devel pam-devel gettext-devel eudev-libudev-devel glib-devel acl-devel" +build_style=meson +hostmakedepends="intltool pkg-config gperf docbook-xsl gettext-devel shadow m4 libxslt git" +makedepends="libcap-devel libmount-devel libseccomp-devel libblkid-devel pam-devel gettext-devel eudev-libudev-devel acl-devel glib-devel" depends="dbus" short_desc="Standalone logind fork" maintainer="Enno Boland " -license="GPL-2, LGPL-2, MIT" +license="GPL-2, LGPL-2" homepage="https://github.com/elogind/elogind" distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz" -checksum=ffb465a62c4281c19b07eb7fbb9ad0987f3b726ae1a868a92a3144d7714542f3 +checksum=db5d7362ab7fd74a1ea863247f90f3b821cdb3e4433ba049a2fdcf5bf62b0fb9 conf_files="/etc/elogind/logind.conf" -configure_args+=" --disable-kdbus --disable-lto --disable-tests \ - --with-rootlibexecdir=/usr/libexec/elogind/" +configure_args+=" + -Drootlibexecdir=/usr/libexec/elogind + -Dhalt-path=/usr/bin/halt + -Dreboot-path=/usr/bin/reboot + -Dkexec-path=/usr/bin/kexec" -pre_configure() { - autoreconf -fi - intltoolize +pre_build() { + case "$XBPS_TARGET_MACHINE" in + *-musl) cp build/config.h src/shared;; + esac +} + +pre_check() { + # test-fs-util checks for /etc/machine-id/foo and expects ENOTDIR + # since /etc/machine-id is expected to be a file. + # test-id128 tries to get a id generated by dbus-uuidgen from + # /etc/machine-id, since we don't want to add a checkdependency + # on dbus we just provide a string generated from dbus-uuidgen + # for use in all cases. + echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id + + # test-copy searches for /etc/os-release but this file is provided + # by runit-void, create a dummy file to avoid a dependency on runit-void + echo 'dummy-file' > /etc/os-release } post_install() { @@ -28,7 +46,6 @@ post_install() { vinstall ./src/systemd/sd-id128.h 644 usr/include vinstall ./src/systemd/_sd-common.h 644 usr/include vinstall $FILESDIR/elogind.wrapper 755 usr/libexec/elogind - vlicense LICENSE.MIT } elogind-devel_package() { @@ -36,7 +53,6 @@ elogind-devel_package() { short_desc+=" - development files" pkg_install() { vmove usr/include - vmove usr/lib/*.la vmove usr/lib/*.so vmove usr/share/man/man3 vmove usr/lib/pkgconfig