From 07464f9d2dbafa250576eadee31b4543351e0f9c Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Sat, 16 Mar 2019 15:17:29 +0100 Subject: [PATCH] NetworkManager: update to 1.16.0. --- .../patches/fix-cross-gir.patch | 40 ++++++++ .../NetworkManager/patches/musl-basic.patch | 11 ++- .../patches/musl-dlopen-configure-ac.patch | 11 --- ...-include.patch => musl-fix-includes.patch} | 46 ++++----- .../patches/musl-has-not-secure-getenv.patch | 10 ++ .../patches/musl-network-support.patch | 12 +-- .../patches/musl-process-util.patch | 10 +- srcpkgs/NetworkManager/template | 93 +++++++------------ 8 files changed, 119 insertions(+), 114 deletions(-) create mode 100644 srcpkgs/NetworkManager/patches/fix-cross-gir.patch delete mode 100644 srcpkgs/NetworkManager/patches/musl-dlopen-configure-ac.patch rename srcpkgs/NetworkManager/patches/{fix-musl-include.patch => musl-fix-includes.patch} (54%) create mode 100644 srcpkgs/NetworkManager/patches/musl-has-not-secure-getenv.patch diff --git a/srcpkgs/NetworkManager/patches/fix-cross-gir.patch b/srcpkgs/NetworkManager/patches/fix-cross-gir.patch new file mode 100644 index 0000000000..e0573deb09 --- /dev/null +++ b/srcpkgs/NetworkManager/patches/fix-cross-gir.patch @@ -0,0 +1,40 @@ +Reason: Fix crossbuilding GIR +Upstream: No, not upstreamable since this is very specific to the Void setup +--- clients/common/meson.build ++++ clients/common/meson.build +@@ -34,7 +34,7 @@ if enable_introspection + settings_docs, + input: nm_property_docs, + output: settings_docs, +- command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@'], ++ command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), join_paths(meson.current_source_dir(), '..', '..', '@INPUT@')], + ) + + test( +--- libnm/meson.build ++++ libnm/meson.build +@@ -244,7 +244,23 @@ if enable_introspection + ) + endif + +- generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py') ++ if meson.is_cross_build() ++ arch = host_machine.cpu_family() ++ if arch == 'x86' ++ qemu_arch = 'i386' ++ elif arch == 'x86_64' ++ qemu_arch = 'x86_64' ++ elif arch == 'arm' ++ qemu_arch = 'arm' ++ elif arch == 'aarch64' ++ qemu_arch = 'aarch64' ++ endif ++ qemu = '/usr/bin/qemu-' + qemu_arch + '-static' ++ qemu_python3_cmd = qemu + ' -L @XBPS_CROSS_BASE@ @XBPS_CROSS_BASE@/bin/python3' ++ generate_setting_docs = ['sh', '-c', qemu_python3_cmd, join_paths(meson.current_source_dir(), 'generate-setting-docs.py')] ++ else ++ generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py') ++ endif + + gi_typelib_path = run_command('printenv', 'GI_TYPELIB_PATH').stdout() + if gi_typelib_path != '' diff --git a/srcpkgs/NetworkManager/patches/musl-basic.patch b/srcpkgs/NetworkManager/patches/musl-basic.patch index 415236ed88..8c4bbb6e79 100644 --- a/srcpkgs/NetworkManager/patches/musl-basic.patch +++ b/srcpkgs/NetworkManager/patches/musl-basic.patch @@ -1,6 +1,6 @@ Usual fix for musl libc ---- src/systemd/src/basic/stdio-util.h.orig -+++ src/systemd/src/basic/stdio-util.h +--- shared/systemd/src/basic/stdio-util.h.orig ++++ shared/systemd/src/basic/stdio-util.h @@ -19,7 +19,9 @@ along with systemd; If not, see . ***/ @@ -11,15 +11,16 @@ Usual fix for musl libc #include #include #include ---- src/systemd/src/basic/util.h.orig -+++ src/systemd/src/basic/util.h -@@ -46,6 +46,11 @@ +--- shared/systemd/src/basic/util.h.orig ++++ shared/systemd/src/basic/util.h +@@ -46,6 +46,12 @@ #include "missing.h" #include "time-util.h" +#if !defined(__GLIBC__) +typedef int (*__compar_fn_t) (const void*, const void*); +typedef __compar_fn_t comparison_fn_t; ++typedef int (*__compar_d_fn_t) (const void *, const void *, void *); +#endif + size_t page_size(void) _pure_; diff --git a/srcpkgs/NetworkManager/patches/musl-dlopen-configure-ac.patch b/srcpkgs/NetworkManager/patches/musl-dlopen-configure-ac.patch deleted file mode 100644 index cf8969666a..0000000000 --- a/srcpkgs/NetworkManager/patches/musl-dlopen-configure-ac.patch +++ /dev/null @@ -1,11 +0,0 @@ -musl: dlopen is included so LD_LIBS="" instead of LD_LIBS="none required" ---- configure.ac.orig -+++ configure.ac -@@ -275,6 +275,7 @@ - dnl Checks for libdl - on certain platforms its part of libc - dnl - AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=]) -+AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""]) - AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen") - - PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0], diff --git a/srcpkgs/NetworkManager/patches/fix-musl-include.patch b/srcpkgs/NetworkManager/patches/musl-fix-includes.patch similarity index 54% rename from srcpkgs/NetworkManager/patches/fix-musl-include.patch rename to srcpkgs/NetworkManager/patches/musl-fix-includes.patch index f3c22b68df..11bbc76217 100644 --- a/srcpkgs/NetworkManager/patches/fix-musl-include.patch +++ b/srcpkgs/NetworkManager/patches/musl-fix-includes.patch @@ -1,37 +1,22 @@ ---- shared/n-acd/src/n-acd.c -+++ shared/n-acd/src/n-acd.c -@@ -23,10 +23,10 @@ - #include - #include - #include --#include - #include - #include - #include -+#include - #include - #include - #include --- src/devices/nm-device.c +++ src/devices/nm-device.c -@@ -34,7 +34,11 @@ +@@ -32,7 +32,11 @@ #include #include #include --#include +#if defined(__GLIBC__) -+ #include + #include +#else -+ #include ++#include +#endif #include #include - + --- src/nm-manager.c +++ src/nm-manager.c -@@ -28,6 +28,7 @@ - #include - #include +@@ -26,6 +26,7 @@ + #include + #include #include +#include @@ -45,17 +30,16 @@ #include "nm-linux-platform.h" +#include "wpan/nm-wpan-utils.h" - #include - #include -@@ -33,7 +34,11 @@ - #include - #include + #include + #include +@@ -27,7 +28,11 @@ + #include + #include #include --#include +#if defined(__GLIBC__) -+ #include + #include +#else -+ #include ++#include +#endif #include #include @@ -66,3 +50,5 @@ #include "wifi/nm-wifi-utils-wext.h" -#include "wpan/nm-wpan-utils.h" #include "nm-utils/unaligned.h" + #include "nm-utils/nm-io-utils.h" + #include "nm-utils/nm-udev-utils.h" diff --git a/srcpkgs/NetworkManager/patches/musl-has-not-secure-getenv.patch b/srcpkgs/NetworkManager/patches/musl-has-not-secure-getenv.patch new file mode 100644 index 0000000000..ece41ca9c9 --- /dev/null +++ b/srcpkgs/NetworkManager/patches/musl-has-not-secure-getenv.patch @@ -0,0 +1,10 @@ +--- src/systemd/sd-adapt-core/nm-sd-adapt-core.h.orig 2019-03-17 16:56:13.649901535 +0100 ++++ src/systemd/sd-adapt-core/nm-sd-adapt-core.h 2019-03-17 16:56:35.278786119 +0100 +@@ -65,7 +65,7 @@ + # ifdef HAVE___SECURE_GETENV + # define secure_getenv __secure_getenv + # else +-# error neither secure_getenv nor __secure_getenv is available ++# define secure_getenv getenv + # endif + #endif diff --git a/srcpkgs/NetworkManager/patches/musl-network-support.patch b/srcpkgs/NetworkManager/patches/musl-network-support.patch index 9b038983d4..0fb63f067b 100644 --- a/srcpkgs/NetworkManager/patches/musl-network-support.patch +++ b/srcpkgs/NetworkManager/patches/musl-network-support.patch @@ -26,12 +26,12 @@ #include "nm-dbus-interface.h" ---- src/systemd/src/basic/socket-util.h.orig -+++ src/systemd/src/basic/socket-util.h -@@ -28,6 +28,11 @@ +--- shared/systemd/src/basic/socket-util.h 2019-03-16 15:41:33.287235649 +0100 ++++ shared/systemd/src/basic/socket-util.h 2019-03-16 15:42:24.273912106 +0100 +@@ -12,6 +12,11 @@ + #include + #include #include - #include - #include +#if !defined(__GLIBC__) +/* SIOCGSTAMPNS from linux/asm-generic.h + * for src/systemd/src/libsystemd-network/sd-lldp.c */ @@ -39,4 +39,4 @@ +#endif #include "macro.h" - #include "util.h" + #include "missing_socket.h" diff --git a/srcpkgs/NetworkManager/patches/musl-process-util.patch b/srcpkgs/NetworkManager/patches/musl-process-util.patch index e76849b431..e406de1da8 100644 --- a/srcpkgs/NetworkManager/patches/musl-process-util.patch +++ b/srcpkgs/NetworkManager/patches/musl-process-util.patch @@ -1,5 +1,5 @@ ---- src/systemd/src/basic/process-util.c.orig 2018-03-20 23:12:35.698715891 +0100 -+++ src/systemd/src/basic/process-util.c 2018-03-20 23:17:24.114733986 +0100 +--- shared/systemd/src/basic/process-util.c ++++ shared/systemd/src/basic/process-util.c @@ -21,6 +21,9 @@ #include #include @@ -10,7 +10,7 @@ #if 0 /* NM_IGNORED */ #if HAVE_VALGRIND_VALGRIND_H #include -@@ -1153,11 +1156,13 @@ void reset_cached_pid(void) { +@@ -1168,11 +1171,13 @@ void reset_cached_pid(void) { cached_pid = CACHED_PID_UNSET; } @@ -19,12 +19,12 @@ * 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. */ extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle); - extern void* __dso_handle __attribute__ ((__weak__)); + extern void* __dso_handle _weak_; +#endif pid_t getpid_cached(void) { static bool installed = false; -@@ -1186,7 +1191,12 @@ pid_t getpid_cached(void) { +@@ -1201,7 +1206,12 @@ pid_t getpid_cached(void) { * only half-documented (glibc doesn't document it but LSB does — though only superficially) * we'll check for errors only in the most generic fashion possible. */ diff --git a/srcpkgs/NetworkManager/template b/srcpkgs/NetworkManager/template index bc7a2e3867..32614b8085 100644 --- a/srcpkgs/NetworkManager/template +++ b/srcpkgs/NetworkManager/template @@ -1,49 +1,34 @@ # Template file for 'NetworkManager' pkgname=NetworkManager -version=1.14.6 +version=1.16.0 revision=1 -build_style=gnu-configure +build_style=meson build_helper="gir" -configure_args="--without-dhcpcd --with-dhclient=/usr/bin/dhclient - --with-system-ca-path=/etc/ssl/certs --enable-more-warnings=no - --with-crypto=gnutls --disable-static --enable-ppp --with-nmtui - --with-udev-dir=/usr/lib/udev $(vopt_enable gir introspection) - --with-kernel-firmware-dir=/usr/lib/firmware --disable-ifcfg-rh - --with-pppd-plugin-dir=/usr/lib/pppd/2.4.7 --enable-modify-system - --with-modem-manager-1 --with-resolvconf=/usr/bin/resolvconf - --with-session-tracking=$(vopt_if elogind elogind consolekit) - --with-suspend-resume=$(vopt_if elogind elogind consolekit) - --with-libnm-glib --disable-ifupdown - --with-systemdsystemunitdir=no --enable-polkit-agent --enable-tests=no - --with-systemd-journal=no --with-systemd-logind=no --disable-gtk-doc - --with-dbus-sys-dir=/etc/dbus-1/system.d - --sbindir=/usr/bin --enable-concheck --with-libpsl - --with-dnsmasq=/usr/bin/dnsmasq --with-config-dhcp-default=dhclient - ac_cv_file__etc_redhat_release=no ac_cv_file__etc_gentoo_release=no - ac_cv_file__etc_fedora_release=no ac_cv_file__etc_mandriva_release=no - ac_cv_file__etc_SuSE_release=no ac_cv_file__etc_debian_version=no" +configure_args="-Dpolkit_agent=true -Dsystemd_journal=false + -Dlibaudit=no -Dovs=false -Dlibnm_glib=true -Dselinux=false + -Dmodify_system=true -Dpolkit_agent=true -Dsystemdsystemunitdir=no + -Dpppd=/usr/bin/pppd -Dqt=false + -Dpppd_plugin_dir=/usr/lib/pppd/2.4.7 -Dresolvconf=/usr/bin/resolvconf + -Ddhclient=/usr/bin/dhclient -Dkernel_firmware_dir=/usr/lib/firmware + -Ddnsmasq=/usr/bin/dnsmasq -Ddbus_conf_dir=/etc/dbus-1/system.d + -Dudev_dir=/usr/lib/udev -Dintrospection=$(vopt_if gir true false) + -Dvapi=$(vopt_if vala true false) + -Dsession_tracking=$(vopt_if elogind elogind no)" +hostmakedepends="gettext-devel glib-devel libxslt-devel pkg-config + intltool dbus-glib-devel jansson-devel $(vopt_if vala vala) + $(vopt_if gir 'python3-gobject')" +makedepends="libuuid-devel nss-devel dbus-glib-devel libgudev-devel + libnl3-devel polkit-devel ppp-devel iptables-devel libcurl-devel + ModemManager-devel readline-devel libndp-devel newt-devel jansson-devel + libpsl-devel eudev-libudev-devel + $(vopt_if gir libgirepository-devel) $(vopt_if elogind elogind-devel)" +depends="dbus dhclient iproute2 openresolv wpa_supplicant" short_desc="Network Management daemon" -maintainer="Rasmus Thomsen " +maintainer="Rasmus Thomsen " license="GPL-2.0-or-later" homepage="https://wiki.gnome.org/Projects/NetworkManager" distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz" -checksum=693bcdad15eec7f07a06cbc6e43ddb3b1c13b2d2d23ec165fbb5adf4c3323a5d - -# gtk-doc generation is disabled but gtkdocisze is required by autogen.sh -hostmakedepends="automake bluez dbus-glib-devel dhclient gettext-devel - glib-devel gnutls-devel gtk-doc intltool iproute2 iptables libtool - libxslt-devel pkg-config wpa_supplicant - $(vopt_if gir 'python-gobject')" -makedepends="libuuid-devel gnutls-devel dbus-glib-devel libgudev-devel - libnl3-devel polkit-devel ppp-devel iptables-devel libcurl-devel - ModemManager-devel readline-devel libndp-devel newt-devel jansson-devel - libpsl-devel - $(vopt_if gir libgirepository-devel) $(vopt_if elogind elogind-devel)" -# Install host dependency to read the soname. Should be the same on -# host and target. -hostmakedepends+=" jansson-devel" -depends="dbus dhclient iproute2 openresolv wpa_supplicant" - +checksum=8e962833b6ca03edda1bc57ed6614a7b8c2339531b44acef098d05f2324c5d2c lib32disabled=yes conf_files="/etc/${pkgname}/${pkgname}.conf" make_dirs=" @@ -56,38 +41,29 @@ make_dirs=" case "$XBPS_TARGET_MACHINE" in *-musl) - CFLAGS+=" -DHAVE_SECURE_GETENV -Dsecure_getenv=getenv" - CFLAGS+=" -D__USE_POSIX199309 -DRTLD_DEEPBIND=0" + CFLAGS+=" -DRTLD_DEEPBIND=0" + # Fail to build on musl + configure_args+=" -Dtests=no" ;; esac # Package build options -build_options="gir elogind" +build_options="gir vala elogind" case "$XBPS_TARGET_MACHINE" in - i686-musl|x86_64-musl) build_options_default+=" gir" ;; + i686-musl|x86_64-musl) build_options_default+=" gir vala" ;; *-musl) ;; - *) build_options_default+=" gir" ;; + *) build_options_default+=" gir vala" ;; esac - pre_configure() { - NOCONFIGURE=1 ./autogen.sh - - # Full switch to /run to not depend on /var/run being a symlink. - sed -e 's,^nmrundir=.*$,nmrundir=\"/run/\$PACKAGE\",' -i configure - - # Fsckd-up check for gi ? - sed -e 's,! "$PYTHON" -c ,"$PYTHON" -c,' -i configure -} - -pre_build() { - export GIR_EXTRA_LIBS_PATH="${wrksrc}/libnm-util/.libs:${wrksrc}/libnm/.libs:${wrksrc}/libnm-glib/.libs" + if [ "$CROSS_BUILD" ]; then + # Replace the values from our patch into the system itself + sed -i -e "s|@XBPS_CROSS_BASE@|${XBPS_CROSS_BASE}|g" libnm/meson.build + fi } post_install() { vinstall ${FILESDIR}/${pkgname}.conf 644 etc/${pkgname} - # remove unused stuff - rm -rf ${DESTDIR}/etc/init.d vsv ${pkgname} } @@ -110,5 +86,8 @@ NetworkManager-devel_package() { if [ "$build_option_gir" ]; then vmove usr/share/gir-1.0 fi + if [ "$build_option_vala" ]; then + vmove usr/share/vala + fi } }