all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 28719@debbugs.gnu.org
Subject: [bug#28719] [PATCH 2/6] gnu: qt: Fix install paths in submodules.
Date: Fri,  6 Oct 2017 14:02:10 +0200	[thread overview]
Message-ID: <20171006120214.29511-2-h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <20171006120214.29511-1-h.goebel@crazy-compilers.com>

From: 宋文武 <iyzsong@member.fsf.org>

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 e276eb05b..88e0011b1 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -376,7 +376,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)
@@ -427,8 +428,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
@@ -492,10 +492,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
@@ -509,6 +510,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
@@ -554,26 +569,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.5

  reply	other threads:[~2017-10-06 12:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 11:59 [bug#28719] [PATCH 0/6] Qt: Use a more standard directory layout Hartmut Goebel
2017-10-06 12:02 ` [bug#28719] [PATCH 1/6] gnu: qtbase: " Hartmut Goebel
2017-10-06 12:02   ` Hartmut Goebel [this message]
2017-10-10 11:01     ` [bug#28719] [PATCH 2/6] gnu: qt: Fix install paths in submodules 宋文武
2017-10-06 12:02   ` [bug#28719] [PATCH 3/6] gnu: qwt: Adjust installation directory layout Hartmut Goebel
2017-10-06 12:02   ` [bug#28719] [PATCH 4/6] gnu: qtwebkit: Fix rpath for the qmlwebkit plugins Hartmut Goebel
2017-10-06 12:02   ` [bug#28719] [PATCH 5/6] gnu: qscintilla: Adjust installation directory layout Hartmut Goebel
2017-10-10 11:05     ` 宋文武
2017-10-10 14:43       ` Hartmut Goebel
2017-10-10 15:39       ` Hartmut Goebel
2017-10-12 11:27         ` 宋文武
2017-10-13 13:37           ` bug#28719: " Hartmut Goebel
2017-10-14  6:30             ` [bug#28719] " 宋文武
2017-10-06 12:02   ` [bug#28719] [PATCH 6/6] gnu: kde-framworks: Fix installation directories Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171006120214.29511-2-h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=28719@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.