[avahi] avahi Digest, Vol 124, Issue 1

Jonathan Bagg jbagg at lenbrook.com
Wed Oct 14 09:58:25 PDT 2015


On 15-10-14 11:09 AM, Jonathan Bagg wrote:
> On 15-10-14 05:52 AM, Trent Lloyd wrote:
>>
>>> On 11 Oct 2015, at 4:48 AM, Michael Jones <avahi at jonesmz.com> wrote:
>>>
>>>
>>>     Trent
>>>
>>>     I had a look at avahi-qt in 0.6.32-rc and it looks like there is
>>>     still no QT5 support.  I found this patch for QT5 support...
>>>
>>>     http://lists.freedesktop.org/archives/avahi/2014-October/002305.html
>>>
>>>     If I pass an AvahiPoll from avahi_qt_poll_get() to
>>>     avahi_client_new() the program will segfault with Qt5 (Qt4 works
>>>     fine).  I have a Qt class that wraps avahi-client.  In order to
>>>     get it to work with Qt5, I need to distribute a modified avahi-qt.
>>>
>>>     Jon
>>>
>>>
>>>
>>> I'm the author of that Qt 5 patch.
>>>
>>> I'd be happy to lend assistance to getting it integrated into an 
>>> upcoming Avahi release. I wasn't able to post it to the avahi bug 
>>> tracker, since the Trac instance wasn't accepting new registrations 
>>> for quite a while.
>>>
>>> Saying this without looking at the full changelist for Avahi, I'd 
>>> say that it's pretty likely to apply cleanly to the new version. It 
>>> was minimally invasive.
>>>
>>> Please contact me if assistance is desired.
>>
>> It does apply fine, had to make a slight tweak to set -fPIC.
>>
>> Is there a project somewhere that compiles against this? In any case 
>> I think we should make an example/test app as we don’t have one at 
>> all for QT right now.
>>
>> Converted into pull request here:
>> https://github.com/lathiat/avahi/pull/19
> I pulled this and tried compiling avahi
>
> ./configure --disable-qt3 --disable-gtk --disable-gtk3 --disable-mono 
> --disable-manpages --disable-glib --disable-gobject
> make
>
> make[2]: *** No rule to make target `avahi-qt5.pc', needed by 
> `all-am'.  Stop.
avahi-qt5.pc.in was missing.  It is in the original Qt5 patch. Perhaps 
it was not added to the commit.

My Qt project compiles and works against this avahi with Qt5 support 
with both Qt4 and Qt5.  Great, Thanks!

My Qt project's header modification
#if QT_VERSION >= 0x050000
#include <avahi-qt5/qt-watch.h>
#else
#include <avahi-qt4/qt-watch.h>
#endif

My Qt project's .pro file modification
lessThan(QT_MAJOR_VERSION, 5) {
     LIBS+= -lavahi-client -lavahi-common -lavahi-qt4
}
equals(QT_MAJOR_VERSION, 5) {
     LIBS+= -lavahi-client -lavahi-common -lavahi-qt5
}

-- 
Jonathan Bagg
Embedded Systems Developer
NAD Electronics | Lenbrook Industries Limited
633 Granite Court, Pickering, Ontario, Canada L1W 3K1 | 905-831-0799 ext 4478 | http://www.nadelectronics.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20151014/b165a333/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avahi-qt-pc.in-for-Qt5-was-missing.patch
Type: text/x-patch
Size: 769 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20151014/b165a333/attachment-0001.bin>


More information about the avahi mailing list