Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394125 - net-dns/avahi - python bindings are not installed properly
Summary: net-dns/avahi - python bindings are not installed properly
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Wegener
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 11:18 UTC by Antoine Martin
Modified: 2012-01-19 10:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Martin 2011-12-09 11:18:57 UTC
Reproducible: Always

Steps to Reproduce:
1. emerge --sync
2. USE="python" emerge avahi
Actual Results:  
# python -c "import avahi"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named avahi


The __init__.py[c] file is missing:
ls /usr/lib/python2.7/site-packages/avahi
ServiceTypeDatabase.py
ServiceTypeDatabase.pyc
ServiceTypeDatabase.pyo


Expected Results:  
Here is a usable python bindings installation with an __init__.py[c] file, taken from a Fedora box:

$ ls  /usr/lib/python2.7/site-packages/avahi/
__init__.py
__init__.pyc
__init__.pyo
ServiceTypeDatabase.py
ServiceTypeDatabase.pyc
ServiceTypeDatabase.pyo
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2011-12-12 12:16:19 UTC
hmm;

gentoo64 avahi # ebuild avahi-0.6.30-r1.ebuild merge

gentoo64 avahi # ls /usr/lib64/python2.7/site-packages/avahi/
__init__.py  __init__.pyc  __init__.pyo  ServiceTypeDatabase.py  ServiceTypeDatabase.pyc  ServiceTypeDatabase.pyo

Can't replicate
Comment 2 Antoine Martin 2011-12-12 13:54:45 UTC
Found the cause, a warning I didn't notice:
"For proper python support you should also enable the dbus and gtk USE flags!"
(..)
"Building avahi-python:              no   (You need python, pygtk and python-dbus!)"

So, the "python" use flag does not get honoured unless some other flags are also set!
Shouldn't this fire a use flag conflict error instead of not building what is expected by the user?
Also, I don't understand the dependency on gtk since pytho-avahi uses the glib/dbus bindings and not pygtk.
(in a server environment, one may well want to use an application with avahi bindings without requiring X11 dependencies which pygtk brings...)
Comment 3 Antoine Martin 2011-12-12 14:04:51 UTC
Further investigation shows that there are zero dependencies on pygtk for the python bindings. It only relies on python dbus, and dbus only needs glib.

avahi-discover (which is built as part of "avahi") does require pygtk, but that's an application which should just be skipped when building bindings without pygtk.
Comment 4 Ulenrich 2011-12-28 13:45:22 UTC
avahi -python is compiling, this was installed days before, but USE=python doesn't go through today:

libtool: install: warning: relinking `libdns_sd.la'
libtool: install: (cd /portable/temp/portage/net-dns/avahi-0.6.30-r2/work/avahi-0.6.30/avahi-compat-libdns_sd; /bin/sh /portable/temp/portage/net-dns/avahi-0.6.30-r2/work/avahi-0.6.30/libtool  --silent --tag CC --mode=relink x86_64-pc-linux-gnu-gcc -std=gnu99 -I.. "-DDEBUG_TRAP=__asm__(\"int \$3\")" -pthread -march=native -mtune=native -O3 -pipe -Wno-unused-but-set-variable -Wno-unused-variable -fstack-protector -std=c99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing -version-info 1:0:0 -pthread ../avahi-common/libavahi-common.la ../avahi-client/libavahi-client.la -Wl,-O1 -Wl,--as-needed -o libdns_sd.la -rpath /usr/lib64 libdns_sd_la-compat.lo libdns_sd_la-txt.lo libdns_sd_la-unsupported.lo libdns_sd_la-warn.lo -inst-prefix-dir /portable/temp/portage/net-dns/avahi-0.6.30-r2/image/)
libtool: install: /usr/bin/install -c .libs/libdns_sd.so.1.0.0T /portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/lib64/libdns_sd.so.1.0.0
libtool: install: (cd /portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/lib64 && { ln -s -f libdns_sd.so.1.0.0 libdns_sd.so.1 || { rm -f libdns_sd.so.1 && ln -s libdns_sd.so.1.0.0 libdns_sd.so.1; }; })
libtool: install: (cd /portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/lib64 && { ln -s -f libdns_sd.so.1.0.0 libdns_sd.so || { rm -f libdns_sd.so && ln -s libdns_sd.so.1.0.0 libdns_sd.so; }; })
libtool: install: /usr/bin/install -c .libs/libdns_sd.lai /portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/lib64/libdns_sd.la
libtool: install: warning: remember to run `libtool --finish /usr/lib64'
 /usr/bin/install -c -m 644 dns_sd.h '/portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/include/avahi-compat-libdns_sd'
