[bug#75966,v3,01/10] gnu: qtwebengine: Fix default path for QtWebEngineProcess.

Message ID ebaf44f5878864d22b164cc144bc1258b2a2fae6.1738470835.git.iyzsong@member.fsf.org
State New
Headers
Series [bug#75966,v3,01/10] gnu: qtwebengine: Fix default path for QtWebEngineProcess. |

Commit Message

vasilii.smirnov--- via Guix-patches" via Feb. 2, 2025, 4:34 a.m. UTC
  From: 宋文武 <iyzsong@member.fsf.org>

Since qtwebengine and qtbase are not installed into the same prefix,
the default path for QtWebEngineProcess won't work.  Fix it so that
we no longer need to set QTWEBENGINEPROCESS_PATH anymore.

* gnu/packages/qt.scm (qtwebengine-5, qtwebengine)[arguments]:
Substitute 'QLibraryInfo::LibraryExecutablesPath' in 'substitute-source phase.
[native-search-paths]: Remove QTWEBENGINEPROCESS_PATH.
* guix/build/qt-utils.scm (variables-for-wrapping): Remove
QTWEBENGINEPROCESS_PATH.

Change-Id: Ie0dfaf8c2355a679e2a3ddeacf09654830f9ab2f
---
 gnu/packages/qt.scm     | 22 ++++++++--------------
 guix/build/qt-utils.scm |  6 +-----
 2 files changed, 9 insertions(+), 19 deletions(-)


base-commit: 070c073d508d3197f0235adc424aec287e7dd916
  

Comments

Maxim Cournoyer Feb. 3, 2025, 2:37 p.m. UTC | #1
Hi,

iyzsong@envs.net writes:

> From: 宋文武 <iyzsong@member.fsf.org>
>
> Since qtwebengine and qtbase are not installed into the same prefix,
> the default path for QtWebEngineProcess won't work.  Fix it so that
> we no longer need to set QTWEBENGINEPROCESS_PATH anymore.
>
> * gnu/packages/qt.scm (qtwebengine-5, qtwebengine)[arguments]:
> Substitute 'QLibraryInfo::LibraryExecutablesPath' in 'substitute-source phase.
> [native-search-paths]: Remove QTWEBENGINEPROCESS_PATH.
> * guix/build/qt-utils.scm (variables-for-wrapping): Remove
> QTWEBENGINEPROCESS_PATH.
>
> Change-Id: Ie0dfaf8c2355a679e2a3ddeacf09654830f9ab2f

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>

I note that given then change to qt-utils, that's a Qt world rebuild
change, and should go to a qt-team branch.  Perhaps we could bunch a qt
upgrade on top if time permits; we have a manifest that makes this
rather simple (unless there are new test failures...).  See
etc/teams/qt-team/qt-manifest.scm for example, and the comment inside.
  
宋文武 Feb. 4, 2025, 7:13 a.m. UTC | #2
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> [...]
>
> Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>
> I note that given then change to qt-utils, that's a Qt world rebuild
> change, and should go to a qt-team branch.  Perhaps we could bunch a qt
> upgrade on top if time permits; we have a manifest that makes this
> rather simple (unless there are new test failures...).  See
> etc/teams/qt-team/qt-manifest.scm for example, and the comment inside.

I have adjust the change logs and push them into qt-team branch.  Also
with 'guix refresh' for 'qt-manifest.scm', update qt to 6.8.2.  qtbase
now require a newer version of freetype, so update it first.

I haven't build them locally, so consider the 'qt-team' branch WIP.
I'll test them and update python-pyqt later.  Thank you!
  
Maxim Cournoyer Feb. 5, 2025, 1:59 a.m. UTC | #3
Hi,

宋文武 <iyzsong@envs.net> writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> [...]
>>
>> Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>>
>> I note that given then change to qt-utils, that's a Qt world rebuild
>> change, and should go to a qt-team branch.  Perhaps we could bunch a qt
>> upgrade on top if time permits; we have a manifest that makes this
>> rather simple (unless there are new test failures...).  See
>> etc/teams/qt-team/qt-manifest.scm for example, and the comment inside.
>
> I have adjust the change logs and push them into qt-team branch.  Also
> with 'guix refresh' for 'qt-manifest.scm', update qt to 6.8.2.  qtbase
> now require a newer version of freetype, so update it first.
>
> I haven't build them locally, so consider the 'qt-team' branch WIP.
> I'll test them and update python-pyqt later.  Thank you!

Awesome, thank you.
  

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 432282f9cf..430f0bb96d 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3415,7 +3415,10 @@  (define-public qtwebengine-5
                                   "/share/qt5/translations\")"))
                   (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
                    (string-append "QLatin1String(\"" #$output
-                                  "/share/qt5\")")))
+                                  "/share/qt5\")"))
+                  (("QLibraryInfo::location\\(QLibraryInfo::LibraryExecutablesPath)")
+                   (string-append "QLatin1String(\"" #$output
+                                  "/lib/qt5/libexec\")")))
                 ;; Substitute full dynamic library path for nss.
                 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
                   (("libnssckbi.so")
@@ -3453,12 +3456,6 @@  (define-public qtwebengine-5
        ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
        ;; before running tests.
        ((#:tests? _ #f) #f)))
-    (native-search-paths
-     (list (search-path-specification
-            (file-type 'regular)
-            (separator #f)
-            (variable "QTWEBENGINEPROCESS_PATH")
-            (files '("lib/qt5/libexec/QtWebEngineProcess")))))
     (home-page "https://wiki.qt.io/QtWebEngine")
     (synopsis "Qt WebEngine module")
     (description "The Qt5WebEngine module provides support for web applications
@@ -3824,7 +3821,10 @@  (define-public qtwebengine
                                 "/share/qt6/translations\")"))
                 (("QLibraryInfo::path\\(QLibraryInfo::DataPath)")
                  (string-append "QLatin1String(\"" #$output
-                                "/share/qt6\")")))
+                                "/share/qt6\")"))
+                (("QLibraryInfo::path\\(QLibraryInfo::LibraryExecutablesPath)")
+                 (string-append "QLatin1String(\"" #$output
+                                "/lib/qt6/libexec\")")))
               ;; Substitute full dynamic library path for nss.
               (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
                 (("libnssckbi.so")
@@ -3884,12 +3884,6 @@  (define-public qtwebengine
        (replace "qtbase" qtbase)
        (replace "qtdeclarative" qtdeclarative)
        (replace "qtwebchannel" qtwebchannel)))
-    (native-search-paths
-     (list (search-path-specification
-            (file-type 'regular)
-            (separator #f)
-            (variable "QTWEBENGINEPROCESS_PATH")
-            (files '("lib/qt6/libexec/QtWebEngineProcess")))))
     (home-page "https://wiki.qt.io/QtWebEngine")
     (synopsis "Qt WebEngine module")
     (description "The Qt WebEngine module provides support for web
diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm
index d7609b9f21..65592757e6 100644
--- a/guix/build/qt-utils.scm
+++ b/guix/build/qt-utils.scm
@@ -93,11 +93,7 @@  (define* (variables-for-wrapping base-directories output-directory
     `(,(if (>= (string->number qt-major-version) 6)
            "QML_IMPORT_PATH"
            "QML2_IMPORT_PATH")
-      prefix directory ,(format #f "/lib/qt~a/qml" qt-major-version))
-    ;; QTWEBENGINEPROCESS_PATH accepts a single value, which makes 'exact the
-    ;; most suitable environment variable type for it.
-    `("QTWEBENGINEPROCESS_PATH" = regular
-      ,(format #f "/lib/qt~a/libexec/QtWebEngineProcess" qt-major-version)))))
+      prefix directory ,(format #f "/lib/qt~a/qml" qt-major-version)))))
 
 (define* (wrap-qt-program* program #:key sh inputs output-dir
                            qt-wrap-excluded-inputs