elogind: update to 235.2.

Closes #10866.

Signed-off-by: Enno Boland <gottox@voidlinux.eu>
This commit is contained in:
maxice8 2018-01-15 06:30:28 -02:00 committed by Enno Boland
parent 4307ba84fd
commit dadca3287a
No known key found for this signature in database
GPG Key ID: D09964719BDE9971
6 changed files with 131 additions and 13 deletions

View File

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

View File

@ -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 <paths.h>
# include <utmp.h>
# include <utmpx.h>

View File

@ -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'],
[],
[]],

View File

@ -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 <stdlib.h>
#include <string.h>
#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);
@@ -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

View File

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

View File

@ -1,24 +1,42 @@
# Template file for 'elogind' # Template file for 'elogind'
pkgname=elogind pkgname=elogind
version=234.4 version=235.2
revision=1 revision=1
build_style=gnu-configure build_style=meson
hostmakedepends="automake libxslt intltool libtool pkg-config gperf docbook-xsl gettext-devel" 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 glib-devel acl-devel" makedepends="libcap-devel libmount-devel libseccomp-devel libblkid-devel pam-devel gettext-devel eudev-libudev-devel acl-devel glib-devel"
depends="dbus" depends="dbus"
short_desc="Standalone logind fork" short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.eu>" maintainer="Enno Boland <gottox@voidlinux.eu>"
license="GPL-2, LGPL-2, MIT" license="GPL-2, LGPL-2"
homepage="https://github.com/elogind/elogind" homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz" distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
checksum=ffb465a62c4281c19b07eb7fbb9ad0987f3b726ae1a868a92a3144d7714542f3 checksum=db5d7362ab7fd74a1ea863247f90f3b821cdb3e4433ba049a2fdcf5bf62b0fb9
conf_files="/etc/elogind/logind.conf" conf_files="/etc/elogind/logind.conf"
configure_args+=" --disable-kdbus --disable-lto --disable-tests \ configure_args+="
--with-rootlibexecdir=/usr/libexec/elogind/" -Drootlibexecdir=/usr/libexec/elogind
-Dhalt-path=/usr/bin/halt
-Dreboot-path=/usr/bin/reboot
-Dkexec-path=/usr/bin/kexec"
pre_configure() { pre_build() {
autoreconf -fi case "$XBPS_TARGET_MACHINE" in
intltoolize *-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() { post_install() {
@ -28,7 +46,6 @@ post_install() {
vinstall ./src/systemd/sd-id128.h 644 usr/include vinstall ./src/systemd/sd-id128.h 644 usr/include
vinstall ./src/systemd/_sd-common.h 644 usr/include vinstall ./src/systemd/_sd-common.h 644 usr/include
vinstall $FILESDIR/elogind.wrapper 755 usr/libexec/elogind vinstall $FILESDIR/elogind.wrapper 755 usr/libexec/elogind
vlicense LICENSE.MIT
} }
elogind-devel_package() { elogind-devel_package() {
@ -36,7 +53,6 @@ elogind-devel_package() {
short_desc+=" - development files" short_desc+=" - development files"
pkg_install() { pkg_install() {
vmove usr/include vmove usr/include
vmove usr/lib/*.la
vmove usr/lib/*.so vmove usr/lib/*.so
vmove usr/share/man/man3 vmove usr/share/man/man3
vmove usr/lib/pkgconfig vmove usr/lib/pkgconfig