From eb143fdaf8cd7bcd5edcd26ae36a48170ac48a9e Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Fri, 23 Dec 2016 00:33:29 -0800 Subject: [PATCH] Attempt to patch NetworkManager to use elogind When building this in Guix, we pass options like the following to the ./configure script: --prefix=/gnu/store/vyhr2m9wriv6fgc05x4wjhc6520wlyq3-network-manager-1.4.2 --enable-fast-install --docdir=/gnu/store/daf9ka1wdcafv86sd0aji1pxgw5kv770-network-manager-1.4.2-doc/share/doc/network-manager --build=x86_64-unknown-linux-gnu --with-systemd-logind=yes --with-consolekit=no --with-crypto=gnutls --disable-config-plugin-ibft --sysconfdir=/etc --localstatedir=/var --with-udev-dir=/gnu/store/vyhr2m9wriv6fgc05x4wjhc6520wlyq3-network-manager-1.4.2/lib/udev --with-dbus-sys-dir=/gnu/store/vyhr2m9wriv6fgc05x4wjhc6520wlyq3-network-manager-1.4.2/etc/dbus-1/system.d --with-html-dir=/gnu/store/daf9ka1wdcafv86sd0aji1pxgw5kv770-network-manager-1.4.2-doc/share/gtk-doc/html --with-dhclient=/gnu/store/q55gg423fc04rbx2qchvp2rwamw696na-isc-dhcp-4.3.5/sbin/dhclient --- NetworkManager-1.4.2/configure | 72 +++++++++++++-------------- NetworkManager-1.4.2/src/nm-session-monitor.c | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/NetworkManager-1.4.2/configure b/NetworkManager-1.4.2/configure index 013461f..b9b6cf8 100755 --- a/NetworkManager-1.4.2/configure +++ b/NetworkManager-1.4.2/configure @@ -22903,12 +22903,12 @@ if test -n "$SYSTEMD_LOGIN_CFLAGS"; then pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libelogind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22920,12 +22920,12 @@ if test -n "$SYSTEMD_LOGIN_LIBS"; then pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libelogind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22946,9 +22946,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind" 2>&1` else - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 @@ -22977,12 +22977,12 @@ if test -n "$SYSTEMD_LOGIN_CFLAGS"; then pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libelogind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22994,12 +22994,12 @@ if test -n "$SYSTEMD_LOGIN_LIBS"; then pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libelogind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23020,9 +23020,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind" 2>&1` else - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 @@ -23085,8 +23085,8 @@ if test "z$with_suspend_resume" = "z"; then have_systemd_inhibit=yes else if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then @@ -23184,12 +23184,12 @@ if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libelogind >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23201,12 +23201,12 @@ if test -n "$SYSTEMD_INHIBIT_LIBS"; then pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libelogind >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23227,14 +23227,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind >= 183" 2>&1` else - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind >= 183" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: + as_fn_error $? "Package requirements (libelogind >= 183) were not met: $SYSTEMD_INHIBIT_PKG_ERRORS @@ -23278,12 +23278,12 @@ if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libelogind >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23295,12 +23295,12 @@ if test -n "$SYSTEMD_INHIBIT_LIBS"; then pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libelogind >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23321,14 +23321,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind >= 183" 2>&1` else - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind >= 183" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: + as_fn_error $? "Package requirements (libelogind >= 183) were not met: $SYSTEMD_INHIBIT_PKG_ERRORS diff --git a/NetworkManager-1.4.2/src/nm-session-monitor.c b/NetworkManager-1.4.2/src/nm-session-monitor.c index 279a888..f4c647a 100644 --- a/NetworkManager-1.4.2/src/nm-session-monitor.c +++ b/NetworkManager-1.4.2/src/nm-session-monitor.c @@ -30,7 +30,7 @@ #include "NetworkManagerUtils.h" #ifdef SESSION_TRACKING_SYSTEMD -#include +#include #endif /********************************************************************/ -- 2.11.0