Bug 183935

Summary: [patch] net-p2p/transmission-qt4 and freebsd 10.0 (libc++)
Product: Ports & Packages Reporter: Matthieu Volat <mazhe>
Component: Individual Port(s)Assignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Matthieu Volat 2013-11-13 19:20:00 UTC
Here's a minor problem building transmission-qt4 on FreeBSD 10.0 with the new libc++ library:

c++ -c -O2 -pipe -fno-strict-aliasing -g -pthread -D_THREAD_SAFE -Wall -W -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/share/qt4/mkspecs/freebsd-clang -I. -I/usr/local/include/qt4/QtCore -I/usr/local/include/qt4/QtNetwork -I/usr/local/include/qt4/QtGui -I/usr/local/include/qt4/QtDBus -I/usr/local/include/qt4 -I/include -I.. -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/event2/compat -I. -I. -I/usr/local/include/qt4 -I/usr/local/include -o app.o app.cc
In file included from app.cc:34:
./app.h:40:10: warning: 'MyApp::notify' hides overloaded virtual function [-Woverloaded-virtual]
    bool notify (const QString& title, const QString& body) const;
         ^
/usr/local/include/qt4/QtGui/qapplication.h:289:10: note: hidden overloaded virtual function 'QApplication::notify' declared here: type mismatch at 1st
      parameter ('QObject *' vs 'const QString &')
    bool notify(QObject *, QEvent *);
         ^
1 warning generated.
c++ -c -O2 -pipe -fno-strict-aliasing -g -pthread -D_THREAD_SAFE -Wall -W -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/share/qt4/mkspecs/freebsd-clang -I. -I/usr/local/include/qt4/QtCore -I/usr/local/include/qt4/QtNetwork -I/usr/local/include/qt4/QtGui -I/usr/local/include/qt4/QtDBus -I/usr/local/include/qt4 -I/include -I.. -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/event2/compat -I. -I. -I/usr/local/include/qt4 -I/usr/local/include -o dbus-adaptor.o dbus-adaptor.cc
In file included from dbus-adaptor.cc:14:
./app.h:54:5: error: unknown type name 'time_t'
    time_t myLastFullUpdateTime;
    ^
./app.h:40:10: warning: 'MyApp::notify' hides overloaded virtual function [-Woverloaded-virtual]
    bool notify (const QString& title, const QString& body) const;
         ^
/usr/local/include/qt4/QtGui/qapplication.h:289:10: note: hidden overloaded virtual function 'QApplication::notify' declared here: type mismatch at 1st
      parameter ('QObject *' vs 'const QString &')
    bool notify(QObject *, QEvent *);
         ^
dbus-adaptor.cc:18:5: error: no matching constructor for initialization of 'QDBusAbstractAdaptor'
    QDBusAbstractAdaptor( app ),
    ^                     ~~~
/usr/local/include/qt4/QtDBus/qdbusabstractadaptor.h:57:21: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'MyApp *' to 'const QDBusAbstractAdaptor' for 1st argument
class Q_DBUS_EXPORT QDBusAbstractAdaptor: public QObject
                    ^
/usr/local/include/qt4/QtDBus/qdbusabstractadaptor.h:61:5: note: candidate constructor not viable: no known conversion from 'MyApp *' to 'QObject *' for 1st
      argument
    QDBusAbstractAdaptor(QObject *parent);
    ^
1 warning and 2 errors generated.
gmake[2]: *** [dbus-adaptor.o] Error 1
gmake[2]: Leaving directory `/usr/ports/net-p2p/transmission-qt4/work/transmission-2.82/qt'
*** Error code 2

Stop.

Fix: Simply including <ctime> in qt/app.h solves the problem (patch enclosed).

If paranoid, the patch should be applied depending on the version of the host system, but I think that it is overkill seeing its simplicity :)

Patch attached with submission follows:
How-To-Repeat: On a 10.0-BETA3 system, try to build net-p2p/transmission-qt4
Comment 1 Edwin Groothuis freebsd_committer 2013-11-13 19:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-11-13 19:46:04 UTC
Author: crees
Date: Wed Nov 13 19:45:57 2013
New Revision: 333720
URL: http://svnweb.freebsd.org/changeset/ports/333720

Log:
  Fix -qt4 build on 10.0-BETA3
  
  PR:		ports/183935
  Submitted by:	Matthieu Volat <mazhe@alkumuna.eu>

Added:
  head/net-p2p/transmission-cli/files/patch-qt-app-h   (contents, props changed)
Modified:
  head/net-p2p/transmission-cli/Makefile

Modified: head/net-p2p/transmission-cli/Makefile
==============================================================================
--- head/net-p2p/transmission-cli/Makefile	Wed Nov 13 19:40:51 2013	(r333719)
+++ head/net-p2p/transmission-cli/Makefile	Wed Nov 13 19:45:57 2013	(r333720)
@@ -32,8 +32,8 @@ NO_STAGE=	yes
 LIB_DEPENDS?=	${GEN_LIB_DEPENDS}
 
 # General dependencies
-GEN_LIB_DEPENDS=curl:${PORTSDIR}/ftp/curl \
-		event-2.0.6:${PORTSDIR}/devel/libevent2
+GEN_LIB_DEPENDS=libcurl.so:${PORTSDIR}/ftp/curl \
+		libevent-2.0.so.6:${PORTSDIR}/devel/libevent2
 GEN_RUN_DEPENDS=${LOCALBASE}/share/transmission/web/index.html:${PORTSDIR}/www/transmission-web
 
 # This is master port of transmission-*, so don't override USES definition 

Added: head/net-p2p/transmission-cli/files/patch-qt-app-h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/transmission-cli/files/patch-qt-app-h	Wed Nov 13 19:45:57 2013	(r333720)
@@ -0,0 +1,10 @@
+--- qt/app.h.orig	2013-11-13 20:00:41.000000000 +0100
++++ qt/app.h	2013-11-13 20:00:51.000000000 +0100
+@@ -13,6 +13,7 @@
+ #ifndef QTR_APP_H
+ #define QTR_APP_H
+ 
++#include <ctime>
+ #include <QApplication>
+ #include <QSet>
+ #include <QTimer>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Chris Rees freebsd_committer 2013-11-13 19:46:52 UTC
State Changed
From-To: open->closed

Thanks a lot, I hadn't had time to figure that one out.  Appreciated :)