Subject: [PATCH 4/9] gnu: Add qtserialport, version 6.3.1.

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

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

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d589f653fb..d0d2c906a4 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1580,6 +1580,35 @@ (define-public qtserialport-5
     (description "The Qt Serial Port module provides the library for
 interacting with serial ports from within Qt.")))

+(define-public qtserialport
+  (package (inherit qtsvg)
+    (name "qtserialport")
+    (version "6.3.1")
+    (source (origin
+             (method url-fetch)
+             (uri (qt-urls name version))
+             (sha256
+              (base32
+               "0vk17cjj9jpdkgd8qwb1x0lijg0p2jxdzx4d67hd57brcl7didjf"))))
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-dlopen-paths
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "src/serialport/qtudev_p.h"
+                     ;; Use the absolute paths for dynamically loaded libs,
+                     ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
+                     ;; typically is not set in guix.
+                     (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
+                      (string-append a #$(this-package-input "eudev") "/lib/lib" b))))))))
+    (native-inputs
+     (list perl pkg-config))
+    (inputs
+     (list qtbase eudev))
+    (synopsis "Qt Serial Port module")
+    (description "The Qt Serial Port module provides the library for
+interacting with serial ports from within Qt.")))
+
 (define-public qtserialbus
   (package (inherit qtsvg-5)
     (name "qtserialbus")
-- 

2.38.0