Subject: [PATCH 3/8] gnu: Add zbar-minimal.

From: Nicolas Graves <[email-masked]>
Date: Sun, 24 Nov 2024 23:29:10 +0100

* gnu/packages/aidc.scm (zbar-minimal): New variable.
---
 gnu/packages/aidc.scm | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm
index 281f87dc78..58b5b9a6f6 100644
--- a/gnu/packages/aidc.scm
+++ b/gnu/packages/aidc.scm
@@ -46,7 +46,8 @@ (define-module (gnu packages aidc)
   #:use-module (gnu packages video)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system glib-or-gtk))
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system trivial))
 
 (define-public zxing-cpp
   ;; Use the master branch as it includes unreleased build system improvements
@@ -277,6 +278,30 @@ (define (move-output-file target file)
     (home-page "https://github.com/mchehab/zbar")
     (license license:lgpl2.1+)))
 
+(define-public zbar-minimal
+  (package
+    (inherit zbar)
+    (source #f)
+    (name "zbar-minimal")
+    (build-system trivial-build-system)
+    (arguments
+     (list
+      #:builder
+      (with-imported-modules '((guix build utils))
+        #~(begin
+            (use-modules (guix build utils))
+            (copy-recursively #$(this-package-native-input "zbar")
+                              #$output)
+            (substitute* (string-append #$output "/lib/pkgconfig/zbar.pc")
+              (("^prefix=.*")
+               (string-append "prefix=" #$output "\n")))))))
+    (outputs '("out"))
+    (native-inputs (modify-inputs (package-native-inputs zbar)
+                     (prepend zbar)))
+    (inputs (modify-inputs (package-inputs zbar)
+              (delete "qtx11extras")))
+    (propagated-inputs '())))
+
 (define-public qrcodegen-cpp
   (package
     (name "qrcodegen-cpp")
-- 
2.46.0