Created attachment 440102 [details] emerge --info networkmanager-openvpn fails to build In file included from nm-default.h:41:0, from nm-shared-utils.c:22: nm-glib.h:24:21: fatal error: gio/gio.h: No such file or directory compilation terminated. make[2]: *** [Makefile:481: libnm_openvpn_shared_la-nm-shared-utils.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from nm-default.h:41:0, from utils.c:27: nm-glib.h:24:21: fatal error: gio/gio.h: No such file or directory compilation terminated. make[2]: *** [Makefile:488: libnm_openvpn_shared_la-utils.lo] Error 1 make[2]: Leaving directory '/var/tmp/portage/net-misc/networkmanager-openvpn-1.2.2/work/NetworkManager-openvpn-1.2.2/shared' make[1]: *** [Makefile:563: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/net-misc/networkmanager-openvpn-1.2.2/work/NetworkManager-openvpn-1.2.2' make: *** [Makefile:432: all] Error 2
Created attachment 440104 [details] build.log
Don't you have /usr/include/glib-2.0/gio/gio.h in your system?
Same error here. I do have /usr/include/glib-2.0/gio/gio.h on my system, but compiling with MAKEOPTS="-j1" shows that the error comes from the following call where the appropriate include directive is missing: libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DNM_OPENVPN_OLD -I../shared -O2 -march=native -pipe -c nm-shared-utils.c -fPIC -DPIC -o .libs/libnm_openvpn_shared_la-nm-shared-utils.o In file included from nm-default.h:41:0, from nm-shared-utils.c:22: nm-glib.h:24:21: fatal error: gio/gio.h: No such file or directory
In my system exixst file /usr/include/glib-2.0/gio/gio.h but built failed with from utils.c:27: nm-glib.h:24:21: fatal error: gio/gio.h: No such file or directory #include <gio/gio.h> ^
I can build with: CFLAGS="-march=native -pipe -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libnm -I/usr/include/libnm-glib" emerge -av1 net-misc/networkmanager-openvpn
(In reply to Egor Y. Egorov from comment #5) > I can build with: ... Thanks Egor, was wracking my brains over this one!"!! I'm using: echo 'CFLAGS="${CFLAGS} -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libnm -I/usr/include/libnm-glib"' >/etc/portage/env/net-misc/networkmanager-openvpn Builds and install fine now!!
Is anyone working on this or was networkmanager-openvpn abandoned and needs to go to maintainer-needed@g.o?
The package is maintained, but the problem is that something is different in your systems as we cannot reproduce this build issue
Quick guess: Does this file look the same on your system? ``` # cat /usr/lib64/pkgconfig/gio-2.0.pc prefix=/usr exec_prefix=${prefix} libdir=/usr/lib64 includedir=${prefix}/include giomoduledir=${libdir}/gio/modules glib_compile_schemas=glib-compile-schemas glib_compile_resources=glib-compile-resources gdbus_codegen=gdbus-codegen Name: GIO Description: glib I/O library Version: 2.48.1 Requires: glib-2.0 gobject-2.0 Requires.private: gmodule-no-export-2.0 Libs: -L${libdir} -lgio-2.0 Libs.private: -lz -lresolv Cflags: # q file -v /usr/lib64/pkgconfig/gio-2.0.pc dev-libs/glib-2.48.1 (/usr/lib64/pkgconfig/gio-2.0.pc) ```
(In reply to Dennis Schridde from comment #9) > Quick guess: Does this file look the same on your system? > ``` > # cat /usr/lib64/pkgconfig/gio-2.0.pc > prefix=/usr > exec_prefix=${prefix} > libdir=/usr/lib64 > includedir=${prefix}/include > > giomoduledir=${libdir}/gio/modules > glib_compile_schemas=glib-compile-schemas > glib_compile_resources=glib-compile-resources > gdbus_codegen=gdbus-codegen > > Name: GIO > Description: glib I/O library > Version: 2.48.1 > Requires: glib-2.0 gobject-2.0 > Requires.private: gmodule-no-export-2.0 > Libs: -L${libdir} -lgio-2.0 > Libs.private: -lz -lresolv > Cflags: > # q file -v /usr/lib64/pkgconfig/gio-2.0.pc > dev-libs/glib-2.48.1 (/usr/lib64/pkgconfig/gio-2.0.pc) > ``` ``` # q list -e glib | grep gio/gio.h\$ /usr/include/glib-2.0/gio/gio.h # cat file -v /usr/lib64/pkgconfig/glib-2.0.pc prefix=/usr exec_prefix=${prefix} libdir=/usr/lib64 includedir=${prefix}/include glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums Name: GLib Description: C Utility Library Version: 2.48.1 Requires.private: libpcre Libs: -L${libdir} -lglib-2.0 Libs.private: -pthread -lpcre Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include ``` Guessing further: NetworkManager uses `pkg-config --cflags gio-2.0`, but not `pkg-config --cflags glib-2.0` and thus misses to add the /usr/include/glib-2.0 directory to the include path.
(In reply to Dennis Schridde from comment #9) > Quick guess: Does this file look the same on your system? It does for me, yes. (In reply to Dennis Schridde from comment #10) Same for glib-2.0.pc.
AFAIR "Requires" keyword instruct pkg-config to include corresponding packages flags to output. So when one request cflags for gio-2.0 pkg-config should also include cflags for glib-2.0 and gobject-2.0. On my system "pkg-config --cflags gio-2.0" outputs "-pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include". Still I can't compile networkmanager-openvpn without env hack. Another observation. If we will take a look into build.log (especially with -j1) we can found that at the beginning cflags added as expected: libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -pthread -I/usr/include/libnm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2 -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2 -I../shared -O2 -pipe -march=ivybridge -c utils.c -fPIC -DPIC -o .libs/libnm_vpn_plugin_openvpn_shared_la-utils.o but then cflags suddenly disappear (and looks like always on libnm_openvpn_shared_la-utils.o compilation): libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DNM_OPENVPN_OLD -I../shared -O2 -pipe -march=ivybridge -c utils.c -fPIC -DPIC -o .libs/libnm_openvpn_shared_la-utils.o
This issue is fixed in net-misc/networkmanager-openvpn-1.2.4. Please adjust the summary of this bug accordingly: "net-misc/networkmanager-openvpn-1.2.2 fails to build: ..."
Created attachment 443144 [details, diff] networkmanager-openvpn-1.2.4-fix-undefined-reference-to-dlclose.patch There is another bug related to underlinking the test binaries (libdl.so is not linked against). Attached patch fixes this. Issue was reported upstream. See-Also: https://bugzilla.gnome.org/show_bug.cgi?id=769783
(In reply to Dennis Schridde from comment #14) > Created attachment 443144 [details, diff] [details, diff] > networkmanager-openvpn-1.2.4-fix-undefined-reference-to-dlclose.patch > > There is another bug related to underlinking the test binaries (libdl.so is > not linked against). Attached patch fixes this. Issue was reported upstream. > > See-Also: https://bugzilla.gnome.org/show_bug.cgi?id=769783 This patch requires one to run eautoreconf in src_prepare(), as it modifies configure.ac.
Created attachment 443164 [details, diff] networkmanager-openvpn-1.2.4-fix-undefined-reference-to-dlclose.patch Patch fixing the underlying issue of the linking error. For a build.log please see https://bugzilla.gnome.org/show_bug.cgi?id=769783
Created attachment 443464 [details, diff] networkmanager-openvpn-1.2.4-fix-undefined-reference-to-dlclose.patch This is upstream's patch (220b38717f8d0fc16c8b9d68cfd6e5b5751e4669 [1] + 8d76aebe99b1b9c67adab4922c0c33edb1f89b7f [2]), which applies to 1.2.4 and fixes the issue. [1]: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=220b38717f8d0fc16c8b9d68cfd6e5b5751e4669 [2]: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=8d76aebe99b1b9c67adab4922c0c33edb1f89b7f
For me this bug emerges when I add "-gtk" USE flag. With gtk enabled it's building okay.
Just pushed 1.2.4 to tree with upstream patches. Thanks for reporting.