>From b2f4822b3a1c8f76d2c6dcf39590d3810d3510bf 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/2] 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 (qtsvg)[arguments]: Use a customized qt.conf to override install paths to $out. --- gnu/packages/qt.scm | 57 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 80508f058..771a03bd5 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -554,25 +554,48 @@ developers using C++ or QML, a CSS & JavaScript like language.") `(#:phases (modify-phases %standard-phases (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (lambda* (#:key inputs outputs #:allow-other-keys) + (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) + (with-output-to-file qt.conf + (lambda () + ;; Thoese must be kept in sync with qtbase. + (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 +HostLibrariesPath=lib +" out qtbase))) + ;; 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 - (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))) - #t))) - (add-before 'check 'set-display - (lambda _ - ;; make Qt render "offscreen", required for tests - (setenv "QT_QPA_PLATFORM" "offscreen") - #t))))))) + (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