Skip to content

Commit

Permalink
Merge branch 'nm-gtk4'
Browse files Browse the repository at this point in the history
Adds support for GTK 4.  Two versions of the UI are built as shared
objects, the plugin dynamically loads and instantiates the appropriate one
based on the determined GTK version.

Closes #961
  • Loading branch information
tobiasbrunner committed May 16, 2022
2 parents 64d7323 + 14f0821 commit 846201a
Show file tree
Hide file tree
Showing 15 changed files with 1,076 additions and 512 deletions.
4 changes: 4 additions & 0 deletions src/frontends/gnome/.gitignore
Expand Up @@ -11,3 +11,7 @@ config.guess.cdbs-orig
config.sub.cdbs-orig
NetworkManager-strongswan.metainfo.xml
NetworkManager-strongswan.pot
properties/nm-strongswan-resources.c
properties/nm-strongswan-resources.h
properties/gtk4/nm-strongswan-dialog.ui
properties/gtk4/nm-strongswan-resources.c
17 changes: 0 additions & 17 deletions src/frontends/gnome/Makefile.am
Expand Up @@ -11,23 +11,6 @@ metainfo_DATA = $(metainfo_in_files:.xml.in=.xml)
metainfo_in_files = NetworkManager-strongswan.metainfo.xml.in
@INTLTOOL_XML_RULE@

if WITH_LIBNM_GLIB
# Install a file with full path to plugins for an old gnome-shell
# https://bugzilla.gnome.org/show_bug.cgi?id=693590
install-data-hook:
mkdir -p $(DESTDIR)$(sysconfdir)/NetworkManager/VPN
sed -e "1s|^|# This file is obsoleted by a file in $(nmvpnservicedir)\n\n|" \
-e 's|[@]NM_LIBEXECDIR[@]|$(nm_libexecdir)|g' \
-e 's|[@]NM_PLUGINDIR[@]|$(nm_plugindir)|g' \
-e 's|[@]NM_PLUGINDIR_ABS[@]|$(nm_plugindir)|g' \
-e 's|[@]CHARON[@]|$(charon)|' \
<$(srcdir)/nm-strongswan-service.name.in \
>$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-strongswan-service.name

uninstall-hook:
rm -f $(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-strongswan-service.name
endif

nm-strongswan-service.name: $(srcdir)/nm-strongswan-service.name.in
$(AM_V_GEN) \
sed -e 's|[@]NM_LIBEXECDIR[@]|$(nm_libexecdir)|' \
Expand Down
6 changes: 6 additions & 0 deletions src/frontends/gnome/NEWS
@@ -1,3 +1,9 @@
NetworkManager-strongswan-1.6.0
-------------------------------

- Support for GTK 4
- Removed libnm-glib compatibility

NetworkManager-strongswan-1.5.2
-------------------------------

Expand Down
41 changes: 19 additions & 22 deletions src/frontends/gnome/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)

AC_INIT(NetworkManager-strongswan, 1.5.2, info@strongswan.org, NetworkManager-strongswan)
AC_INIT(NetworkManager-strongswan, 1.6.0, info@strongswan.org, NetworkManager-strongswan)
AM_INIT_AUTOMAKE([subdir-objects])
AM_MAINTAINER_MODE

Expand All @@ -15,6 +15,7 @@ AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)

dnl
dnl Required headers
Expand All @@ -36,6 +37,9 @@ AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(select socket uname)

AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")

GETTEXT_PACKAGE=NetworkManager-strongswan
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
Expand Down Expand Up @@ -67,35 +71,28 @@ AC_ARG_ENABLE(
AS_HELP_STRING([--enable-nm-absolute-paths],[use absolute paths for NM plugins in the .name file])
)
AC_ARG_WITH(
[libnm-glib],
AS_HELP_STRING([--without-libnm-glib], [build NetworkManager-strongswan without libnm-glib compatibility]),
[with_libnm_glib=no],
[with_libnm_glib=yes]
[gtk4],
AS_HELP_STRING([--with-gtk4], [build NetworkManager-strongswan with libnma-gtk4 support]),
[], [with_gtk4=no]
)

AM_CONDITIONAL(WITH_LIBNM_GLIB, test "$with_libnm_glib" != no)
AM_CONDITIONAL(WITH_GTK4, test "$with_gtk4" != no)

PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.0)
LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)

if test x"$with_libnm_glib" != xno; then
PKG_CHECK_MODULES(LIBNM_GLIB, NetworkManager >= 1.1.0 libnm-util libnm-glib libnm-glib-vpn)
PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.1.0)
if test -z "$nm_libexecdir"; then
nm_libexecdir=$($PKG_CONFIG --variable=libgnome_serverdir NetworkManager)
fi
if test -z "$nm_plugindir"; then
nm_plugindir=$($PKG_CONFIG --variable=plugindir NetworkManager)
fi
else
if test -z "$nm_libexecdir"; then
nm_libexecdir=$($PKG_CONFIG --variable=exec_prefix libnm)/lib/NetworkManager
fi
if test -z "$nm_plugindir"; then
nm_plugindir=$($PKG_CONFIG --variable=libdir libnm)/NetworkManager
fi
if test x"$with_gtk4" != xno; then
PKG_CHECK_MODULES(GTK4, gtk4 >= 4.0)
PKG_CHECK_MODULES(LIBNMA_GTK4, libnma-gtk4 >= 1.8.33)
fi

if test -z "$nm_libexecdir"; then
nm_libexecdir=$($PKG_CONFIG --variable=exec_prefix libnm)/lib/NetworkManager
fi
if test -z "$nm_plugindir"; then
nm_plugindir=$($PKG_CONFIG --variable=libdir libnm)/NetworkManager
fi

AC_SUBST(nm_libexecdir)
Expand Down
1 change: 0 additions & 1 deletion src/frontends/gnome/nm-strongswan-service.name.in
Expand Up @@ -8,5 +8,4 @@ plugin=@NM_PLUGINDIR@/libnm-vpn-plugin-strongswan.so

[GNOME]
auth-dialog=@NM_LIBEXECDIR@/nm-strongswan-auth-dialog
properties=@NM_PLUGINDIR_ABS@/libnm-strongswan-properties
supports-external-ui-mode=true
1 change: 1 addition & 0 deletions src/frontends/gnome/po/POTFILES.in
@@ -1,5 +1,6 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
properties/nm-strongswan-plugin.c
properties/nm-strongswan.c
[type: gettext/glade]properties/nm-strongswan-dialog.ui
auth-dialog/main.c
Expand Down
1 change: 1 addition & 0 deletions src/frontends/gnome/po/POTFILES.skip
@@ -0,0 +1 @@
properties/gtk4/nm-strongswan-dialog.ui

0 comments on commit 846201a

Please sign in to comment.