Subject: Re: bug#18695: Qt fails to build from source

From: [email-masked] (Ludovic Courtès)
Date: Sun, 12 Oct 2014 23:30:46 +0200

Mark H Weaver <[email-masked]> skribis:

> Somewhere between 74c7af9 and 7239828, all of the Qt builds broke.
> See:
>
>    http://hydra.gnu.org/eval/100809#tabs-now-fail

Looking at <http://hydra.gnu.org/build/120993>, the error is:

--8<---------------cut here---------------start------------->8---
g++ -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/gnu/store/icmr1hzi8r72h18n030902x6816myy11-qt-5.2.1/lib -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5Network.so.5 -o libQt5Network.so.5.2.1 .obj/qftp.o .obj/qhttpnetworkheader.o .obj/qhttpnetworkrequest.o .obj/qhttpnetworkreply.o .obj/qhttpnetworkconnection.o .obj/qhttpnetworkconnectionchannel.o .obj/qnetworkaccessauthenticationmanager.o .obj/qnetworkaccessmanager.o .obj/qnetworkaccesscache.o .obj/qnetworkaccessbackend.o .obj/qnetworkaccessdebugpipebackend.o .obj/qnetworkaccessfilebackend.o .obj/qnetworkaccesscachebackend.o .obj/qnetworkaccessftpbackend.o .obj/qnetworkcookie.o .obj/qnetworkcookiejar.o .obj/qnetworkrequest.o .obj/qnetworkreply.o .obj/qnetworkreplyimpl.o .obj/qnetworkreplydataimpl.o .obj/qnetworkreplyhttpimpl.o .obj/qnetworkreplyfileimpl.o .obj/qabstractnetworkcache.o .obj/qnetworkdiskcache.o .obj/qhttpthreaddelegate.o .obj/qhttpmultipart.o .obj/qnetworksession.o .obj/qnetworkconfigmanager.o .obj/qnetworkconfiguration.o .obj/qnetworkconfigmanager_p.o .obj/qbearerengine.o .obj/qbearerplugin.o .obj/qsharednetworksession.o .obj/qauthenticator.o .obj/qdnslookup.o .obj/qhostaddress.o .obj/qhostinfo.o .obj/qurlinfo.o .obj/qnetworkproxy.o .obj/qnetworkinterface.o .obj/qdnslookup_unix.o .obj/qhostinfo_unix.o .obj/qnetworkinterface_unix.o .obj/qnetworkproxy_generic.o .obj/qabstractsocketengine.o .obj/qhttpsocketengine.o .obj/qsocks5socketengine.o .obj/qabstractsocket.o .obj/qtcpsocket.o .obj/qudpsocket.o .obj/qtcpserver.o .obj/qlocalsocket.o .obj/qlocalserver.o .obj/qnativesocketengine.o .obj/qnativesocketengine_unix.o .obj/qlocalsocket_unix.o .obj/qlocalserver_unix.o .obj/qssl.o .obj/qsslcertificate.o .obj/qsslconfiguration.o .obj/qsslcipher.o .obj/qsslerror.o .obj/qsslkey.o .obj/qsslsocket.o .obj/qsslsocket_openssl.o .obj/qsslsocket_openssl_symbols.o .obj/qsslcertificateextension.o .obj/qsslcontext.o .obj/moc_qhttpnetworkreply_p.o .obj/moc_qnetworkaccesscache_p.o .obj/moc_qnetworkaccessbackend_p.o .obj/moc_qnetworkaccessdebugpipebackend_p.o .obj/moc_qnetworkaccessfilebackend_p.o .obj/moc_qnetworkaccessftpbackend_p.o .obj/moc_qnetworkcookiejar.o .obj/moc_qnetworkreply.o .obj/moc_qnetworkreplyhttpimpl_p.o .obj/moc_qabstractnetworkcache.o .obj/moc_qnetworkdiskcache.o .obj/moc_qhttpthreaddelegate_p.o .obj/moc_qhttpmultipart.o .obj/moc_qnetworkconfigmanager_p.o .obj/moc_qnetworksession_p.o .obj/moc_qbearerplugin_p.o .obj/moc_qdnslookup_p.o .obj/moc_qhostinfo_p.o .obj/moc_qabstractsocketengine_p.o .obj/moc_qhttpsocketengine_p.o .obj/moc_qsocks5socketengine_p.o .obj/moc_qtcpsocket.o .obj/moc_qudpsocket.o .obj/moc_qnativesocketengine_p.o .obj/moc_qsslsocket_openssl_p.o  -L/tmp/nix-build-qt-5.2.1.drv-0/qt-everywhere-opensource-src-5.2.1/qtbase/lib -lQt5Core -lpthread -lz 
ld: warning: libicudata.so.53, needed by /gnu/store/bhpsqb4p910r2qfcwnkdnw90a2p5003d-icu4c-53.1/lib/libicui18n.so.53, not found (try using -rpath or -rpath-link)
/gnu/store/bhpsqb4p910r2qfcwnkdnw90a2p5003d-icu4c-53.1/lib/libicuuc.so.53: undefined reference to `icudt53_dat'
collect2: error: ld returned 1 exit status
Makefile:234: recipe for target '../../../bin/qdoc' failed
--8<---------------cut here---------------end--------------->8---

I think this is due to a thinko I overlooked during the review; I’m
testing this patch and will commit if it solves the problem:

diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 7eb3874..e7d5247 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -68,10 +68,10 @@
         (lambda* (#:key outputs #:allow-other-keys)
           (let* ((out (assoc-ref outputs "out"))
                  (lib (string-append out "/lib")))
-            ;; Add LIB to the RUNPATH of all the binaries.
+            ;; Add LIB to the RUNPATH of all the libraries and binaries.
             (with-directory-excursion out
               (for-each (cut augment-rpath <> lib)
-                        (append
+                        (append (find-files "lib" ".*")
                                 (find-files "bin" ".*")
                                 (find-files "sbin" ".*"))))))
         %standard-phases)))))

Thanks,
Ludo’.