git: 665dae8cc334 - main - net-mgmt/networkmanager-shim: A stub port that serves to fulfill the dependency

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sat, 31 May 2025 17:53:03 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=665dae8cc334f064dd8592583f9ddfa7b08617b0

commit 665dae8cc334f064dd8592583f9ddfa7b08617b0
Author:     Kenneth Raplee <kenrap@kennethraplee.com>
AuthorDate: 2025-05-28 13:11:57 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-05-31 17:52:53 +0000

    net-mgmt/networkmanager-shim: A stub port that serves to fulfill the dependency
    
    Pull Request:   https://github.com/freebsd/freebsd-ports/pull/401
    Co-authored-by: Gleb Popov <arrowd@FreeBSD.org>
---
 net-mgmt/Makefile                                  |   1 +
 net-mgmt/networkmanager-shim/Makefile              |  68 +++++++++++
 net-mgmt/networkmanager-shim/distinfo              |   3 +
 ...rc_libnm-client-public_nm-enum-types.c.template |   9 ++
 net-mgmt/networkmanager-shim/pkg-descr             |   6 +
 net-mgmt/networkmanager-shim/pkg-plist             | 128 +++++++++++++++++++++
 6 files changed, 215 insertions(+)

diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index e18442d75df0..4872f5331339 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -204,6 +204,7 @@
     SUBDIR += netmagis-www
     SUBDIR += netmask
     SUBDIR += netspoc
+    SUBDIR += networkmanager-shim
     SUBDIR += networkmgr
     SUBDIR += netxms
     SUBDIR += nfdump
