Undeclared dependency on gio-unix-2.0

Bug #1784622 reported by Jan Tojnar on 2018-07-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Audio Recorder
Undecided
Unassigned

Bug Description

I am building audio-recorder 2.1.3 on NixOS and getting the following error:

```
dbus-player.c:22:10: fatal error: gio/gdesktopappinfo.h: No such file or directory
 #include <gio/gdesktopappinfo.h>
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:463: dbus-player.o] Error 1
make[1]: Leaving directory '/build/trunk/src'
make: *** [Makefile:439: all-recursive] Error 1
```

Downstream issue: https://github.com/NixOS/nixpkgs/issues/36468

Jan Tojnar (jtojnar) on 2018-07-31
description: updated
moma (osmoma) wrote :

Hello,

I saw on the internet some similar bug-reports related to "gio-unix-2.0" library.
Can you check

$ pkg-config --cflags gio-unix-2.0

gio-unix-2.0 is part of libglib2.0-dev package.
Ref: https://packages.debian.org/search?suite=stretch&arch=any&searchon=contents&keywords=gio-unix-2.0.pc

Have you installed "libglib2.0-dev"?.

//Moma

Jan Tojnar (jtojnar) wrote :

Running `pkg-config --cflags gio-unix-2.0` in the package prints the following:

-I/nix/store/l1v16k68v3njjw281fbfk20zxsb52q35-glib-2.56.0-dev/include/gio-unix-2.0/ -I/nix/store/l1v16k68v3njjw281fbfk20zxsb52q35-glib-2.56.0-dev/include/glib-2.0 -I/nix/store/ycpkd4jxpy913v6fxf4b5mmy9bz81vsy-glib-2.56.0/lib/glib-2.0/include

I think the issue is that the gio-unix-2.0 cflags are not passed to the dbus-player.c file.

Hello,
Yes, I may agree with you.

Looks like some systems prefer gio-unix-2.0 instead of gio-2.0.
F.eks some pure Unix systems: https://developer.gnome.org/
gio/stable/ch03.html

NixOS is a Linux-distro, but the packaging and package system is different
from Debian or Fedora.

You should study two (2) options.

Option 1)
Include the glib-unix.h in the dbus-player.h or .c file.

The re-compile.

Ref:
https://developer.gnome.org/glib/stable/glib-UNIX-specific-utilities-and-integration.html

----

Option 2)
Try this.
Would you please edit the "configure.ac" and add gio-unix-2.0 to it.

Check you library version with
pkg-config --modversion gio-unix-2.0

The lines may look like this:

PKG_CHECK_MODULES(GLIB_UNIX, glib-unix-2.0 >= 2.0)
AC_SUBST(GLIB_UNIX_CFLAGS)
AC_SUBST(GLIB_UNIX_LIBS)

--------------------------------

The reset and re-configure the source:

cd audio-recorder*
make clean

aclocal
autoconf
automake -a

Or as one-liner:
aclocal && autoconf && automake -a

You may also run:
autoreconf -i
-------------

These commands will configure, build/compile, and install the program:

cd audio-recorder*
./configure
make clean
make

sudo make install # run this as root or sudo! AT LEAST ONCE.
-------------

Notice: KILL or QUIT previous instances of the program !
pkill audio-recorder

Then re-run the program
src/audio-recorder
--------------

Good luck.

Osmo (Moma) Antero
  Portugal

2018-07-31 15:06 GMT+01:00 Jan Tojnar <email address hidden>:

> Running `pkg-config --cflags gio-unix-2.0` in the package prints the
> following:
>
> -I/nix/store/l1v16k68v3njjw281fbfk20zxsb52q35-glib-2.56.0-dev/include
> /gio-unix-2.0/
> -I/nix/store/l1v16k68v3njjw281fbfk20zxsb52q35-glib-2.56.0-dev/include/
> glib-2.0
> -I/nix/store/ycpkd4jxpy913v6fxf4b5mmy9bz81vsy-
> glib-2.56.0/lib/glib-2.0/include
>
> I think the issue is that the gio-unix-2.0 cflags are not passed to the
> dbus-player.c file.
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https://bugs.launchpad.net/bugs/1784622
>
> Title:
> Undeclared dependency on gio-unix-2.0
>
> Status in Audio Recorder:
> New
>
> Bug description:
> I am building audio-recorder 2.1.3 on NixOS and getting the following
> error:
>
> ```
> dbus-player.c:22:10: fatal error: gio/gdesktopappinfo.h: No such file or
> directory
> #include <gio/gdesktopappinfo.h>
> ^~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [Makefile:463: dbus-player.o] Error 1
> make[1]: Leaving directory '/build/trunk/src'
> make: *** [Makefile:439: all-recursive] Error 1
> ```
>
> Downstream issue: https://github.com/NixOS/nixpkgs/issues/36468
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/audio-recorder/+bug/1784622/+subscriptions
>

