Subject: [bug#58481] [PATCH 6/9] gnu: Add qtimageformats, version 6.3.1.

From: Cairn <[email-masked]>
Date: Thu, 13 Oct 2022 05:41:17 +0000

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

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 85f9c0716c..2d9923b19f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -986,6 +986,47 @@ (define-public qtimageformats-5
     (description "The QtImageFormats module contains plugins for adding
 support for MNG, TGA, TIFF and WBMP image formats.")))

+(define-public qtimageformats
+  (package (inherit qtsvg)
+    (name "qtimageformats")
+    (version "6.3.1")
+    (source (origin
+             (method url-fetch)
+             (uri (qt-urls name version))
+             (sha256
+              (base32
+               "0br1vqgx0hcc2nx32xviic94mvj6fbagrnzskdr7zdmvvyw140xd"))
+             (modules '((guix build utils)))
+             (snippet
+              '(begin
+                 (delete-file-recursively "src/3rdparty")
+                 #t))))
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-build
+                 (lambda _
+                   (substitute*
+                     "src/plugins/imageformats/jp2/qjp2handler.cpp"
+                     (("^#include <jasper/jasper.h>")
+                      "#include <jasper/jasper.h>\n#include <QtCore/qmath.h>"))))
+               (add-before 'check 'set-offscreen-display
+                 (lambda _
+                   ;; Make Qt render "offscreen", required for tests.
+                   (setenv "QT_QPA_PLATFORM" "offscreen")
+                   (setenv "HOME" "/tmp"))))))
+    (inputs
+     (list jasper
+           libmng
+           libtiff
+           libwebp
+           mesa
+           qtbase
+           zlib))
+    (synopsis "Additional Image Format plugins for Qt")
+    (description "The QtImageFormats module contains plugins for adding
+support for MNG, TGA, TIFF and WBMP image formats.")))
+
 (define-public qtx11extras
   (package (inherit qtsvg-5)
     (name "qtx11extras")
-- 

2.38.0