Making install in avahi-compat-howl
Making install in .
Making install in samples
Making install in avahi-autoipd
Making install in avahi-ui
Making install in avahi-ui-sharp
Making install in po
installing de.gmo as /portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/share/locale/de/LC_MESSAGES/avahi.mo
 /usr/bin/install -c -m 644 avahi-core.pc avahi-client.pc avahi-compat-libdns_sd.pc avahi-glib.pc avahi-gobject.pc avahi-qt4.pc '/portable/temp/portage/net-dns/avahi-0.6.30-r2/image//usr/lib64/pkgconfig'
 * ERROR: net-dns/avahi-0.6.30-r2 failed (install phase):
 *   python_convert_shebangs(): '/portable/temp/portage/net-dns/avahi-0.6.30-r2/image/usr/bin/avahi-discover' does not exist
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called src_install
 *   environment, line 5803:  Called python_convert_shebangs '2' '/portable/temp/portage/net-dns/avahi-0.6.30-r2/image/usr/bin/avahi-discover'
 *   environment, line 3756:  Called die
 * The specific snippet of code:
 *               die "${FUNCNAME}(): '${argument}' does not exist";
 * 
 * If you need support, post the output of 'emerge --info =net-dns/avahi-0.6.30-r2',
 * the complete build log and the output of 'emerge -pqv =net-dns/avahi-0.6.30-r2'.
 * The complete build log is located at '/var/log/portage/net-dns:avahi-0.6.30-r2:20111228-132615.log'.
 * The ebuild environment file is located at '/portable/temp/portage/net-dns/avahi-0.6.30-r2/temp/environment'.
 * S: '/portable/temp/portage/net-dns/avahi-0.6.30-r2/work/avahi-0.6.30'

>>> Failed to emerge net-dns/avahi-0.6.30-r2, Log file:
Comment 5 Ulenrich 2011-12-28 19:26:24 UTC
These USE flags work:
net-dns/avahi-0.6.30-r2  USE="dbus gdbm gtk ipv6 mdnsresponder-compat python qt4 utils -autoipd -bookmarks -doc -gtk3 -howl-compat -introspection -mono -test"

Before - not compiling - I had:
-utils -ipv6 -gtk
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2012-01-16 16:44:00 UTC
The ebuild already has a ewarn for this in pkg_setup() function:

if use python && ! use dbus && ! use gtk; then
  ewarn "For proper python support you should also enable the dbus and gtk USE flags!"
fi

I can see this being converted into a REQUIRED_USE when the ebuild is updated to EAPI=4 but there really is nothing wrong with it as-is.
Comment 7 Antoine Martin 2012-01-17 10:59:18 UTC
Sorry if I did not make this clear, but there is still something wrong: as it is, it is impossible to install the avahi python bindings using the ebuild without installing gtk and all its dependencies despite the fact that those are totally unrelated, and more importantly: not at all required for using the bindings.

Most other distros solve this issue by providing separate avahi-ui, avahi-ui-gtk etc (see Fedora and Debian for example). So, Gentoo should solve this by not building the gtk ui bits rather than installing a broken/unusable python package in that case. Whether this then becomes a glib use flag or something else is not for me to decide.

Think of this as building: USE="-X" openssh
If people were forced to have to USE="X" to get a working sshd... it would get fixed pretty quickly!
Comment 8 Antoine Martin 2012-01-18 17:18:49 UTC
Can you re-open this ticket (renaming title if desired), or shall I create a new one?
Comment 9 Antoine Martin 2012-01-19 10:49:34 UTC
Since I got no response, I created a new ticket with more specific information:
https://bugs.gentoo.org/show_bug.cgi?id=399369