Message ID | 20190523062344.20601-1-mrosset@bufio.org |
---|---|
State | Accepted |
Headers | show |
Series | [bug#35866] gnu: Add qtwebengine. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | success | Successfully applied |
Hello Mike, mike rosset <mrosset@bufio.org> skribis: > From: mike rosset <mike.rosset@gmail.com> > > * gnu/packages/qt.scm (qtwebengine): New variable. <https://github.com/mrosset/nomad/> looks pretty exciting, which motivates me to take a look at this patch. :-) > + (synopsis "Qt5WebEngine") > + (description "Qt5WebEngine provides support for web > +applications using the Chromium browser project.") As you may know, Guix contains a variant of ‘ungoogled-chromium’, which goes to great lengths to remove non-free software, DRM support, spyware, etc. The problem is that QtWebEngine bundles Chromium. We would need to “unbundle” it and/or replace it with ‘ungoogled-chromium’. I’m not sure how hard that is. Have you thought about this? Would you like to give it a try? Thanks, Ludo’.
Ludovic Courtès <ludo@gnu.org> writes: Hello Ludovic, thank you for looking at this. > > <https://github.com/mrosset/nomad/> looks pretty exciting, which > motivates me to take a look at this patch. :-) This is my motivation for having this included with guix. the main URL is https://savannah.nongnu.org/projects/nomad/ and the main source is http://git.savannah.nongnu.org/cgit/nomad.git?h=feature-qt. Development is currently being done on the feature-qt branch. Nomad is still very much WIP. And some early documentation can be found here. http://git.savannah.nongnu.org/cgit/nomad.git/tree/org/README.txt?h=feature-qt. In short Nomad is an extensible web browser that uses GNU guile as it's extension language. And is heavily modeled after Emacs. >> + (synopsis "Qt5WebEngine") >> + (description "Qt5WebEngine provides support for web >> +applications using the Chromium browser project.") > > As you may know, Guix contains a variant of ‘ungoogled-chromium’, which > goes to great lengths to remove non-free software, DRM support, spyware, etc. > > The problem is that QtWebEngine bundles Chromium. We would need to > “unbundle” it and/or replace it with ‘ungoogled-chromium’. I’m not sure > how hard that is. I have done some research as to how best to handle the chromium sources that are distributed with qtwebengine. From my understanding so far. QT has similar goals as ungoogle-chromium. Based off of the information found here https://wiki.qt.io/QtWebEngine. Binaries are stripped from source tree. Services that talk to Google are removed. And the code is refactored to use system libraries like OpenSSL. There is a more in depth break down on the chromium rebase process found here. https://wiki.qt.io/QtWebEngine/Rebase_on_New_Chromium . It seems to me that QT is already doing the right thing here. Unfortunately I don't think it will be easy to reuse the ungoogle-chrome code base. It would probably require manually re-basing then applying qt patches. Also there is no clear benefit for it. Since updating ungoogle-chromium would not directly benefit qtwebengine. In short QT seems to already be doing the necessary work. I can though now, do my best to ensure that the least amount of 3rd party libraries are used. I'll update my patch as soon as possible. And I will explore the chromium source issue more in the process. Regards, Mike Rosset
This patch ensures qtwebengine uses only Guix libraries. There are some libraries that fail to be detect or are missing features. I have documented them within the input expression. Note. I'm not sure if I've sent this patch right. If this is wrong I can resend the complete series
Hello, mrosset@bufio.org skribis: > It seems to me that QT is already doing the right thing > here. Unfortunately I don't think it will be easy to reuse the > ungoogle-chrome code base. It would probably require manually re-basing > then applying qt patches. Also there is no clear benefit for it. Since > updating ungoogle-chromium would not directly benefit qtwebengine. In > short QT seems to already be doing the necessary work. I think this would require a careful analysis like the one Marius Bakke carried out when packaging ‘ungoogled-chromium’. It would be both nicer and easier if QtWebEngine could be tweaked to use our own ‘ungoogled-chromium’ directly instead of rebuilding one, but yeah, that sounds tricky. > I can though now, do my best to ensure that the least amount of 3rd > party libraries are used. I'll update my patch as soon as possible. And > I will explore the chromium source issue more in the process. OK. Thank you! Ludo’.
Hi Mike, I’m curious about the current state of this patch. Have you been able to take a look at whether we could use our ungoogled-chromium package here? I’m working on getting the latest R Studio into Guix (upgrading and moving it from the guix-bimsb channel) and since all versions since 1.2 depend on qtwebengine I have some motivation to see this patch make it into Guix at some point :) -- Ricardo
I was able to apply this patch and succeeded in building qtwebengine. I then tried to add it as a dependency to python-pyqt and build it, but I get this error: sip/QtPrintSupport/qprinter.sip:28:22: fatal error: qprinter.h: No such file or directory It sounds like some simple search path error. Anyone know how that can be fixed?
+1! :) As far as I can tell, in its current state the package will trigger the following error when we try to make a webengine view: --8<---------------cut here---------------start------------->8--- 15:50:10 INFO: Run :adblock-update to get adblock lists. 15:50:10 CRITICAL: Could not find QtWebEngineProcess --8<---------------cut here---------------end--------------->8--- Maybe something like this would help? --8<---------------cut here---------------start------------->8--- (native-search-paths (list (search-path-specification (variable "QTWEBENGINEPROCESS_PATH") (files '("lib/qt5/libexec/QtWebEngineProcess"))))) --8<---------------cut here---------------end--------------->8---
Pierre Neidhardt <mail@ambrevar.xyz> writes: > Maybe something like this would help? > > (native-search-paths > (list (search-path-specification > (variable "QTWEBENGINEPROCESS_PATH") > (files '("lib/qt5/libexec/QtWebEngineProcess"))))) Right I think this is what I was going to propose for https://gitlab.com/nonguix/nonguix/blob/master/nongnu/packages/qt.scm#L58. Though you can temporarily get around this with this ugly hack. export QTWEBENGINEPROCESS_PATH="$(guix build qtwebengine)/lib/qt5/libexec/QtWebEngineProcess" I'll add the native-search-path to the nonguix package ASAP. Note. Once you get past this issues. You will then have problems with locales. Since the module QT packages assumes you are installing to the same prefix as qtbase. Which is not feasible with how guix packages things. For my experimental QT nomad I had some hacks to get around this, which are not feasible or ideal when creating a package that is a library and uses qtwebengine. I'm still not sure how to best resolve this issue. Maybe creating a package that is a union of qtbase and qtwebengine might help. Regards, Mike
Hi, has anybody tried this patch(es) recently? Some "search-path" issues have been fixed recently, so maybe some issues are gone now. I also wonder whether this could be based on qtsvg, too. I can not spot any differences in the build-system arguments compared to qtsvg.
Hartmut Goebel <h.goebel@crazy-compilers.com> writes: > Hi, > > has anybody tried this patch(es) recently? Some "search-path" issues > have been fixed recently, so maybe some issues are gone now. > > I also wonder whether this could be based on qtsvg, too. I can not spot > any differences in the build-system arguments compared to qtsvg. If I recall correctly I tried inheriting from qtsvg but there was significant divergence to warrant a custom qt.conf for the locale hacks. Why don't I resubmit this patch? I believe I have a more up to date local version. And based on our other threads a module qtwebengine is more ideal for guix then the monolithic ones. At least this way I can put a test case together that demonstrates the locale issues. Mike
Please do! I'll try to test it this week. Just for fun, to see how long it takes to build :)
merged
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index afc4d8dc06..d00cc2692a 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -48,6 +48,7 @@ #:use-module (gnu packages freedesktop) #:use-module (gnu packages gl) #:use-module (gnu packages glib) + #:use-module (gnu packages gnupg) #:use-module (gnu packages gperf) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) @@ -55,6 +56,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages maths) + #:use-module (gnu packages ninja) #:use-module (gnu packages nss) #:use-module (gnu packages pciutils) #:use-module (gnu packages pcre) @@ -63,6 +65,7 @@ #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages re2c) #:use-module (gnu packages ruby) #:use-module (gnu packages sdl) #:use-module (gnu packages sqlite) @@ -2274,3 +2277,133 @@ user-friendly than the default @code{QColorDialog} and several other color-related widgets.") ;; Includes a license exception for combining with GPL2 code. (license license:lgpl3+)))) + +(define-public qtwebengine + (package + (name "qtwebengine") + (version (package-version qtbase)) + (source + (origin + (method url-fetch) + (uri + (string-append "https://download.qt.io/official_releases/qt/" + (substring version 0 4) + "/" version "/submodules/" + (string-append name "-everywhere-src-" version) + ".tar.xz")) + (sha256 + (base32 + "1zmqsdais85cdfh2jh8h4a5jcamp1mzdk3vgqm6xnldqf6nrxd2v")))) + (build-system gnu-build-system) + (native-inputs + `( + ("perl" ,perl) + ("python-2" ,python-2) + ("pkg-config" ,pkg-config) + ("flex" ,flex) + ("bison" ,bison) + ("ruby" ,ruby) + ("ninja" ,ninja) + )) + (inputs + `( + ("qtbase" ,qtbase) + ("qtdeclarative" ,qtdeclarative) + ("libxcb" ,libxcb) + ("xcb-util" ,xcb-util) + ("libxkbcommon" ,libxkbcommon) + ("libx11" ,libx11) + ("libxrender" ,libxrender) + ("libxi" ,libxi) + ;; OpenGL + ("mesa" ,mesa) + ;; qt web engine + ("libgcrypt" ,libgcrypt) + ("pciutils" ,pciutils) + ("nss" ,nss) + ("libxtst" ,libxtst) + ("gperf" ,gperf) + ("cups-minimal" ,cups-minimal) + ("pulseaudio" ,pulseaudio) + ("udev" ,eudev) + ;; systemd-devel? no systemd on guix + ("libcap" ,libcap) + ("alsa-lib" ,alsa-lib) + ("dbus" ,dbus) + ("libxrandr" ,libxrandr) + ("libxcomposite" ,libxcomposite) + ("libxcursor" ,libxcursor) + ("fontconfig" ,fontconfig) + ("qtwebchannel" ,qtwebchannel) + ("atk" ,atk) + ("qtmultimedia" ,qtmultimedia) + ("re2c" ,re2c) + )) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'configure-qmake + (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) + (setenv "CC" "gcc") + (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 + +[EffectiveSourcePaths] +HostPrefix=~a +HostData=lib/qt5 +" out out qtbase))) + #t))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Valid QT_BUILD_PARTS variables are: + ;; libs tools tests examples demos docs translations + (invoke "qmake" "QT_BUILD_PARTS = libs tools"))) + (add-before 'check 'set-display + (lambda _ + ;; make Qt render "offscreen", required for tests + (setenv "QT_QPA_PLATFORM" "offscreen") + #t)) + (add-after 'install-binaries 'install-qt.conf + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (tmpdir (string-append (getenv "TMPDIR"))) + (in.conf (string-append tmpdir "/qt.conf")) + (out.conf (string-append out "/lib/qt5/libexec/qt.conf"))) + (copy-file in.conf out.conf)) + #t)) + ))) + (home-page "https://www.qt.io") + (synopsis "Qt5WebEngine") + (description "Qt5WebEngine provides support for web +applications using the Chromium browser project.") + (license + (package-license qt))))
From: mike rosset <mike.rosset@gmail.com> * gnu/packages/qt.scm (qtwebengine): New variable. --- gnu/packages/qt.scm | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+)