diff --git a/net-mgmt/networkmanager-shim/Makefile b/net-mgmt/networkmanager-shim/Makefile
new file mode 100644
index 000000000000..73231e6e76b1
--- /dev/null
+++ b/net-mgmt/networkmanager-shim/Makefile
@@ -0,0 +1,68 @@
+PORTNAME=	networkmanager-shim
+DISTVERSION=	1.52.0
+CATEGORIES=	net-mgmt
+
+MAINTAINER=	kde@FreeBSD.org
+COMMENT=	Compatibility shim for a standard network configuration tool suite
+WWW=		https://networkmanager.dev
+
+LICENSE=	LGPL20
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+BUILD_DEPENDS=	xsltproc:textproc/libxslt
+LIB_DEPENDS=	libdbus-1.so:devel/dbus \
+		libndp.so:net/libndp \
+		libudev.so:devel/libudev-devd \
+		libuuid.so:misc/e2fsprogs-libuuid
+
+USES=		gnome meson perl5 pkgconfig
+
+USE_GNOME=	glib20
+
+USE_GITLAB=	yes
+GL_SITE=	https://gitlab.freedesktop.org
+GL_ACCOUNT=	NetworkManager
+GL_PROJECT=	NetworkManager
+
+MESON_ARGS=	-Dconcheck=false \
+		-Dcrypto=null \
+		-Ddbus_conf_dir=disabled \
+		-Dintrospection=false \
+		-Dlibaudit=no \
+		-Dlibpsl=false \
+		-Dmodem_manager=false \
+		-Dnm_cloud_setup=false \
+		-Dnmcli=false \
+		-Dnmtui=false \
+		-Dovs=false \
+		-Dpolkit=false \
+		-Dppp=false \
+		-Dreadline=none \
+		-Dselinux=false \
+		-Dsession_tracking=no \
+		-Dsystemd_journal=false \
+		-Dsystemdsystemunitdir=disabled \
+		-Dtests=no
+
+do-build:
+	${NINJA_CMD} -C ${BUILD_WRKSRC} src/libnm-client-public/nm-enum-types.c
+	${NINJA_CMD} -C ${BUILD_WRKSRC} src/libnm-core-public/nm-core-enum-types.h
+	${CC} -shared -fPIC -Wl,-soname,libnm.so.0 -o ${BUILD_WRKSRC}/libnm.so.0 \
+		-I${WRKSRC}/src -I${WRKSRC}/src/libnm-core-public -I${WRKSRC}/src/libnm-client-public \
+		-I${BUILD_WRKSRC} -I${BUILD_WRKSRC}/src/libnm-core-public/ -I${BUILD_WRKSRC}/src/libnm-client-public/ \
+		$$(pkgconf --cflags glib-2.0) \
+		-DNDEBUG \
+		${BUILD_WRKSRC}/src/libnm-client-public/nm-enum-types.c
+
+do-install:
+	${MKDIR} -p ${STAGEDIR}${PREFIX}/include/libnm
+	cd ${WRKSRC}/src/libnm-client-public && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/libnm "-name *\.h"
+	cd ${BUILD_WRKSRC}/src/libnm-client-public && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/libnm "-name *\.h"
+	cd ${WRKSRC}/src/libnm-core-public && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/libnm "-name *\.h"
+	cd ${BUILD_WRKSRC}/src/libnm-core-public && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/libnm "-name *\.h"
+	${REINPLACE_CMD} "/#include[[:space:]]*<linux\/.*>/d" ${STAGEDIR}${PREFIX}/include/libnm/*.h
+	${INSTALL_LIB} ${BUILD_WRKSRC}/libnm.so.0 ${STAGEDIR}${PREFIX}/lib/
+	${RLN} ${STAGEDIR}${PREFIX}/lib/libnm.so.0 ${STAGEDIR}${PREFIX}/lib/libnm.so
+	${INSTALL_DATA} ${BUILD_WRKSRC}/meson-private/libnm.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/networkmanager-shim/distinfo b/net-mgmt/networkmanager-shim/distinfo
new file mode 100644
index 000000000000..3d875b0a6b6f
--- /dev/null
+++ b/net-mgmt/networkmanager-shim/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1748087623
+SHA256 (NetworkManager-1.52.0.tar.bz2) = 4ec7423ac5d06dca846482b184a24a3905a6af0ac1c82a6056866ff1edaa2ae9
+SIZE (NetworkManager-1.52.0.tar.bz2) = 8389334
diff --git a/net-mgmt/networkmanager-shim/files/patch-src_libnm-client-public_nm-enum-types.c.template b/net-mgmt/networkmanager-shim/files/patch-src_libnm-client-public_nm-enum-types.c.template
new file mode 100644
index 000000000000..7c766ce7fca1
--- /dev/null
+++ b/net-mgmt/networkmanager-shim/files/patch-src_libnm-client-public_nm-enum-types.c.template
@@ -0,0 +1,9 @@
+--- src/libnm-client-public/nm-enum-types.c.template.orig	2025-02-28 13:55:33 UTC
++++ src/libnm-client-public/nm-enum-types.c.template
+@@ -1,4 +1,6 @@
+ /*** BEGIN file-header ***/
++#include <sys/socket.h>
++
+ #include "libnm-client-impl/nm-default-libnm.h"
+ 
+ #include "nm-enum-types.h"
diff --git a/net-mgmt/networkmanager-shim/pkg-descr b/net-mgmt/networkmanager-shim/pkg-descr
new file mode 100644
index 000000000000..7bc155a2a9ee
--- /dev/null
+++ b/net-mgmt/networkmanager-shim/pkg-descr
@@ -0,0 +1,6 @@
+NetworkManager is the standard Linux network configuration tool suite. It
+supports large range of networking setups, from desktop to servers and mobile
+and integrates well with popular desktop environments and server configuration
+management tools.
+
+This port serves as a shim to bypass Linux dependencies for other ports.
diff --git a/net-mgmt/networkmanager-shim/pkg-plist b/net-mgmt/networkmanager-shim/pkg-plist
new file mode 100644
index 000000000000..5a861781151b
--- /dev/null
+++ b/net-mgmt/networkmanager-shim/pkg-plist
@@ -0,0 +1,128 @@
+include/libnm/NetworkManager.h
+include/libnm/nm-access-point.h
+include/libnm/nm-active-connection.h
+include/libnm/nm-autoptr.h
+include/libnm/nm-checkpoint.h
+include/libnm/nm-client.h
+include/libnm/nm-conn-utils.h
+include/libnm/nm-connection.h
+include/libnm/nm-core-enum-types.h
+include/libnm/nm-core-types.h
+include/libnm/nm-dbus-interface.h
+include/libnm/nm-device-6lowpan.h
+include/libnm/nm-device-adsl.h
+include/libnm/nm-device-bond.h
+include/libnm/nm-device-bridge.h
+include/libnm/nm-device-bt.h
+include/libnm/nm-device-dummy.h
+include/libnm/nm-device-ethernet.h
+include/libnm/nm-device-generic.h
+include/libnm/nm-device-hsr.h
+include/libnm/nm-device-infiniband.h
+include/libnm/nm-device-ip-tunnel.h
+include/libnm/nm-device-ipvlan.h
+include/libnm/nm-device-loopback.h
+include/libnm/nm-device-macsec.h
+include/libnm/nm-device-macvlan.h
+include/libnm/nm-device-modem.h
+include/libnm/nm-device-olpc-mesh.h
+include/libnm/nm-device-ovs-bridge.h
+include/libnm/nm-device-ovs-interface.h
+include/libnm/nm-device-ovs-port.h
+include/libnm/nm-device-ppp.h
+include/libnm/nm-device-team.h
+include/libnm/nm-device-tun.h
+include/libnm/nm-device-veth.h
+include/libnm/nm-device-vlan.h
+include/libnm/nm-device-vrf.h
+include/libnm/nm-device-vxlan.h
+include/libnm/nm-device-wifi-p2p.h
+include/libnm/nm-device-wifi.h
+include/libnm/nm-device-wimax.h
+include/libnm/nm-device-wireguard.h
+include/libnm/nm-device-wpan.h
+include/libnm/nm-device.h
+include/libnm/nm-dhcp-config.h
+include/libnm/nm-enum-types.h
+include/libnm/nm-errors.h
+include/libnm/nm-ethtool-utils.h
+include/libnm/nm-ip-config.h
+include/libnm/nm-keyfile.h
+include/libnm/nm-object.h
+include/libnm/nm-remote-connection.h
+include/libnm/nm-secret-agent-old.h
+include/libnm/nm-setting-6lowpan.h
+include/libnm/nm-setting-8021x.h
+include/libnm/nm-setting-adsl.h
+include/libnm/nm-setting-bluetooth.h
+include/libnm/nm-setting-bond-port.h
+include/libnm/nm-setting-bond.h
+include/libnm/nm-setting-bridge-port.h
+include/libnm/nm-setting-bridge.h
+include/libnm/nm-setting-cdma.h
+include/libnm/nm-setting-connection.h
+include/libnm/nm-setting-dcb.h
+include/libnm/nm-setting-dummy.h
+include/libnm/nm-setting-ethtool.h
+include/libnm/nm-setting-generic.h
+include/libnm/nm-setting-gsm.h
+include/libnm/nm-setting-hostname.h
+include/libnm/nm-setting-hsr.h
+include/libnm/nm-setting-infiniband.h
+include/libnm/nm-setting-ip-config.h
+include/libnm/nm-setting-ip-tunnel.h
+include/libnm/nm-setting-ip4-config.h
+include/libnm/nm-setting-ip6-config.h
+include/libnm/nm-setting-ipvlan.h
+include/libnm/nm-setting-link.h
+include/libnm/nm-setting-loopback.h
+include/libnm/nm-setting-macsec.h
+include/libnm/nm-setting-macvlan.h
+include/libnm/nm-setting-match.h
+include/libnm/nm-setting-olpc-mesh.h
+include/libnm/nm-setting-ovs-bridge.h
+include/libnm/nm-setting-ovs-dpdk.h
+include/libnm/nm-setting-ovs-external-ids.h
+include/libnm/nm-setting-ovs-interface.h
+include/libnm/nm-setting-ovs-other-config.h
+include/libnm/nm-setting-ovs-patch.h
+include/libnm/nm-setting-ovs-port.h
+include/libnm/nm-setting-ppp.h
+include/libnm/nm-setting-pppoe.h
+include/libnm/nm-setting-proxy.h
+include/libnm/nm-setting-serial.h
+include/libnm/nm-setting-sriov.h
+include/libnm/nm-setting-tc-config.h
+include/libnm/nm-setting-team-port.h
+include/libnm/nm-setting-team.h
+include/libnm/nm-setting-tun.h
+include/libnm/nm-setting-user.h
+include/libnm/nm-setting-veth.h
+include/libnm/nm-setting-vlan.h
+include/libnm/nm-setting-vpn.h
+include/libnm/nm-setting-vrf.h
+include/libnm/nm-setting-vxlan.h
+include/libnm/nm-setting-wifi-p2p.h
+include/libnm/nm-setting-wimax.h
+include/libnm/nm-setting-wired.h
+include/libnm/nm-setting-wireguard.h
+include/libnm/nm-setting-wireless-security.h
+include/libnm/nm-setting-wireless.h
+include/libnm/nm-setting-wpan.h
+include/libnm/nm-setting.h
+include/libnm/nm-simple-connection.h
+include/libnm/nm-utils.h
+include/libnm/nm-version-macros.h
+include/libnm/nm-version.h
+include/libnm/nm-vpn-connection.h
+include/libnm/nm-vpn-dbus-interface.h
+include/libnm/nm-vpn-editor-plugin.h
+include/libnm/nm-vpn-editor.h
+include/libnm/nm-vpn-plugin-info.h
+include/libnm/nm-vpn-plugin-old.h
+include/libnm/nm-vpn-service-plugin.h
+include/libnm/nm-wifi-p2p-peer.h
+include/libnm/nm-wimax-nsp.h
+lib/libnm.so
+lib/libnm.so.0
+libdata/pkgconfig/libnm.pc