--
Sent from my PC, laptop or phone with Ubuntu-Linux.

moma (osmoma) wrote :

I can later add necessary changes to the source on Launchpad.

Jan Tojnar (jtojnar) wrote :

> Looks like some systems prefer gio-unix-2.0 instead of gio-2.0.

It is not that some systems prefer it, but that some software requires it. For example, audio-recorder requires gio/gdesktopappinfo.h header, which is provided by gio-unix-2.0.

Apparently it works on some systems without explicitly declaring the dependency because GTK sometimes adds `-I.../include/gio-unix-2.0` to Cflags but that should not be relied on.

Regarding the options, 1) would not work since glib-unix.h header from glib-2.0 package is completely different thing from gio-unix-2.0 package. 2) is closer, it would need to be changed to correct package name (gio-unix instead of glib-unix) and the variables would need to be added to the correct Makefile.in files.

moma (osmoma) wrote :

Ok, I thought that Unix version of glib bundles all gio, glib, gthread, ..

May I ask if the solution is to subtitute gio-2.0 with gio-unix-2.0 in the
configure.ac ?

PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

with

PKG_CHECK_MODULES(GIO, gio-unix-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

Then run the mantra to re-configure and compile/link.

Moma
Portugal

2018-07-31 20:50 GMT+01:00 Jan Tojnar <email address hidden>:

> > Looks like some systems prefer gio-unix-2.0 instead of gio-2.0.
>
> It is not that some systems prefer it, but that some software requires
> it. For example, audio-recorder requires gio/gdesktopappinfo.h header,
> which is provided by gio-unix-2.0.
>
> Apparently it works on some systems without explicitly declaring the
> dependency because GTK sometimes adds `-I.../include/gio-unix-2.0` to
> Cflags but that should not be relied on.
>
> Regarding the options, 1) would not work since glib-unix.h header from
> glib-2.0 package is completely different thing from gio-unix-2.0
> package. 2) is closer, it would need to be changed to correct package
> name (gio-unix instead of glib-unix) and the variables would need to be
> added to the correct Makefile.in files.
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https://bugs.launchpad.net/bugs/1784622
>
> Title:
> Undeclared dependency on gio-unix-2.0
>
> Status in Audio Recorder:
> New
>
> Bug description:
> I am building audio-recorder 2.1.3 on NixOS and getting the following
> error:
>
> ```
> dbus-player.c:22:10: fatal error: gio/gdesktopappinfo.h: No such file or
> directory
> #include <gio/gdesktopappinfo.h>
> ^~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [Makefile:463: dbus-player.o] Error 1
> make[1]: Leaving directory '/build/trunk/src'
> make: *** [Makefile:439: all-recursive] Error 1
> ```
>
> Downstream issue: https://github.com/NixOS/nixpkgs/issues/36468
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/audio-recorder/+bug/1784622/+subscriptions
>

--
Sent from my PC, laptop or phone with Ubuntu-Linux.

Jan Tojnar (jtojnar) wrote :

Yes, glib package on linux distributions often bundles all the libraries listed, but each library has its own pkg-config module with its set of own compiler flags.

As gio-unix-2.0 is a distinct module, it should be used where needed in addition to gio-2.0. It is needed whenever using one of the following headers:

gio
├── gdesktopappinfo.h
├── gfiledescriptorbased.h
├── gunixconnection.h
├── gunixcredentialsmessage.h
├── gunixfdlist.h
├── gunixfdmessage.h
├── gunixinputstream.h
├── gunixmounts.h
├── gunixoutputstream.h
└── gunixsocketaddress.h

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.