* [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5.
@ 2024-11-24 22:09 Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:09 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
I found that curious that building gtk@4 inherently requires qtbase@5
in the store's inputs. Turns out it's based on a few libraries that
have optional graphical helping tools. I've disabled them using
minimal variants. After this patch series there are no input-only
path from gtk@4 to qtbase@5.
Nicolas Graves (8):
gnu: Add v4l-utils-minimal.
gnu: zbar: Split outputs.
gnu: Add zbar-minimal.
gnu: libde265: Remove unused qtbase-5 input.
gnu: libde265: Update to 1.0.14.
gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal.
gnu: gst-plugins-bad: Replace inputs with -minimal variants.
gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal.
gnu/packages/aidc.scm | 119 ++++++++++++++++++++++++++++++-------
gnu/packages/gstreamer.scm | 8 +--
gnu/packages/video.scm | 41 +++++++++----
3 files changed, 132 insertions(+), 36 deletions(-)
--
2.46.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal.
2024-11-24 22:09 [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs Nicolas Graves via Guix-patches via
` (8 more replies)
2024-11-25 2:38 ` [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Maxim Cournoyer
2024-11-25 3:11 ` Maxim Cournoyer
2 siblings, 9 replies; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/video.scm (v4l-utils-minimal): New variable.
---
gnu/packages/video.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 2da458ed01..4cc6735dca 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -4035,6 +4035,30 @@ (define-public v4l-utils
;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
(license (list license:lgpl2.1+ license:gpl2))))
+(define-public v4l-utils-minimal
+ (package
+ (inherit v4l-utils)
+ (source #f)
+ (name "v4l-utils-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 "v4l-utils")
+ #$output)
+ (substitute* (find-files (string-append #$output "/lib/pkgconfig")
+ "\\.pc$")
+ (("^prefix=.*")
+ (string-append "prefix=" #$output "\n")))))))
+ (outputs '("out"))
+ (native-inputs (modify-inputs (package-native-inputs v4l-utils)
+ (prepend v4l-utils)))
+ (inputs (modify-inputs (package-inputs v4l-utils)
+ (delete "qtbase")))))
+
(define-public obs
(package
(name "obs")
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-25 3:04 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal Nicolas Graves via Guix-patches via
` (7 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/aidc.scm (zbar): Split outputs.
[build-system]: Switch to glib-or-gtk-build-system.
[arguments]<#:configure-flags>: Add --disable-static.
<#:modules>: Use srfi-26 and gremlin's file-runpath.
<#:phases>: Add phase 'split-outputs.
[native-inputs]: Improve style.
[inputs]: Improve style. Replace v4l-utils by v4l-utils-minimal.
---
gnu/packages/aidc.scm | 94 +++++++++++++++++++++++++++++++++----------
1 file changed, 73 insertions(+), 21 deletions(-)
diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm
index bc9c47a480..281f87dc78 100644
--- a/gnu/packages/aidc.scm
+++ b/gnu/packages/aidc.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2018, 2019, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -30,6 +31,7 @@ (define-module (gnu packages aidc)
#:use-module (guix git-download)
#:use-module (gnu packages autotools)
#:use-module (gnu packages check)
+ #:use-module (gnu packages elf)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
@@ -43,7 +45,8 @@ (define-module (gnu packages aidc)
#:use-module (gnu packages qt)
#:use-module (gnu packages video)
#:use-module (guix build-system cmake)
- #:use-module (guix build-system gnu))
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system glib-or-gtk))
(define-public zxing-cpp
;; Use the master branch as it includes unreleased build system improvements
@@ -184,32 +187,81 @@ (define-public zbar
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32
- "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n"))))
- (build-system gnu-build-system)
+ (base32 "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n"))))
+ (build-system glib-or-gtk-build-system)
+ ;; XXX: qt output is broken: zbarcam-qt fails with segmentation fault, but
+ ;; this error happened before the output split.
+ (outputs '("out" "gtk" "qt"))
(arguments
- '(#:configure-flags (list "--with-gtk=auto"
+ (list
+ #:configure-flags '(list "--disable-static"
+ "--with-gtk=auto"
"--with-python=auto"
(string-append "--with-dbusconfdir="
(assoc-ref %outputs "out")
- "/etc"))))
+ "/etc"))
+ #:modules `(((guix build gremlin) #:select (file-runpath))
+ (srfi srfi-26)
+ ,@%glib-or-gtk-build-system-modules)
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'split-outputs
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gtk (assoc-ref outputs "gtk")))
+
+ ;; XXX: Using set-file-runpath leads to runpath-too-long-error
+ (define (prepend-to-runpath path file)
+ (invoke "patchelf" "--set-rpath"
+ (string-join (cons* path (file-runpath file)) ":")
+ file))
+
+ (define (move-output-file target file)
+ (let* ((source (string-append out file))
+ (destination (string-append target file)))
+ (mkdir-p (dirname destination))
+ (rename-file source destination)
+ (when (and (eq? (stat:type (lstat destination)) 'regular)
+ (elf-file? destination))
+ (prepend-to-runpath
+ (string-append out "/lib:" target "/lib")
+ destination))))
+
+ (for-each
+ (lambda (kind)
+ (for-each
+ (cut move-output-file (assoc-ref outputs kind) <>)
+ (cons*
+ (string-append "/lib/pkgconfig/zbar-" kind ".pc")
+ (string-append "/bin/zbarcam-" kind)
+ (map (cut string-drop <> 1)
+ (with-directory-excursion out
+ (find-files
+ "./lib"
+ (string-append "lib.*" kind "\\.so.*")))))))
+ '("gtk" "qt"))
+
+ (for-each
+ (cut move-output-file gtk <>)
+ '("/share/gir-1.0" "/lib/girepository-1.0"))))))))
(native-inputs
- `(("autoconf" ,autoconf)
- ("automake" ,automake)
- ("gettext" ,gettext-minimal)
- ("glib" ,glib "bin")
- ("gobject-introspection" ,gobject-introspection)
- ("libtool" ,libtool)
- ("pkg-config" ,pkg-config)
- ("python-wrapper" ,python-wrapper)))
+ (list autoconf
+ automake
+ gettext-minimal
+ `(,glib "bin")
+ gobject-introspection
+ libtool
+ patchelf
+ pkg-config
+ python-wrapper))
(inputs
- `(("dbus" ,dbus)
- ("imagemagick" ,imagemagick)
- ("libjpeg" ,libjpeg-turbo)
- ("perl" ,perl)
- ("python" ,python)
- ("qtx11extras" ,qtx11extras)
- ("v4l-utils" ,v4l-utils)))
+ (list dbus
+ imagemagick
+ libjpeg-turbo
+ perl
+ python
+ qtx11extras
+ v4l-utils-minimal))
(propagated-inputs
;; These are in 'requires' field of .pc files.
(list glib gtk+ qtbase-5))
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-25 3:08 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input Nicolas Graves via Guix-patches via
` (6 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* 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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-25 3:08 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14 Nicolas Graves via Guix-patches via
` (5 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/video.scm (libde265)
[native-inputs]: Improve style.
[inputs]: Improve style. Remove qtbase-5 which wasn't actually
used (need more inputs to build graphical tools).
---
gnu/packages/video.scm | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 4cc6735dca..8dd647bf20 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -711,16 +711,11 @@ (define-public libde265
`(#:configure-flags
(list "--disable-static")))
(native-inputs
- `(("autoconf" ,autoconf)
- ("automake" ,automake)
- ("libtool" ,libtool)
- ("pkg-config" ,pkg-config)
- ("python" ,python-wrapper)))
+ (list autoconf automake libtool pkg-config python-wrapper))
(inputs
- `(;; XXX: Build fails with libvideogfx.
- ;; ("libvideogfx" ,libvideogfx)
- ("qt" ,qtbase-5)
- ("sdl" ,sdl)))
+ ;; XXX: Build a complete version using libswscale or libvideogfx
+ ;; and qtbase-5.
+ (list sdl))
(synopsis "H.265 video codec implementation")
(description "Libde265 is an implementation of the h.265 video codec. It is
written from scratch and has a plain C API to enable a simple integration into
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (2 preceding siblings ...)
2024-11-24 22:29 ` [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-25 3:09 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 6/8] gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
` (4 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/video.scm (libde265): Update to 1.0.14.
[inputs]: Replace sdl by sdl2.
---
gnu/packages/video.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 8dd647bf20..84e4a4fe3a 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -695,7 +695,7 @@ (define-public libvideogfx
(define-public libde265
(package
(name "libde265")
- (version "1.0.8")
+ (version "1.0.14")
(source
(origin
(method git-fetch)
@@ -705,7 +705,7 @@ (define-public libde265
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1dzflqbk248lz5ws0ni5acmf32b3rmnq5gsfaz7691qqjxkl1zml"))))
+ (base32 "1a4n1hnr9ybji87irg2kya95slf4jnybnkg4x2zihnqqihbnv539"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
@@ -715,7 +715,7 @@ (define-public libde265
(inputs
;; XXX: Build a complete version using libswscale or libvideogfx
;; and qtbase-5.
- (list sdl))
+ (list sdl2))
(synopsis "H.265 video codec implementation")
(description "Libde265 is an implementation of the h.265 video codec. It is
written from scratch and has a plain C API to enable a simple integration into
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 6/8] gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (3 preceding siblings ...)
2024-11-24 22:29 ` [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14 Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 7/8] gnu: gst-plugins-bad: Replace inputs with -minimal variants Nicolas Graves via Guix-patches via
` (3 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/gstreamer.scm (libdc1394)[inputs]: Replace v4l-utils by
v4l-utils-minimal.
---
gnu/packages/gstreamer.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 13c8734e68..5ce33faa51 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -160,7 +160,7 @@ (define-public libdc1394
libxv
mesa
sdl
- v4l-utils))
+ v4l-utils-minimal))
(synopsis "1394-Based Digital Camera Control Library")
(description "LibDC1394 is a library that provides functionality to control
any camera that conforms to the 1394-Based Digital Camera Specification written
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 7/8] gnu: gst-plugins-bad: Replace inputs with -minimal variants.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (4 preceding siblings ...)
2024-11-24 22:29 ` [bug#74517] [PATCH 6/8] gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 8/8] gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
` (2 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/gstreamer.scm (gst-plugins-bad)[inputs]: Replace
v4l-utils by v4l-utils-minimal. Replace zbar by zbar-minimal.
---
gnu/packages/gstreamer.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 5ce33faa51..bb1bdcb4a1 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -936,7 +936,7 @@ (define-public gst-plugins-bad
tinyalsa
transcode
usrsctp
- v4l-utils
+ v4l-utils-minimal
vo-aacenc
vo-amrwbenc
vulkan-headers
@@ -946,7 +946,7 @@ (define-public gst-plugins-bad
webrtc-audio-processing
wildmidi
wpebackend-fdo
- zbar
+ zbar-minimal
zxing-cpp-1.2)))
(home-page "https://gstreamer.freedesktop.org/")
(synopsis "Plugins for the GStreamer multimedia library")
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 8/8] gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (5 preceding siblings ...)
2024-11-24 22:29 ` [bug#74517] [PATCH 7/8] gnu: gst-plugins-bad: Replace inputs with -minimal variants Nicolas Graves via Guix-patches via
@ 2024-11-24 22:29 ` Nicolas Graves via Guix-patches via
2024-11-25 2:54 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Maxim Cournoyer
2024-11-25 2:56 ` Maxim Cournoyer
8 siblings, 0 replies; 17+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-24 22:29 UTC (permalink / raw)
To: 74517; +Cc: Nicolas Graves
* gnu/packages/gstreamer.scm (gst-plugins-good)[inputs]: Replace
v4l-utils by v4l-utils-minimal.
---
gnu/packages/gstreamer.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index bb1bdcb4a1..905ac2d79a 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -732,7 +732,7 @@ (define libsoup
speex
taglib
twolame
- v4l-utils
+ v4l-utils-minimal
wavpack
zlib))
(propagated-inputs
--
2.46.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5.
2024-11-24 22:09 [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
@ 2024-11-25 2:38 ` Maxim Cournoyer
2024-11-25 3:11 ` Maxim Cournoyer
2 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 2:38 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Hi Nicolas,
Nicolas Graves <ngraves@ngraves.fr> writes:
> I found that curious that building gtk@4 inherently requires qtbase@5
> in the store's inputs. Turns out it's based on a few libraries that
> have optional graphical helping tools. I've disabled them using
> minimal variants. After this patch series there are no input-only
> path from gtk@4 to qtbase@5.
I agree that was sub-optimal, thank you for addressing that. This
actually would resolve #51994 I had reported some time ago ("GTK 4
requires qtbase through various sources (gstreamer plugins)"), so you
(or the person who pushes) should add this as a git trailer:
--8<---------------cut here---------------start------------->8---
Fixes: https://issues.guix.gnu.org/51994
--8<---------------cut here---------------end--------------->8---
and close the associate bug after it's pushed.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (6 preceding siblings ...)
2024-11-24 22:29 ` [bug#74517] [PATCH 8/8] gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
@ 2024-11-25 2:54 ` Maxim Cournoyer
2024-11-25 2:56 ` Maxim Cournoyer
8 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 2:54 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Hi,
Nicolas Graves <ngraves@ngraves.fr> writes:
> * gnu/packages/video.scm (v4l-utils-minimal): New variable.
> ---
> gnu/packages/video.scm | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 2da458ed01..4cc6735dca 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -4035,6 +4035,30 @@ (define-public v4l-utils
> ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
> (license (list license:lgpl2.1+ license:gpl2))))
>
> +(define-public v4l-utils-minimal
> + (package
> + (inherit v4l-utils)
> + (source #f)
> + (name "v4l-utils-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 "v4l-utils")
> + #$output)
> + (substitute* (find-files (string-append #$output "/lib/pkgconfig")
> + "\\.pc$")
> + (("^prefix=.*")
> + (string-append "prefix=" #$output "\n")))))))
> + (outputs '("out"))
I don't understand how this resolves the issue, at a glance. Is the
issue that some v4l-utils tools, kept in a distinct output, are referred
to in the pkg-config files, present in the main output?
A comment explaining would be beneficial, but mostly I would rather we
use the more traditional style of rebuilding the package with the
modified inputs, so that it's cleanly built as a 'qtbase-less' variant;
that should lead to less bad surprises down the road, at the expense of
a bit more computation, which we can afford.
As a variant (a package sharing the same source but using different
inputs/build flags), the package should be defined via
'package/inherit', which will honor the parent package's replacements
(grafts).
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
` (7 preceding siblings ...)
2024-11-25 2:54 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Maxim Cournoyer
@ 2024-11-25 2:56 ` Maxim Cournoyer
8 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 2:56 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Also,
> * gnu/packages/video.scm (v4l-utils-minimal): New variable.
I'd explain in a comment what this variant is for (break dependency on
Qt); better yet, a #:disallowed-reference could be use along such
comment to ensure the property is preserved in time.
Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs.
2024-11-24 22:29 ` [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs Nicolas Graves via Guix-patches via
@ 2024-11-25 3:04 ` Maxim Cournoyer
0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 3:04 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Hi,
Nicolas Graves <ngraves@ngraves.fr> writes:
> * gnu/packages/aidc.scm (zbar): Split outputs.
> [build-system]: Switch to glib-or-gtk-build-system.
> [arguments]<#:configure-flags>: Add --disable-static.
> <#:modules>: Use srfi-26 and gremlin's file-runpath.
> <#:phases>: Add phase 'split-outputs.
> [native-inputs]: Improve style.
> [inputs]: Improve style. Replace v4l-utils by v4l-utils-minimal.
> ---
> gnu/packages/aidc.scm | 94 +++++++++++++++++++++++++++++++++----------
> 1 file changed, 73 insertions(+), 21 deletions(-)
[...]
> (define-public zxing-cpp
> ;; Use the master branch as it includes unreleased build system improvements
> @@ -184,32 +187,81 @@ (define-public zbar
> (commit version)))
> (file-name (git-file-name name version))
> (sha256
> - (base32
> - "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n"))))
> - (build-system gnu-build-system)
> + (base32 "0rf3i7lx0fqzxsngird6l4d4dnl612nr32rm8sib699qqx67px8n"))))
> + (build-system glib-or-gtk-build-system)
> + ;; XXX: qt output is broken: zbarcam-qt fails with segmentation fault, but
> + ;; this error happened before the output split.
As an alternative to packaging broken outputs, perhaps we could simply
tell the build system to not build with Qt, or wholly remove it from the
inputs?
> + (outputs '("out" "gtk" "qt"))
> (arguments
> - '(#:configure-flags (list "--with-gtk=auto"
> + (list
> + #:configure-flags '(list "--disable-static"
> + "--with-gtk=auto"
> "--with-python=auto"
> (string-append "--with-dbusconfdir="
> (assoc-ref %outputs "out")
> - "/etc"))))
> + "/etc"))
> + #:modules `(((guix build gremlin) #:select (file-runpath))
> + (srfi srfi-26)
> + ,@%glib-or-gtk-build-system-modules)
> + #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'install 'split-outputs
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out"))
> + (gtk (assoc-ref outputs "gtk")))
This can be rewritten using the gexp variabls #$output and #$output:gtk.
> +
> + ;; XXX: Using set-file-runpath leads to runpath-too-long-error
> + (define (prepend-to-runpath path file)
> + (invoke "patchelf" "--set-rpath"
> + (string-join (cons* path (file-runpath file)) ":")
> + file))
> +
> + (define (move-output-file target file)
> + (let* ((source (string-append out file))
> + (destination (string-append target file)))
> + (mkdir-p (dirname destination))
> + (rename-file source destination)
> + (when (and (eq? (stat:type (lstat destination)) 'regular)
> + (elf-file? destination))
> + (prepend-to-runpath
> + (string-append out "/lib:" target "/lib")
> + destination))))
> +
> + (for-each
> + (lambda (kind)
> + (for-each
> + (cut move-output-file (assoc-ref outputs kind) <>)
> + (cons*
> + (string-append "/lib/pkgconfig/zbar-" kind ".pc")
> + (string-append "/bin/zbarcam-" kind)
> + (map (cut string-drop <> 1)
> + (with-directory-excursion out
> + (find-files
> + "./lib"
> + (string-append "lib.*" kind "\\.so.*")))))))
> + '("gtk" "qt"))
> +
> + (for-each
> + (cut move-output-file gtk <>)
> + '("/share/gir-1.0" "/lib/girepository-1.0"))))))))
That is clever, perhaps too clever (in comparison to the simple brute
force approach of using a distinct minimal package variant built without
the extra inputs) :-).
> (native-inputs
> - `(("autoconf" ,autoconf)
> - ("automake" ,automake)
> - ("gettext" ,gettext-minimal)
> - ("glib" ,glib "bin")
> - ("gobject-introspection" ,gobject-introspection)
> - ("libtool" ,libtool)
> - ("pkg-config" ,pkg-config)
> - ("python-wrapper" ,python-wrapper)))
> + (list autoconf
> + automake
> + gettext-minimal
> + `(,glib "bin")
> + gobject-introspection
> + libtool
> + patchelf
> + pkg-config
> + python-wrapper))
> (inputs
> - `(("dbus" ,dbus)
> - ("imagemagick" ,imagemagick)
> - ("libjpeg" ,libjpeg-turbo)
> - ("perl" ,perl)
> - ("python" ,python)
> - ("qtx11extras" ,qtx11extras)
> - ("v4l-utils" ,v4l-utils)))
> + (list dbus
> + imagemagick
> + libjpeg-turbo
> + perl
> + python
> + qtx11extras
> + v4l-utils-minimal))
Could be done in a separate commit; this entangles concern and makes it
easier if in the future a revert needs to be made.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal.
2024-11-24 22:29 ` [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal Nicolas Graves via Guix-patches via
@ 2024-11-25 3:08 ` Maxim Cournoyer
0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 3:08 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Hi Nicolas,
Nicolas Graves <ngraves@ngraves.fr> writes:
> * 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 '())))
I see; the previous commit neatly organized dependencies on gtk/qt in
separate outputs, and this variant ensures any reference to these output
is severed, without any rebuild. It's a researched approach, but I'm a
bit worried about long term maintenance/correctness; I feel a classic
variant rebuilt without the problematic inputs would be both easier to
understand and maintain in the long term.
Also, same earlier comments hold about package/inherit and using
#:disallowed-reference along with an explanatory comment.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input.
2024-11-24 22:29 ` [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input Nicolas Graves via Guix-patches via
@ 2024-11-25 3:08 ` Maxim Cournoyer
0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 3:08 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Nicolas Graves <ngraves@ngraves.fr> writes:
> * gnu/packages/video.scm (libde265)
> [native-inputs]: Improve style.
> [inputs]: Improve style. Remove qtbase-5 which wasn't actually
> used (need more inputs to build graphical tools).
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14.
2024-11-24 22:29 ` [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14 Nicolas Graves via Guix-patches via
@ 2024-11-25 3:09 ` Maxim Cournoyer
0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 3:09 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Nicolas Graves <ngraves@ngraves.fr> writes:
> * gnu/packages/video.scm (libde265): Update to 1.0.14.
> [inputs]: Replace sdl by sdl2.
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
* [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5.
2024-11-24 22:09 [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-25 2:38 ` [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Maxim Cournoyer
@ 2024-11-25 3:11 ` Maxim Cournoyer
2 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-11-25 3:11 UTC (permalink / raw)
To: Nicolas Graves; +Cc: 74517
Hi,
Nicolas Graves <ngraves@ngraves.fr> writes:
> I found that curious that building gtk@4 inherently requires qtbase@5
> in the store's inputs. Turns out it's based on a few libraries that
> have optional graphical helping tools. I've disabled them using
> minimal variants. After this patch series there are no input-only
> path from gtk@4 to qtbase@5.
>
> Nicolas Graves (8):
> gnu: Add v4l-utils-minimal.
> gnu: zbar: Split outputs.
> gnu: Add zbar-minimal.
> gnu: libde265: Remove unused qtbase-5 input.
I left some comments; I think I'd prefer a simpler rebuilt variant
solution compared to the fancier but more frail (because of more
complex) runpath hacking/trivial-build-system copying business involved
in this version.
> gnu: libde265: Update to 1.0.14.
> gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal.
> gnu: gst-plugins-bad: Replace inputs with -minimal variants.
> gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal.
These LGTM.
Thanks a lot for tackling this problem!
--
Maxim
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-11-25 3:13 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-24 22:09 [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 2/8] gnu: zbar: Split outputs Nicolas Graves via Guix-patches via
2024-11-25 3:04 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 3/8] gnu: Add zbar-minimal Nicolas Graves via Guix-patches via
2024-11-25 3:08 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 4/8] gnu: libde265: Remove unused qtbase-5 input Nicolas Graves via Guix-patches via
2024-11-25 3:08 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 5/8] gnu: libde265: Update to 1.0.14 Nicolas Graves via Guix-patches via
2024-11-25 3:09 ` Maxim Cournoyer
2024-11-24 22:29 ` [bug#74517] [PATCH 6/8] gnu: libdc1394: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 7/8] gnu: gst-plugins-bad: Replace inputs with -minimal variants Nicolas Graves via Guix-patches via
2024-11-24 22:29 ` [bug#74517] [PATCH 8/8] gnu: gst-plugins-good: Replace v4l-utils by v4l-utils-minimal Nicolas Graves via Guix-patches via
2024-11-25 2:54 ` [bug#74517] [PATCH 1/8] gnu: Add v4l-utils-minimal Maxim Cournoyer
2024-11-25 2:56 ` Maxim Cournoyer
2024-11-25 2:38 ` [bug#74517] [PATCH 0/8] Remove gtk@4 input dependency on qtbase@5 Maxim Cournoyer
2024-11-25 3:11 ` Maxim Cournoyer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.