Subject: [bug#40777] [PATCH 1/3] gnu: qtdeclarative: Fix reference on qmlcachegen.

From: Jonathan Brielmaier <[email-masked]>
Date: Wed, 22 Apr 2020 21:54:09 +0200

* gnu/packages/qt.scm (qtdeclarative)[arguments]: Add phase to fix the
reference on qmlcachegen in an installed cmake file.
---
 gnu/packages/qt.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 6ca052c31a..f540da458e 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2018 John Soo <[email-masked]>
 ;;; Copyright © 2020 Mike Rosset <[email-masked]>
 ;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
+;;; Copyright © 2020 Jonathan Brielmaier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -778,7 +779,17 @@ xmlpatternsvalidator.")))
                "1gg9xbv8ah4p55ws97brwn0csl0k3j1x6zdknrrsnh7j6nh0bp2w"))))
     (arguments
      (substitute-keyword-arguments (package-arguments qtsvg)
-       ((#:tests? _ #f) #f))) ; TODO: Enable the tests
+       ((#:tests? _ #f) #f) ; TODO: Enable the tests
+       ((#:phases phases)
+        `(modify-phases ,phases
+          ;; The qt5core install prefix is set to qtbase, but qmlcachegen is
+          ;; provided by qtdeclarative
+          (add-after 'build 'fix-qt5core-install-prefix
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake"
+                              (("\\$\\{_qt5Core_install_prefix\\}") out )))
+               #t))))))
     (native-inputs
      `(("perl" ,perl)
        ("pkg-config" ,pkg-config)
--
2.26.0