unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 56771@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#56771] [PATCH 21/33] gnu: Add qtwebengine, version 6.3.1.
Date: Mon, 25 Jul 2022 19:07:51 -0400	[thread overview]
Message-ID: <20220725230803.10002-21-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20220725230803.10002-1-maxim.cournoyer@gmail.com>

* gnu/packages/qt.scm (qtwebengine): New variable.
---
 gnu/packages/qt.scm | 345 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 345 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 578837fb14..5abd691665 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -88,6 +88,7 @@ (define-module (gnu packages qt)
   #:use-module (gnu packages markup)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages ninja)
+  #:use-module (gnu packages node)
   #:use-module (gnu packages nss)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pcre)
@@ -98,6 +99,7 @@ (define-module (gnu packages qt)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages regex)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages sdl)
@@ -2378,6 +2380,349 @@ (define (delete-unwanted-files child stat flag base level)
 and binaries removed, and adds modular support for using system libraries.")
     (license license:lgpl2.1+)))
 
+(define-public qtwebengine
+  (package
+    (name "qtwebengine")
+    (version "6.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (qt5-urls name version))
+       (sha256
+        (base32
+         "0ivfsqd5c0cxsnssj6z37901cf6a47w50zaqgjiysvcm3ar36ymd"))
+       (modules '((ice-9 ftw)
+                  (ice-9 match)
+                  (srfi srfi-1)
+                  (srfi srfi-26)
+                  (guix build utils)))
+       (snippet
+        '(begin
+           (let ((preserved-third-party-files
+                  '("base/third_party/double_conversion"
+                    "base/third_party/cityhash"
+                    "base/third_party/cityhash_v103"
+                    "base/third_party/dynamic_annotations"
+                    "base/third_party/icu"
+                    "base/third_party/libevent"
+                    "base/third_party/nspr"
+                    "base/third_party/superfasthash"
+                    "base/third_party/symbolize"
+                    "base/third_party/xdg_mime"
+                    "base/third_party/xdg_user_dirs"
+                    "net/third_party/mozilla_security_manager"
+                    "net/third_party/nss"
+                    "net/third_party/quiche"
+                    "net/third_party/uri_template"
+                    "third_party/abseil-cpp"
+                    "third_party/angle"
+                    "third_party/angle/src/common/third_party/base"
+                    "third_party/angle/src/common/third_party/smhasher"
+                    "third_party/angle/src/common/third_party/xxhash"
+                    "third_party/axe-core"
+                    "third_party/blink"
+                    "third_party/boringssl"
+                    "third_party/boringssl/src/third_party/fiat"
+                    "third_party/breakpad"
+                    "third_party/brotli"
+                    "third_party/ced"
+                    "third_party/cld_3"
+                    "third_party/closure_compiler"
+                    "third_party/crashpad"
+                    "third_party/crashpad/crashpad/third_party/lss"
+                    "third_party/crashpad/crashpad/third_party/zlib"
+                    "third_party/crc32c"
+                    "third_party/dav1d"
+                    "third_party/dawn"
+                    "third_party/devtools-frontend"
+                    "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
+                    "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
+                    "third_party/emoji-segmenter"
+                    "third_party/ffmpeg"
+                    "third_party/googletest"
+                    "third_party/harfbuzz-ng/utils"
+                    "third_party/hunspell"
+                    "third_party/iccjpeg"
+                    "third_party/icu"
+                    "third_party/inspector_protocol"
+                    "third_party/jinja2"
+                    "third_party/jsoncpp"
+                    "third_party/jstemplate"
+                    "third_party/khronos"
+                    "third_party/leveldatabase"
+                    "third_party/libaddressinput"
+                    "third_party/libgifcodec"
+                    "third_party/libjingle_xmpp"
+                    "third_party/libjpeg_turbo"
+                    "third_party/libpng"
+                    "third_party/libsrtp"
+                    "third_party/libsync"
+                    "third_party/libudev"
+                    "third_party/libvpx"
+                    "third_party/libwebm"
+                    "third_party/libwebp"
+                    "third_party/libxml"
+                    "third_party/libxslt"
+                    "third_party/libyuv"
+                    "third_party/lss"
+                    "third_party/mako"
+                    "third_party/markupsafe"
+                    "third_party/mesa_headers"
+                    "third_party/metrics_proto"
+                    "third_party/modp_b64"
+                    "third_party/nasm"
+                    "third_party/one_euro_filter"
+                    "third_party/openh264/src/codec/api/svc"
+                    "third_party/opus"
+                    "third_party/ots"
+                    "third_party/pdfium"
+                    "third_party/pdfium/third_party/agg23"
+                    "third_party/pdfium/third_party/base"
+                    "third_party/pdfium/third_party/freetype"
+                    "third_party/pdfium/third_party/lcms"
+                    "third_party/pdfium/third_party/libopenjpeg20"
+                    "third_party/pdfium/third_party/skia_shared"
+                    "third_party/perfetto"
+                    "third_party/pffft"
+                    "third_party/ply"
+                    "third_party/polymer"
+                    "third_party/protobuf"
+                    "third_party/protobuf/third_party/six"
+                    "third_party/pyjson5"
+                    "third_party/re2"
+                    "third_party/rnnoise"
+                    "third_party/skia"
+                    "third_party/skia/include/third_party/skcms/skcms.h"
+                    "third_party/skia/include/third_party/vulkan"
+                    "third_party/skia/third_party/skcms"
+                    "third_party/skia/third_party/vulkanmemoryallocator"
+                    "third_party/smhasher"
+                    "third_party/snappy"
+                    "third_party/sqlite"
+                    "third_party/usb_ids"
+                    "third_party/usrsctp"
+                    "third_party/web-animations-js"
+                    "third_party/webrtc"
+                    "third_party/webrtc/common_audio/third_party/ooura"
+                    "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
+                    "third_party/webrtc/modules/third_party/fft"
+                    "third_party/webrtc/modules/third_party/g711"
+                    "third_party/webrtc/modules/third_party/g722"
+                    "third_party/webrtc/rtc_base/third_party/base64"
+                    "third_party/webrtc/rtc_base/third_party/sigslot"
+                    "third_party/webrtc_overrides"
+                    "third_party/widevine/cdm/widevine_cdm_common.h"
+                    "third_party/widevine/cdm/widevine_cdm_version.h"
+                    "third_party/woff2"
+                    "third_party/zlib"
+                    "url/third_party/mozilla"
+                    "v8/src/third_party/utf8-decoder"
+                    "v8/src/third_party/valgrind"
+                    "v8/src/third_party/siphash"
+                    "v8/third_party/v8/builtins"
+                    "v8/third_party/inspector_protocol"))
+                 (protected (make-regexp "\\.(gn|gyp)i?$")))
+             (define preserved-club
+               (map (lambda (member)
+                      (string-append "./" member))
+                    preserved-third-party-files))
+             (define (empty? dir)
+               (equal? (scandir dir) '("." "..")))
+             (define (third-party? file)
+               (string-contains file "third_party/"))
+             (define (useless? file)
+               (any (cute string-suffix? <> file)
+                    '(".zip" ".so" ".dll" ".exe" ".jar")))
+             (define (parents child)
+               ;; Return all parent directories of CHILD up to and including
+               ;; the closest "third_party".
+               (let* ((dirs (match (string-split child #\/)
+                              ((dirs ... last) dirs)))
+                      (closest (list-index (lambda (dir)
+                                             (string=? "third_party" dir))
+                                           (reverse dirs)))
+                      (delim (- (length dirs) closest)))
+                 (fold (lambda (dir prev)
+                         (cons (string-append (car prev) "/" dir)
+                               prev))
+                       (list (string-join (list-head dirs delim) "/"))
+                       (list-tail dirs delim))))
+             (define (remove-loudly file)
+               (format #t "deleting ~a...~%" file)
+               (force-output)
+               (delete-file file))
+             (define (delete-unwanted-files child stat flag base level)
+               (match flag
+                 ((or 'regular 'symlink 'stale-symlink)
+                  (when (third-party? child)
+                    (unless (or (member child preserved-club)
+                                (any (cute member <> preserved-club)
+                                     (parents child))
+                                (regexp-exec protected child))
+                      (remove-loudly child)))
+                  (when (and (useless? child) (file-exists? child))
+                    (remove-loudly child)))
+                 ('directory-processed
+                  (when (empty? child)
+                    (rmdir child)))
+                 (_ #t)))
+
+             (with-directory-excursion "src/3rdparty"
+               (delete-file-recursively "ninja")
+
+               (with-directory-excursion "chromium"
+                 ;; Delete bundled software and binaries that were not
+                 ;; explicitly preserved above.
+                 (nftw "." delete-unwanted-files 'depth 'physical)
+
+                 ;; Assert that each preserved item is present to catch
+                 ;; removals.
+                 (for-each (lambda (third-party)
+                             (unless (file-exists? third-party)
+                               (error (format #f "~s does not exist!~%"
+                                              third-party))))
+                           preserved-club)
+
+                 ;; Use relative header locations instead of hard coded ones.
+                 (substitute*
+                     "base/third_party/dynamic_annotations/dynamic_annotations.c"
+                   (("base/third_party/valgrind") "valgrind"))
+                 (substitute* "third_party/breakpad/breakpad/src/common/\
+linux/libcurl_wrapper.h"
+                   (("third_party/curl") "curl"))
+                 (substitute*
+                     '("components/viz/common/gpu/vulkan_context_provider.h"
+                       "gpu/config/gpu_util.cc")
+                   (("third_party/vulkan/include/")
+                    ""))
+
+                 ;; Replace Google Analytics bundle with an empty file and
+                 ;; hope no one notices.
+                 (mkdir-p "third_party/analytics")
+                 (call-with-output-file
+                     "third_party/analytics/google-analytics-bundle.js"
+                   (lambda (port)
+                     (const #t)))))
+             ;; Do not enable support for loading the Widevine DRM plugin.
+             (substitute* "src/core/CMakeLists.txt"
+               (("enable_widevine=true")
+                "enable_widevine=false")))))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; XXX: The test suite is not built by default; leave it off to save
+      ;; some build time and resources.
+      #:tests? #f
+      #:configure-flags
+      ;; Use the CMake ninja generator, otherwise the build fails (see:
+      ;; https://bugreports.qt.io/browse/QTBUG-96897).
+      #~(list "-GNinja"                 ;
+              ;; Manually add the NSS library prefix to the linker
+              ;; search path, otherwise it fails to be linked (see:
+              ;; https://bugreports.qt.io/browse/QTBUG-105053).
+              (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-L"
+                             (search-input-directory %build-inputs "lib/nss"))
+
+              ;; The PDF renderer plugin fails to build with errors such as
+              ;; "src/3rdparty/chromium/components/pdf
+              ;; /renderer/pdf_accessibility_tree.cc:1373:39:
+              ;; error: use of undeclared identifier 'IDS_PDF_PAGE_INDEX'";
+              ;; disable it.
+              "-DQT_FEATURE_webengine_printing_and_pdf=OFF"
+              "-DQT_FEATURE_webengine_pepper_plugins=OFF" ;widevine
+              "-DQT_FEATURE_system_ffmpeg=ON"
+              ;; Do not artificially limit codec support; video decoding is
+              ;; done by ffmpeg.
+              "-DQT_FEATURE_webengine_proprietary_codecs=ON"
+              "-DQT_FEATURE_webengine_system_alsa=ON"
+              "-DQT_FEATURE_webengine_system_icu=ON"
+              "-DQT_FEATURE_webengine_system_libxml=ON"
+              "-DQT_FEATURE_webengine_system_libpci=ON"
+              "-DQT_FEATURE_webengine_system_libpng=ON"
+              "-DQT_FEATURE_webengine_system_pulseaudio=ON"
+              "-DQT_FEATURE_webengine_system_zlib=ON")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Qtwebengine is not installed into the same prefix as qtbase.
+              ;; Some qtbase QTLibraryInfo constants will not work.  Replace
+              ;; with the full path to the qtwebengine translations and
+              ;; locales in the store.
+              (substitute* "src/core/web_engine_library_info.cpp"
+                (("QLibraryInfo::path\\(QLibraryInfo::TranslationsPath)")
+                 (string-append "QLatin1String(\"" #$output
+                                "/share/qt6/translations\")"))
+                (("QLibraryInfo::path\\(QLibraryInfo::DataPath)")
+                 (string-append "QLatin1String(\"" #$output
+                                "/share/qt6\")")))
+              ;; Substitute full dynamic library path for nss.
+              (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
+                (("libnssckbi.so")
+                 (search-input-file inputs "lib/nss/libnssckbi.so")))
+              ;; Substitute full dynamic library path for udev.
+              (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
+                (("libudev.so.1")
+                 (search-input-file inputs "lib/libudev.so.1")))
+              ;; Patch the location of the X11 keywoard layouts, otherwise
+              ;; webengine *crashes* at run time when the default directory,
+              ;; '/usr/share/X11/xkb' is empty (see:
+              ;; https://bugreports.qt.io/browse/QTBUG-105124).
+              (substitute* "src/3rdparty/chromium/ui/events/ozone/layout/xkb\
+/xkb_keyboard_layout_engine.cc"
+                (("/usr/share/X11/xkb")
+                 (search-input-directory inputs "share/X11/xkb")))))
+          (add-before 'configure 'prepare-build-environment
+            (lambda _
+              ;; Avoids potential race conditions.
+              (setenv "PYTHONDONTWRITEBYTECODE" "1")
+              (setenv "NINJAFLAGS"
+                      (string-append
+                       "-k1"  ;less verbose build output
+                       ;; Respect the '--cores' option of 'guix build'.
+                       " -j" (number->string (parallel-job-count))))
+              ;; Use Clang/LDD to help tame the memory requirements and hasten
+              ;; the build.
+              (setenv "AR" "llvm-ar") (setenv "NM" "llvm-nm")
+              (setenv "CC" "clang") (setenv "CXX" "clang++")))
+          (replace 'build
+            (lambda* (#:key parallel-build? #:allow-other-keys)
+              (apply invoke "cmake" "--build" "."
+                     (if parallel-build?
+                         `("--parallel" ,(number->string (parallel-job-count)))
+                         '()))))
+          (replace 'install
+            (lambda _
+              (invoke "cmake" "--install" "."))))))
+    (native-inputs
+     (modify-inputs (package-native-inputs qtwebengine-5)
+       (delete "python2" "python2-six")
+       (append clang-14
+               lld-as-ld-wrapper
+               node-lts
+               python-wrapper
+               python-html5lib)))
+    (inputs
+     (modify-inputs (package-inputs qtwebengine-5)
+       (replace "qtbase" qtbase)
+       (replace "qtdeclarative" qtdeclarative)
+       (replace "qtmultimedia" qtmultimedia)
+       (replace "qtwebchannel" qtwebchannel)
+       (append libxkbfile xkeyboard-config)))
+    (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 Qt WebEngine module provides support for web
+applications using the Chromium browser project.  The Chromium source code has
+Google services and binaries removed, and adds modular support for using
+system libraries.")
+    (license license:lgpl2.1+)))
+
 (define-public single-application-qt5
   ;; Change in function signature, nheko requires at least this commit
   (let ((commit "dc8042b5db58f36e06ba54f16f38b16c5eea9053"))
-- 
2.36.1





  parent reply	other threads:[~2022-07-25 23:14 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 21:17 [bug#56771] [PATCH 00/33] *** Update Jami to 20220725, core Qt packages along the way Maxim Cournoyer
2022-07-25 23:07 ` [bug#56771] [PATCH 01/33] gnu: qtbase: Patch /bin/pwd in executable scripts Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 02/33] gnu: qtbase: Honor CMAKE_PREFIX_PATH Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 03/33] gnu: qtbase: Enable test suite Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 04/33] gnu: qtsvg: Rename variable to qtsvg-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 05/33] gnu: qtsvg-5: Fix indentation Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 06/33] gnu: Add qtsvg, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 07/33] gnu: qpwgraph: Migrate to Qt 6 and add libxkbcommon input Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 08/33] gnu: Add qtshadertools Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 09/33] gnu: qtmultimedia: Rename to qtmultimedia-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 10/33] gnu: Add qtmultimedia, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 11/33] gnu: qtdeclarative: Rename to qtdeclarative-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 12/33] gnu: Add qtdeclarative, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 13/33] gnu: qtquickcontrols: Rename to qtquickcontrols-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 14/33] gnu: qtquickcontrols2: Rename to qtquickcontrols2-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 15/33] gnu: qtquickcontrols2: Define as obsoleted by qtdeclarative Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 16/33] gnu: qtwebsockets: Rename to qtwebsockets-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 17/33] gnu: Add qtwebsockets, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 18/33] gnu: qtwebchannel: Rename to qtwebchannel-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 19/33] gnu: Add qtwebchannel, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 20/33] gnu: qtwebengine: Rename to qtwebengine-5 Maxim Cournoyer
2022-07-25 23:07   ` Maxim Cournoyer [this message]
2022-07-25 23:07   ` [bug#56771] [PATCH 22/33] gnu: Add qt5compat Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 23/33] gnu: qttools: Rename to qttools-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 24/33] gnu: Add qttools, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 25/33] gnu: qtnetworkauth: Rename to qtnetworkauth-5 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 26/33] gnu: Add qtnetworkauth, version 6.3.1 Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 27/33] gnu: Add qtpositioning Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 28/33] build: qt: Add qtbase argument and wrap Qt environment variables exactly Maxim Cournoyer
2022-07-25 23:07   ` [bug#56771] [PATCH 29/33] gnu: jami: Update to 20220725.1128.fd5e6c6 Maxim Cournoyer
2022-07-25 23:08   ` [bug#56771] [PATCH 30/33] gnu: libjami: Enable test agent Maxim Cournoyer
2022-07-25 23:08   ` [bug#56771] [PATCH 31/33] gnu: Remove jami-libclient Maxim Cournoyer
2022-07-25 23:08   ` [bug#56771] [PATCH 32/33] gnu: Deprecate jami-gnome for jami Maxim Cournoyer
2022-07-25 23:08   ` [bug#56771] [PATCH 33/33] gnu: jami: Update to 20220725.1128.fd5e6c6 Maxim Cournoyer
2022-07-26 16:14 ` [bug#56771] [PATCH 00/33] *** Update Jami to 20220725, core Qt packages along the way Jack Hill
2022-07-27  5:28   ` Jack Hill
2022-08-01  4:22     ` bug#56771: " Maxim Cournoyer
2022-08-01  4:39       ` [bug#56771] " Jack Hill
2022-08-01 10:54 ` Maxime Devos
2022-08-01 15:39   ` Maxim Cournoyer
2022-08-01 22:00     ` Maxime Devos
2022-08-05 12:51     ` Maxime Devos
2022-08-06  4:56       ` Maxim Cournoyer
2022-08-06 19:15         ` Maxime Devos

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20220725230803.10002-21-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=56771@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).