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: Thu, 07 Sep 2017 21:38:15 +0800 Message-ID: <87r2vi39yw.fsf@member.fsf.org> References: <87o9r3iqh7.fsf@member.fsf.org> <0f97b74f-282d-9996-aa61-d3084e164b09@crazy-compilers.com> <20170904.094422.649590718375041033.post@thomasdanckaert.be> <88a5454c-4ef2-7c27-7c29-b2ab244d0042@crazy-compilers.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpx0q-0001Ze-Ki for guix-devel@gnu.org; Thu, 07 Sep 2017 09:38:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpx0l-0005Tt-Cj for guix-devel@gnu.org; Thu, 07 Sep 2017 09:38:32 -0400 Received: from rezeros.cc ([2001:19f0:7001:2f3e:5400:ff:fe84:e55d]:40544) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpx0k-0005PQ-R6 for guix-devel@gnu.org; Thu, 07 Sep 2017 09:38:27 -0400 In-Reply-To: <88a5454c-4ef2-7c27-7c29-b2ab244d0042@crazy-compilers.com> (Hartmut Goebel's message of "Mon, 4 Sep 2017 11:16:53 +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@gnu.org, Thomas Danckaert --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hartmut Goebel writes: > Am 04.09.2017 um 09:44 schrieb Thomas Danckaert: >> Just to make sure, the idea is to: >> >> 1. apply =E5=AE=8B=E6=96=87=E6=AD=A6's qtbase patch adjusting the paths= of various qt components >> >> 2. apply your 2 patches for qtscintilla and qtwebkit >> >> 3. adjust kde.scm so packages in there build correctly? > > ACK from my side. Yes, and here are my updates on the paths issue of pkg-config files and qwt: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-qt-Fix-install-paths-in-submodules.patch >From e8a252f5037b77f44a1516c715bbd437a6e23cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sun, 3 Sep 2017 17:38:57 +0800 Subject: [PATCH 2/3] gnu: qt: Fix install paths in submodules. Before this, the paths in pkg-config (.pc) and libtool (.la) files of submodules are all pointing to qtbase. * gnu/packages/qt.scm (qtbase)[native-inputs]: Move 'which' to 'propagated-inputs'. [arguments]: Rename 'patch-mkspecs' phase to 'patch-mkspecs' and patch more qmake spec files there. (qtsvg)[arguments]: Add 'configure-qmake' phase. --- gnu/packages/qt.scm | 86 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 23 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 80508f058..a41aa4fbb 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -375,7 +375,8 @@ developers using C++ or QML, a CSS & JavaScript like language.") #t)))) (build-system gnu-build-system) (propagated-inputs - `(("mesa" ,mesa))) + `(("mesa" ,mesa) + ("which" ,(@ (gnu packages base) which)))) (inputs `(("alsa-lib" ,alsa-lib) ("cups" ,cups) @@ -426,8 +427,7 @@ developers using C++ or QML, a CSS & JavaScript like language.") ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-2) - ("ruby" ,ruby) - ("which" ,(@ (gnu packages base) which)))) + ("ruby" ,ruby))) (arguments `(#:phases (modify-phases %standard-phases @@ -491,10 +491,11 @@ developers using C++ or QML, a CSS & JavaScript like language.") '("-no-sse2")) "-no-mips_dsp" "-no-mips_dspr2"))))) - (add-after 'install 'patch-qt_config.prf + (add-after 'install 'patch-mkspecs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (mkspecs (string-append out "/lib/qt5/mkspecs")) + (archdata (string-append out "/lib/qt5")) + (mkspecs (string-append archdata "/mkspecs")) (qt_config.prf (string-append mkspecs "/features/qt_config.prf"))) ;; For each Qt module, let `qmake' uses search paths in the @@ -508,6 +509,20 @@ developers using C++ or QML, a CSS & JavaScript like language.") "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_INSTALL_BINS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")) + + ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS. + (substitute* (string-append mkspecs "/features/qt_functions.prf") + (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2") + "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})")) + + ;; Resolve qmake spec files within qtbase by absolute paths. + (substitute* + (map (lambda (file) + (string-append mkspecs "/features/" file)) + '("device_config.prf" "moc.prf" "qt_build_config.prf" + "qt_config.prf" "winrt/package_manifest.prf")) + (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata) + (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)) #t)))))) (native-search-paths (list (search-path-specification @@ -553,26 +568,51 @@ developers using C++ or QML, a CSS & JavaScript like language.") (arguments `(#:phases (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - ;; Valid QT_BUILD_PARTS variables are: - ;; libs tools tests examples demos docs translations - (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests" - (string-append "PREFIX=" out)))))) - (add-before 'install 'fix-Makefiles + (add-before 'configure 'configure-qmake (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (qtbase (assoc-ref inputs "qtbase"))) - (substitute* (find-files "." "Makefile") - (((string-append "INSTALL_ROOT)" qtbase)) - (string-append "INSTALL_ROOT)" out))) + (let* ((out (assoc-ref outputs "out")) + (qtbase (assoc-ref inputs "qtbase")) + (tmpdir (string-append (getenv "TMPDIR"))) + (qmake (string-append tmpdir "/qmake")) + (qt.conf (string-append tmpdir "/qt.conf"))) + ;; Use qmake with a customized qt.conf to override install + ;; paths to $out. + (symlink (which "qmake") qmake) + (setenv "PATH" (string-append tmpdir ":" (getenv "PATH"))) + (with-output-to-file qt.conf + (lambda () + (format #t "[Paths] +Prefix=~a +ArchData=lib/qt5 +Data=share/qt5 +Documentation=share/doc/qt5 +Headers=include/qt5 +Libraries=lib +LibraryExecutables=lib/qt5/libexec +Binaries=bin +Tests=tests +Plugins=lib/qt5/plugins +Imports=lib/qt5/imports +Qml2Imports=lib/qt5/qml +Translations=share/qt5/translations +Settings=etc/xdg +Examples=share/doc/qt5/examples +HostPrefix=~a +HostData=lib/qt5 +HostBinaries=bin +HostLibraries=lib +" out out))) #t))) - (add-before 'check 'set-display - (lambda _ - ;; make Qt render "offscreen", required for tests - (setenv "QT_QPA_PLATFORM" "offscreen") - #t))))))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Valid QT_BUILD_PARTS variables are: + ;; libs tools tests examples demos docs translations + (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests")))) + (add-before 'check 'set-display + (lambda _ + ;; make Qt render "offscreen", required for tests + (setenv "QT_QPA_PLATFORM" "offscreen") + #t))))))) (define-public qtimageformats (package (inherit qtsvg) -- 2.13.3 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-gnu-qwt-Adjust-installation-directory-layout.patch >From b290321dc6e4c2db731cae31f78988958700c018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Thu, 7 Sep 2017 21:19:54 +0800 Subject: [PATCH 3/3] gnu: qwt: Adjust installation directory layout. * gnu/packages/qt.scm (qwt)[arguments]<#:phases>: Modify 'qwtconfig.pri' to use a directory layout that matching qtbase. Modify 'doc/doc.pro' to remove the misplaced installation of man pages. Rename phase 'install-documentation' to 'install-man-pages'. --- gnu/packages/qt.scm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index a41aa4fbb..8070e279f 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -1588,11 +1588,27 @@ securely. It will not store any data unencrypted unless explicitly requested.") (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (let* ((out (assoc-ref outputs "out")) + (docdir (string-append out "/share/doc/qwt")) + (incdir (string-append out "/include/qwt")) + (pluginsdir (string-append out "/lib/qt5/plugins/designer")) + (featuresdir (string-append out "/lib/qt5/mkspecs/features"))) (substitute* '("qwtconfig.pri") - (("/usr/local/qwt-\\$\\$QWT\\_VERSION") out)) + (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x) + (format #f "~a = ~a\n" x out)) + (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x) + (format #f "~a = ~a\n" x docdir)) + (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x) + (format #f "~a = ~a\n" x incdir)) + (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x) + (format #f "~a = ~a\n" x pluginsdir)) + (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x) + (format #f "~a = ~a\n" x featuresdir))) + (substitute* '("doc/doc.pro") + ;; We'll install them in the 'install-man-pages' phase. + (("^unix:doc\\.files.*") "")) (zero? (system* "qmake"))))) - (add-after 'install 'install-documentation + (add-after 'install 'install-man-pages (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (man (string-append out "/share/man"))) -- 2.13.3 --=-=-= Content-Type: text/plain The 0001-gnu-qtbase-Use-a-more-standard-directory-layout.patch is unchanged. --=-=-=--