From 2a2668df519dc5b31c6062df42bbef603bbf8075 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Fri, 3 May 2019 11:45:11 +0200 Subject: [PATCH] community/networkmanager: update to 1.18.1 Closes GH-7519 --- community/networkmanager/APKBUILD | 107 +++++++++--------- community/networkmanager/musl-basic.patch | 61 +++++----- community/networkmanager/musl-compar.patch | 18 +++ .../musl-dlopen-configure-ac.patch | 34 ------ .../networkmanager/musl-fix-includes.patch | 24 ++-- .../musl-has-not-secure-getenv.patch | 7 +- 6 files changed, 118 insertions(+), 133 deletions(-) create mode 100644 community/networkmanager/musl-compar.patch delete mode 100644 community/networkmanager/musl-dlopen-configure-ac.patch diff --git a/community/networkmanager/APKBUILD b/community/networkmanager/APKBUILD index 0f99f0377d8..3508ec6ccf8 100644 --- a/community/networkmanager/APKBUILD +++ b/community/networkmanager/APKBUILD @@ -1,15 +1,14 @@ # Contributor: Stuart Cardall -# Maintainer: +# Maintainer: Rasmus Thomsen pkgname=networkmanager -pkgver=1.16.0 +pkgver=1.18.1 pkgrel=0 -pkgdesc="network management tool" -url="http://projects.gnome.org/NetworkManager/" +pkgdesc="Network Management daemon" +url="https://wiki.gnome.org/Projects/NetworkManager" arch="all" license="GPL-2.0-or-later" depends="dhcpcd iptables dbus" install="$pkgname.pre-install $pkgname.pre-upgrade" -depends_dev= makedepends="$depends_dev curl-dev dbus-glib-dev @@ -31,9 +30,10 @@ makedepends="$depends_dev util-linux-dev jansson-dev vala - autoconf - automake - libtool + meson + py-gobject3 + libpsl-dev + python2 " subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-openrc" source="https://download.gnome.org/sources/NetworkManager/${pkgver:0:4}/NetworkManager-$pkgver.tar.xz @@ -42,81 +42,76 @@ source="https://download.gnome.org/sources/NetworkManager/${pkgver:0:4}/NetworkM $pkgname.rules musl-basic.patch musl-network-support.patch - musl-dlopen-configure-ac.patch musl-fix-includes.patch musl-process-util.patch musl-has-not-secure-getenv.patch + musl-compar.patch " -options="!check" +options="!check" # fail to compile on musl builddir="$srcdir"/NetworkManager-$pkgver -prepare() { - cd "$builddir" - default_prepare - autoreconf -} - build() { - cd "$builddir" - ./configure \ + meson \ --prefix=/usr \ --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ --localstatedir=/var \ - --enable-concheck \ - --enable-ifupdown \ - --enable-modify-system \ - --enable-polkit-agent \ - --with-config-dhcp-default=dhcpcd \ - --with-crypto=nss \ - --with-dhcpcd=yes \ - --with-dhclient=yes \ - --with-modem-manager-1 \ - --with-nmtui=yes \ - --with-resolvconf=yes \ - --with-session-tracking=no \ - --with-systemdsystemunitdir=no \ - --with-systemd-journal=no \ - --with-systemd-logind=no \ - --with-suspend-resume=upower \ - --with-wext=yes \ - --disable-config-plugin-ibft \ - --disable-gtk-doc \ - --disable-introspection \ - --disable-more-warnings \ - --disable-tests \ - --without-valgrind \ - --disable-wimax - make libnm-core/nm-core-enum-types.h - make + -Dsystemdsystemunitdir=no \ + -Dudev_dir=/lib/udev \ + -Diptables=/sbin/iptables \ + -Ddnsmasq=/usr/sbin/dnsmasq \ + -Dmodify_system=true \ + -Dselinux=false \ + -Dsystemd_journal=false \ + -Dlibaudit=no \ + -Diwd=true \ + -Dpppd=/usr/sbin/pppd \ + -Dconfig_plugins_default=ifupdown \ + -Difupdown=true \ + -Ddhcpcd=true \ + -Dconfig_dhcp_default=dhcpcd \ + -Dvapi=true \ + -Dtests=no \ + -Dlibnm_glib=true \ + -Dpolkit_agent=true \ + -Dsession_tracking=no \ + -Dqt=false \ + . output + ninja -C output +} + +check() { + ninja -C output test } package() { - cd "$builddir" - make DESTDIR="$pkgdir" install + DESTDIR="$pkgdir" ninja -C output install install -m755 -D "$srcdir"/networkmanager.initd "$pkgdir"/etc/init.d/networkmanager install -m644 -D "$srcdir/$pkgname.conf" "$pkgdir"/etc/NetworkManager/NetworkManager.conf # allow plugdev users to modify connections install -m644 -D "$srcdir/$pkgname.rules" \ - "$pkgdir/usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules" + "$pkgdir/usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules" mkdir -p "$pkgdir/usr/share/apk-tools/$pkgname" # post-install message mv "$pkgdir/usr/share/doc/NetworkManager" "$pkgdir/usr/share/doc/$pkgname" - cat > $pkgdir/usr/share/doc/$pkgname/README.alpine < $pkgdir/usr/share/doc/$pkgname/README.alpine <. - ***/ - -+#if defined(__GLIBC__) - #include -+#endif - #include - #include - #include ---- a/shared/systemd/src/basic/util.h -+++ b/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_; - #define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) - +diff --git a/libnm-core/nm-json.c b/libnm-core/nm-json.c +index aa181a4..98c39fc 100644 --- a/libnm-core/nm-json.c +++ b/libnm-core/nm-json.c @@ -23,6 +23,10 @@ @@ -39,3 +13,34 @@ Usual fix for musl libc void *_nm_jansson_json_object_iter_value; void *_nm_jansson_json_object_key_to_iter; void *_nm_jansson_json_integer; +diff --git a/shared/systemd/src/basic/stdio-util.h b/shared/systemd/src/basic/stdio-util.h +index c3b9448..e80a938 100644 +--- a/shared/systemd/src/basic/stdio-util.h ++++ b/shared/systemd/src/basic/stdio-util.h +@@ -1,7 +1,9 @@ + /* SPDX-License-Identifier: LGPL-2.1+ */ + #pragma once + ++#if defined(__GLIBC__) + #include ++#endif + #include + #include + #include +diff --git a/shared/systemd/src/basic/util.h b/shared/systemd/src/basic/util.h +index 25e6ab8..7967e8a 100644 +--- a/shared/systemd/src/basic/util.h ++++ b/shared/systemd/src/basic/util.h +@@ -46,6 +46,12 @@ static inline unsigned u64log2(uint64_t n) { + #endif + } + ++#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 ++ + static inline unsigned u32ctz(uint32_t n) { + #if __SIZEOF_INT__ == 4 + return n != 0 ? __builtin_ctz(n) : 32; diff --git a/community/networkmanager/musl-compar.patch b/community/networkmanager/musl-compar.patch new file mode 100644 index 00000000000..1b1de2f283b --- /dev/null +++ b/community/networkmanager/musl-compar.patch @@ -0,0 +1,18 @@ +diff --git a/shared/systemd/src/basic/sort-util.h b/shared/systemd/src/basic/sort-util.h +index e029f86..935f136 100644 +--- a/shared/systemd/src/basic/sort-util.h ++++ b/shared/systemd/src/basic/sort-util.h +@@ -5,6 +5,13 @@ + + #include "macro.h" + ++#ifndef __COMPAR_FN_T ++# define __COMPAR_FN_T ++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 ++ + void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size, + __compar_d_fn_t compar, void *arg); + diff --git a/community/networkmanager/musl-dlopen-configure-ac.patch b/community/networkmanager/musl-dlopen-configure-ac.patch deleted file mode 100644 index 4f706649852..00000000000 --- a/community/networkmanager/musl-dlopen-configure-ac.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cdd5865a6a31a593b8d33ee338638ebe3bed6391 Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Fri, 29 Mar 2019 09:13:59 +0100 -Subject: [PATCH] build: fix searching dlopen in configure - -The 4th argument of AC_SEARCH_LIBS is a list of additional libraries, -not the name of the variable to hold the result which is always -ac_cv_search_$function. Also, we should ignore the result when it is -"none required". - -Fixes: 1f2eeb85d80d ('build: rename $(LIBDL) to $(DL_LIBS) and modify detection') ---- - configure.ac | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 334d9272d..fc09bd461 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -240,8 +240,9 @@ AM_CONDITIONAL(WITH_IWD, test x"${ac_with_iwd}" = x"yes") - dnl - dnl Checks for libdl - on certain platforms its part of libc - dnl --AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=]) --AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen") -+AC_SEARCH_LIBS([dlopen], [dl dld], -+ [test "$ac_cv_search_dlopen" = "none required" || AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen"]), -+ []) - - PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0], - [AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh') --- -2.20.1 - diff --git a/community/networkmanager/musl-fix-includes.patch b/community/networkmanager/musl-fix-includes.patch index 085a8adeaf3..e68925372d7 100644 --- a/community/networkmanager/musl-fix-includes.patch +++ b/community/networkmanager/musl-fix-includes.patch @@ -1,3 +1,5 @@ +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index bd4fbcc..cb5436f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -32,7 +32,11 @@ @@ -11,7 +13,9 @@ +#endif #include #include - + +diff --git a/src/nm-manager.c b/src/nm-manager.c +index 40e068a..aa57ce8 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -26,6 +26,7 @@ @@ -20,8 +24,10 @@ #include +#include - #include "nm-utils/nm-c-list.h" + #include "nm-glib-aux/nm-c-list.h" +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c +index d4b0115..c934f10 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -20,6 +20,7 @@ @@ -32,23 +38,15 @@ #include #include -@@ -27,7 +28,11 @@ - #include +@@ -28,7 +29,11 @@ #include + #include #include +#if defined(__GLIBC__) #include +#else +#include +#endif + #include #include #include - #include -@@ -53,7 +58,6 @@ - #include "nm-platform-private.h" - #include "wifi/nm-wifi-utils.h" - #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/community/networkmanager/musl-has-not-secure-getenv.patch b/community/networkmanager/musl-has-not-secure-getenv.patch index 074a4f2199c..37883e2720b 100644 --- a/community/networkmanager/musl-has-not-secure-getenv.patch +++ b/community/networkmanager/musl-has-not-secure-getenv.patch @@ -1,5 +1,7 @@ ---- a/src/systemd/sd-adapt-core/nm-sd-adapt-core.h 2019-03-17 16:56:13.649901535 +0100 -+++ b/src/systemd/sd-adapt-core/nm-sd-adapt-core.h 2019-03-17 16:56:35.278786119 +0100 +diff --git a/src/systemd/sd-adapt-core/nm-sd-adapt-core.h b/src/systemd/sd-adapt-core/nm-sd-adapt-core.h +index 8c07c53..d043afc 100644 +--- a/src/systemd/sd-adapt-core/nm-sd-adapt-core.h ++++ b/src/systemd/sd-adapt-core/nm-sd-adapt-core.h @@ -65,7 +65,7 @@ # ifdef HAVE___SECURE_GETENV # define secure_getenv __secure_getenv @@ -8,3 +10,4 @@ +# define secure_getenv getenv # endif #endif +