Subject: [bug#35866] [PATCH] gnu: qtwebengine: Do not use 3rd party libraries.

From: Mike Rosset <[email-masked]>
Date: Wed, 29 May 2019 16:37:05 -0700

Most in tree third party libraries are now linked to Guix libraries.  There
are a few Guix libraries that break the build or are not automatically
detected these are now documented in the input expression.

gnu: qtwebengine: PDF and printing support is now disabled.

PDF and printing requires pepper plugins. which is not enabled.
---
 gnu/packages/qt.scm | 87 +++++++++++++++++++++++++++++----------------
 1 file changed, 57 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d00cc2692a..658946f4a1 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
@@ -55,6 +56,7 @@
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages nss)
@@ -62,16 +64,21 @@
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages protobuf)
   #: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 regex)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages serialization)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages telephony)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
@@ -2297,47 +2304,63 @@ color-related widgets.")
     (build-system gnu-build-system)
     (native-inputs
      `(
+       ("bison" ,bison)
+       ("flex" ,flex)
+       ("gperf" ,gperf)
+       ("ninja" ,ninja)
        ("perl" ,perl)
-       ("python-2" ,python-2)
        ("pkg-config" ,pkg-config)
-       ("flex" ,flex)
-       ("bison" ,bison)
+       ("python-2" ,python-2)
        ("ruby" ,ruby)
-       ("ninja" ,ninja)
        ))
     (inputs
      `(
-       ("qtbase" ,qtbase)
-       ("qtdeclarative" ,qtdeclarative)
+       ("alsa-lib" ,alsa-lib)
+       ("atk" ,atk)
+       ("cups-minimal" ,cups-minimal)
+       ("dbus" ,dbus)
+       ("ffmpeg" ,ffmpeg)
+       ("fontconfig" ,fontconfig)
+       ("harbuzz" ,harfbuzz)
+       ("icu4c" ,icu4c)
+       ("jsoncpp" ,jsoncpp)
+       ("lcms" ,lcms)
+       ("libcap" ,libcap)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("libjpeg" ,libjpeg-turbo)
+       ;; libsrtp not found by qmake. seems to not have config.tests?
+       ("libsrtp" ,libsrtp)
+       ;; FIXME: error: ?struct vpx_svc_ref_frame_config? has no member named ?frame_flags?
+       ;; ("libvpx" ,libvpx)
+       ("libwebp" ,libwebp)
+       ("libx11" ,libx11)
        ("libxcb" ,libxcb)
-       ("xcb-util" ,xcb-util)
+       ("libxcomposite" ,libxcomposite)
+       ("libxcursor" ,libxcursor)
+       ("libxi" ,libxi)
        ("libxkbcommon" ,libxkbcommon)
-       ("libx11" ,libx11)
+       ;; libxml not found due to icu not enabled in libxml?
+       ("libxml2" ,libxml2)
+       ("libxrandr" ,libxrandr)
        ("libxrender" ,libxrender)
-       ("libxi" ,libxi)
-       ;; OpenGL
+       ("libxslt" ,libxslt)
+       ("libxtst" ,libxtst)
        ("mesa" ,mesa)
-       ;; qt web engine
-       ("libgcrypt" ,libgcrypt)
-       ("pciutils" ,pciutils)
+       ("minizip" ,minizip)
        ("nss" ,nss)
-       ("libxtst" ,libxtst)
-       ("gperf" ,gperf)
-       ("cups-minimal" ,cups-minimal)
+       ("opus" ,opus)
+       ("pciutils" ,pciutils)
+       ("protobuf" ,protobuf)
        ("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)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
        ("qtmultimedia" ,qtmultimedia)
-       ("re2c" ,re2c)
+       ("qtwebchannel" ,qtwebchannel)
+       ("re2" ,re2)
+       ("snappy" ,snappy)
+       ("udev" ,eudev)
+       ("xcb-util" ,xcb-util)
        ))
     (arguments
      `(#:phases
@@ -2386,7 +2409,11 @@ HostData=lib/qt5
            (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")))
+             (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
+                     "--webengine-printing-and-pdf=no"
+                     "--webengine-ffmpeg=system"
+                     "--webengine-icu=system"
+                     "--webengine-pepper-plugins=no")))
          (add-before 'check 'set-display
            (lambda _
              ;; make Qt render "offscreen", required for tests
-- 
2.21.0