diff mbox series

[bug#56771,19/33] gnu: Add qtwebchannel, version 6.3.1.

Message ID 20220725230803.10002-19-maxim.cournoyer@gmail.com
State Accepted
Headers show
Series None | expand

Commit Message

Maxim Cournoyer July 25, 2022, 11:07 p.m. UTC
* gnu/packages/qt.scm (qtwebchannel): New variable.
---
 gnu/packages/qt.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a16b1285b4..b051fc5fe5 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1563,6 +1563,43 @@  (define-public qtwebchannel-5
 application).  The transport mechanism is supported out of the box by the two
 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
 
+(define-public qtwebchannel
+  (package
+    (name "qtwebchannel")
+    (version "6.3.1")
+    (source (origin
+              (method url-fetch)
+              (uri (qt5-urls name version))
+              (sha256
+               (base32
+                "0s16zx3qn3byldvhmsnwijm8rmizk8vpqj7fnwhjg6c67z10m8ma"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'check)      ;move after install
+                   (add-after 'install 'prepare-for-tests
+                     (lambda _
+                       (setenv "QT_QPA_PLATFORM" "offscreen")
+                       (setenv "QML2_IMPORT_PATH"
+                               (string-append #$output "/lib/qt6/qml:"
+                                              (getenv "QML2_IMPORT_PATH")))))
+                   (add-after 'prepare-for-tests 'check
+                     (assoc-ref %standard-phases 'check))
+                   (add-after 'check 'delete-installed-tests
+                     (lambda _
+                       (delete-file-recursively
+                        (string-append #$output "/tests")))))))
+    (native-inputs (list perl))
+    (inputs (list qtbase qtdeclarative qtwebsockets))
+    (home-page (package-home-page qtbase))
+    (synopsis "Web communication library for Qt")
+    (description "The Qt WebChannel module enables peer-to-peer communication
+between the host (QML/C++ application) and the client (HTML/JavaScript
+application).")
+    (license (package-license qtbase))))
+
 (define-public qtwebglplugin
   (package (inherit qtsvg-5)
     (name "qtwebglplugin")