From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: QT install and search paths Date: Sun, 03 Sep 2017 12:58:04 +0800 Message-ID: <878thwbcpv.fsf@member.fsf.org> References: <42cac0e9-d948-3ea1-7312-d003751fd6a8@crazy-compilers.com> <874lsxi3bx.fsf@member.fsf.org> <4a1d7083-eb0a-9c79-fd54-686b822da5ed@crazy-compilers.com> <87378fkeho.fsf@member.fsf.org> <87o9r3iqh7.fsf@member.fsf.org> <0f97b74f-282d-9996-aa61-d3084e164b09@crazy-compilers.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1doMzG-0003vl-My for guix-devel@gnu.org; Sun, 03 Sep 2017 00:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doMzB-00066M-7Y for guix-devel@gnu.org; Sun, 03 Sep 2017 00:58:22 -0400 Received: from rezeros.cc ([2001:19f0:7001:2f3e:5400:ff:fe84:e55d]:40514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1doMzA-00060d-LQ for guix-devel@gnu.org; Sun, 03 Sep 2017 00:58:17 -0400 In-Reply-To: <0f97b74f-282d-9996-aa61-d3084e164b09@crazy-compilers.com> (Hartmut Goebel's message of "Sat, 2 Sep 2017 18:40:44 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel , Thomas Danckaert --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hartmut Goebel writes: > Am 27.08.2017 um 18:49 schrieb Hartmut Goebel: > > It is searched in several sub-directories of /tmp/guix-build-=E2=80=A6/q= twayland-opensource-src-5.9.1/plugins/platforms/../../../ (which is the > /tmp/guix-build-qtwayland-5.9.1.drv-0 directory), but not in =E2=80=A6/l= ib. I did not find out how to > > Uff, I tracked this down in a heavy thinking session. > > * This search-path stems from the libraries RUNPATH, which was $ORIGIN/..= /../lib and is now only $ORIGIN/../../../ > > * The RUNPATH is set in /gnu/store/=E2=80=A6-qtbase-5.9.1/lib/qt5/mkspecs= /features/qt.prf line 272, using the relative path from $$qtRelativeRPathBa= se (which equals > $target.path, which is /gnu/store/=E2=80=A6-qtbase-5.9.1/lib/qt5/plugins= /platforms) to $QT_INSTALL_LIBS (which is /gnu/store/=E2=80=A6-qtbase-5.9.1= /lib). This relative path obviously is > ../../../ . > > * Prior to this patch we installed the plugins into =E2=80=A6-qtbase-5.9.= 1/plugins, which results in the aforementioned relative path to be ../../li= b and the RUNPATH to be set to > $ORIGIN/../../lib. Oh, that's right, thanks! > > Conclusions: > > 1. It's been pure luck that the qtwayland tests passed prior to this chan= ge. > > 2. Do make the tests pass, we need to set LD_LIBRARY_PATH prior to runnin= g the tests > Yeah, patch updated with qtwayland fixed: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-qtbase-Use-a-more-standard-directory-layout.patch >From 18da38fbed889c482db6bab91749f63f7adbde5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Fri, 25 Aug 2017 22:52:41 +0800 Subject: [PATCH] gnu: qtbase: Use a more standard directory layout. * gnu/packages/qt.scm (qtbase)[arguments]: Pass docdir, headerdir, archdatadir, datadir and examplesdir to 'configure'. Ajdust the patch-qt_config.prf phase accordingly. [native-search-paths]: Adjust accordingly. (qtwayland)[arguments]: New field. Co-authored-by: Hartmut Goebel --- gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 3e3588a50..80508f058 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -459,6 +459,12 @@ developers using C++ or QML, a CSS & JavaScript like language.") "./configure" "-verbose" "-prefix" out + "-docdir" (string-append out "/share/doc/qt5") + "-headerdir" (string-append out "/include/qt5") + "-archdatadir" (string-append out "/lib/qt5") + "-datadir" (string-append out "/share/qt5") + "-examplesdir" (string-append + out "/share/doc/qt5/examples") "-opensource" "-confirm-license" ;; Do not build examples; if desired, these could go @@ -488,38 +494,31 @@ developers using C++ or QML, a CSS & JavaScript like language.") (add-after 'install 'patch-qt_config.prf (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) + (mkspecs (string-append out "/lib/qt5/mkspecs")) (qt_config.prf (string-append - out "/mkspecs/features/qt_config.prf"))) + mkspecs "/features/qt_config.prf"))) ;; For each Qt module, let `qmake' uses search paths in the ;; module directory instead of all in QT_INSTALL_PREFIX. (substitute* qt_config.prf (("\\$\\$\\[QT_INSTALL_HEADERS\\]") - "$$replace(dir, mkspecs/modules, include)") + "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))") (("\\$\\$\\[QT_INSTALL_LIBS\\]") - "$$replace(dir, mkspecs/modules, lib)") + "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_HOST_LIBS\\]") - "$$replace(dir, mkspecs/modules, lib)") - (("\\$\\$\\[QT_INSTALL_PLUGINS\\]") - "$$replace(dir, mkspecs/modules, plugins)") - (("\\$\\$\\[QT_INSTALL_LIBEXECS\\]") - "$$replace(dir, mkspecs/modules, libexec)") + "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_INSTALL_BINS\\]") - "$$replace(dir, mkspecs/modules, bin)") - (("\\$\\$\\[QT_INSTALL_IMPORTS\\]") - "$$replace(dir, mkspecs/modules, imports)") - (("\\$\\$\\[QT_INSTALL_QML\\]") - "$$replace(dir, mkspecs/modules, qml)")) + "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")) #t)))))) (native-search-paths (list (search-path-specification (variable "QMAKEPATH") - (files '(""))) + (files '("lib/qt5"))) (search-path-specification (variable "QML2_IMPORT_PATH") - (files '("qml"))) + (files '("lib/qt5/qml"))) (search-path-specification (variable "QT_PLUGIN_PATH") - (files '("plugins"))) + (files '("lib/qt5/plugins"))) (search-path-specification (variable "XDG_DATA_DIRS") (files '("share"))) @@ -805,6 +804,18 @@ developers using C++ or QML, a CSS & JavaScript like language.") (snippet ;; The examples try to build and cause the build to fail '(delete-file-recursively "examples")))) + (arguments + (substitute-keyword-arguments (package-arguments qtsvg) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'check 'set-ld-library-path + ;; + ;; + ;; Make the uninstalled libQt5WaylandClient.so.5 available to the + ;; wayland platform plugin. + (lambda _ + (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib")) + #t)))))) (native-inputs `(("glib" ,glib) ("perl" ,perl) -- 2.13.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > 3. tests of other packages may fail for the same reason. Yes, I have got tiled running, and find that 'cool-retro-term' need to be adjusted. And vlc fails to build due to can't find headers of Qt5X11Extras. Indeed, the pkg-config output of Qt5X11Extras seems wrong: --8<---------------cut here---------------start------------->8--- $ pkg-config --cflags --libs Qt5X11Extras -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtGu= i -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I= /gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtCore= -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I/= gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtX11Ex= tras -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5= -L/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/lib -lQt5X11Ext= ras -lQt5Gui -lQt5Core --8<---------------cut here---------------end--------------->8--- I can try fix this pkg-config issue. > > I'll take care of the packages in kde-frameworks.scm, I assume/hope > Thomas will take care of the ones in kde.scm. Yeah, I build 'kiarchive', and find it puts 'mkspecs' under $out, which needs change to $out/lib/qt5/mkspecs. > > =E5=AE=8B=E6=96=87=E6=AD=A6, how can we coordinate the required changes? = Should they go into one patch? Or into a series? I think we could make a series patches, and can squash them later if suitable. --=-=-=--