package/pkg-cargo: add support to bundle a custom Cargo.lock file
PATCH v5 1/3 package/pkg-cargo: add support to bundle a custom Cargo.lock file
E.g. https://github.com/lu-zero/cargo-c/releases/tag/v0.10.15
Cargo-c releases a separate Cargo.lock file, but doesn't bundle one in its normal .tar.gz code source target.
We can't use extra downloads/patches/... as cargo is a vendored package, which is done quite early in the chain.
This patch allows us to define a custom Cargo.lock source. Both a local bundled file and remote (only wget) file can be linked.
Usage:
<PKG>_CARGO_LOCK_FILE = <PKG>_PKGDIR/Cargo.lock
<PKG>_CARGO_LOCK_FILE = https://.../Cargo.lock
---
Superseeds https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.
v2: no change
v3: no change
v4: no change
v4: no change
--- package/pkg-cargo.mk | 5 +++++ support/download/cargo-post-process | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
package/pkg-cargo.mk +5 -0
@@ -195,6 +195,11 @@ ifneq ($$($(2)_SUBDIR),) $(2)_DOWNLOAD_POST_PROCESS_OPTS += -m$$($(2)_SUBDIR)/Cargo.toml endif +# Allow to download a custom Cargo.lock file. +ifneq ($$($(3)_CARGO_LOCK_FILE),) +$(2)_DOWNLOAD_POST_PROCESS_OPTS += -l$$($(3)_CARGO_LOCK_FILE) +endif + # Because we append vendored info, we can't rely on the values being empty # once we eventually get into the generic-package infra. So, we duplicate # the heuristics here
support/download/cargo-post-process +13 -1
@@ -11,11 +11,12 @@ if [ "${BR_CARGO_MANIFEST_PATH}" ]; then fi manifest=Cargo.toml -while getopts "n:o:m:" OPT; do +while getopts "n:o:m:l:" OPT; do case "${OPT}" in o) output="${OPTARG}";; n) base_name="${OPTARG}";; m) manifest="${OPTARG}";; + l) lockfile="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
@@ -31,6 +32,17 @@ post_process_unpack "${base_name}" "${output}" # Do the Cargo vendoring pushd "${base_name}" > /dev/null +# Copy the custom lockfile path if given +# TODO: use --lockfile-path once stable +if [ -n "${lockfile}" ] ; then + rm -f "${lockfile}" + if [ -f "${lockfile}" ] ; then + cp "${lockfile}" Cargo.lock + else + ${WGET} "${lockfile}" -O Cargo.lock + fi +fi + # Create the local .cargo/config.toml with vendor info mkdir -p .cargo/ mkdir -p "${CARGO_HOME}"
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 2/3 package/cargo-c: add new package
From: Guillaume Chaye <[email protected]>
Cargo-c is a cargo applet to build and install C-ABI compatible dynamic and static libraries.
It will be required for librsvg.
---
Superseeds https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.
v2: no change
v3: no change
v4: no change
v5: no change
--- DEVELOPERS | 1 + package/cargo-c/cargo-c.hash | 3 +++ package/cargo-c/cargo-c.mk | 15 +++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 package/cargo-c/cargo-c.hash create mode 100644 package/cargo-c/cargo-c.mk
DEVELOPERS +1 -0
@@ -1363,6 +1363,7 @@ F: package/rpi-rgb-led-matrix/ N: Guillaume Chaye <[email protected]> F: package/sane-airscan/ +F: package/cargo-c/ N: Guillaume William Brs <[email protected]> F: package/libnids/
package/cargo-c/cargo-c.hash new file +3 -0
@@ -0,0 +1,3 @@ +# locally computed +sha256 757034535d42b345cd7b47c9d5e3624073332437805634153a19259439491be2 cargo-c-0.10.15-cargo4.tar.gz +sha256 d69f24ad84ec2ade64c0b68bdb31b41170e997b158370342056918329cc9af1e LICENSE
package/cargo-c/cargo-c.mk new file +15 -0
@@ -0,0 +1,15 @@ +################################################################################ +# +# cargo-c +# +################################################################################ + +CARGO_C_VERSION = 0.10.15 +CARGO_C_SITE = $(call github,lu-zero,cargo-c,v$(CARGO_C_VERSION)) +CARGO_C_CARGO_LOCK_FILE = https://github.com/lu-zero/cargo-c/releases/download/v$(CARGO_C_VERSION)/Cargo.lock +CARGO_C_LICENSE = MIT +CARGO_C_LICENSE_FILES = LICENSE + +HOST_CARGO_C_DEPENDENCIES = host-libopenssl host-pkgconf + +$(eval $(host-cargo-package))
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 3/3 package/librsvg: bump version to 2.61.1
In reply to Thomas DevoogdtThis is a major update, which replaces autotools with meson. The package uses cargo in the background, so copy the relevant environment from the cargo package to get things working.
Note that the download URL has been changed because cargo vendoring needs .tar.gz for it's post_process_unpack.
Announcement (for what it's worth):
- https://gitlab.gnome.org/GNOME/librsvg/-/releases/2.61.1
---
cat libgtk4.config
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_LIBGTK4=y
./utils/test-pkg -p libgtk4 -c libgtk4.config -a
arm-aarch64 [ 1/35]: OK
bootlin-aarch64-glibc [ 2/35]: OK
bootlin-arcle-hs38-uclibc [ 3/35]: SKIPPED
bootlin-armv5-uclibc [ 4/35]: SKIPPED
bootlin-armv7-glibc [ 5/35]: OK
bootlin-armv7m-uclibc [ 6/35]: SKIPPED
bootlin-armv7-musl [ 7/35]: OK
bootlin-m68k-5208-uclibc [ 8/35]: SKIPPED
bootlin-m68k-68040-uclibc [ 9/35]: SKIPPED
bootlin-microblazeel-uclibc [10/35]: SKIPPED
bootlin-mipsel32r6-glibc [11/35]: SKIPPED
bootlin-mipsel-uclibc [12/35]: SKIPPED
bootlin-openrisc-uclibc [13/35]: SKIPPED
bootlin-powerpc64le-power8-glibc [14/35]: OK
bootlin-powerpc-e500mc-uclibc [15/35]: SKIPPED
bootlin-riscv32-glibc [16/35]: SKIPPED
bootlin-riscv64-glibc [17/35]: SKIPPED
bootlin-riscv64-musl [18/35]: SKIPPED
bootlin-s390x-z13-glibc [19/35]: OK
bootlin-sh4-uclibc [20/35]: SKIPPED
bootlin-sparc64-glibc [21/35]: OK
bootlin-sparc-uclibc [22/35]: SKIPPED
bootlin-x86-64-glibc [23/35]: OK
bootlin-x86-64-musl [24/35]: OK
bootlin-x86-64-uclibc [25/35]: SKIPPED
bootlin-x86-i686-musl [26/35]: OK
bootlin-xtensa-uclibc [27/35]: SKIPPED
br-arm-basic [28/35]: SKIPPED
br-arm-full-nothread [29/35]: SKIPPED
br-arm-full-static [30/35]: SKIPPED
br-i386-pentium4-full [31/35]: SKIPPED
br-mips64-n64-full [32/35]: SKIPPED
br-mips64r6-el-hf-glibc [33/35]: SKIPPED
br-powerpc-603e-basic-cpp [34/35]: SKIPPED
br-powerpc64-power7-glibc [35/35]: OK35 builds, 24 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
v2:
- added cargo vendoring for the DL phase
- disabled rsvg-convert by default to fix some compile errors v3:
- Ensure that -cargo4 is part of the dl file.
v4:
- Dropped LIBRSVG_SOURCE, not needed to define.
v5:
- Dropped 0001-cargo_wrapper-fixup-the-usage-of-cargo_c.patch, not needed, buildroot defines the right PATH already.
--- ...r-Makefile.am-set-GDK_PIXBUF_MODULED.patch | 41 ------------- ...ake-building-rsvg-convert-selectable.patch | 59 ++++++++++++++++++ package/librsvg/librsvg.hash | 4 +- package/librsvg/librsvg.mk | 60 +++++++++++++------ 4 files changed, 102 insertions(+), 62 deletions(-) delete mode 100644 package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch create mode 100644 package/librsvg/0001-meson-make-building-rsvg-convert-selectable.patch
package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch deleted +0 -41
@@ -1,41 +0,0 @@ -From 2c472bf55289ccbd7f305aa3e98d6fd70be4e3ab Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <[email protected]> -Date: Sat, 19 Feb 2022 12:02:10 +0100 -Subject: [PATCH] gdk-pixbuf-loader/Makefile.am: set GDK_PIXBUF_MODULEDIR - -Set GDK_PIXBUF_MODULEDIR to gdk_pixbuf_moduledir before calling -gdk-pixbuf-query-loaders to build a correct gdk_pixbuf_cache_file and -gdk-pixbuf.loaders on 'exotic' systems - -Signed-off-by: Fabrice Fontaine <[email protected]> -[Upstream status: -https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/668] ---- - gdk-pixbuf-loader/Makefile.am | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdk-pixbuf-loader/Makefile.am b/gdk-pixbuf-loader/Makefile.am -index c3493736..de1f9641 100644 ---- a/gdk-pixbuf-loader/Makefile.am -+++ b/gdk-pixbuf-loader/Makefile.am -@@ -49,7 +49,7 @@ rsvg_loader_LDADD = \ - EXTRA_rsvg_loader_DEPENDENCIES = libpixbufloader-svg.la gdk-pixbuf-loaders - - gdk-pixbuf-loaders: Makefile -- $(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null -+ $(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null - - if CROSS_COMPILING - RUN_QUERY_LOADER_TEST=false -@@ -68,7 +68,7 @@ endif - install-data-hook: - @if $(RUN_QUERY_LOADER_TEST) ; then \ - $(mkinstalldirs) $(DESTDIR)$(gdk_pixbuf_binarydir) ; \ -- $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \ -+ GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \ - else \ - echo "***" ; \ - echo "*** Warning: loaders.cache not built" ; \ --- -2.34.1 -
package/librsvg/0001-meson-make-building-rsvg-convert-selectable.patch new file +59 -0
59 lines not on this page · raw message
package/librsvg/librsvg.hash +1 -3
@@ -1,5 +1,3 @@ -# From https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.9.sha256sum -sha256 518905fffa879b6c7f3db1aae961cf31333e0eadc7b4cdd4f531707868c54b53 librsvg-2.50.9.tar.xz - # Locally computed +sha256 902edb88757cdb33bb2c660527768733a57487a8b6ed597ea492055f25345b13 librsvg-2.61.1-cargo4.tar.gz sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
package/librsvg/librsvg.mk +42 -18
73 lines not on this page · raw message
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi all,
I just see that I made a typo.
+ rm -f "${lockfile}"
It's obviously not the new file that should be removed, but the the existing Cargo.lock file.
I will push a new update when I have time, or take it into account when applying the patch. Thanks.
Kind regards
Thomas Devoogdt
Op di 30 sep 2025, 10:07 schreef Thomas Devoogdt <[email protected]>:
Quoted 86 lines
E.g. https://github.com/lu-zero/cargo-c/releases/tag/v0.10.15
Cargo-c releases a separate Cargo.lock file, but doesn't bundle one in its normal .tar.gz code source target.
We can't use extra downloads/patches/... as cargo is a vendored package, which is done quite early in the chain.
This patch allows us to define a custom Cargo.lock source. Both a local bundled file and remote (only wget) file can be linked.
Usage:
<PKG>_CARGO_LOCK_FILE = <PKG>_PKGDIR/Cargo.lock
<PKG>_CARGO_LOCK_FILE = https://.../Cargo.lock
Signed-off-by Thomas Devoogdt <[email protected]>---
Superseeds
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.
v2
<https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.v2>:
no change
v3: no change
v4: no change
v4: no change--- package/pkg-cargo.mk | 5 +++++ support/download/cargo-post-process | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)package/pkg-cargo.mk +5
-0@@ -195,6 +195,11 @@ ifneq ($$($(2)_SUBDIR),) $(2)_DOWNLOAD_POST_PROCESS_OPTS += -m$$($(2)_SUBDIR)/Cargo.toml endif +# Allow to download a custom Cargo.lock file. +ifneq ($$($(3)_CARGO_LOCK_FILE),) +$(2)_DOWNLOAD_POST_PROCESS_OPTS += -l$$($(3)_CARGO_LOCK_FILE) +endif + # Because we append vendored info, we can't rely on the values being empty # once we eventually get into the generic-package infra. So, we duplicate # the heuristics heresupport/download/cargo-post-process +13
-2@@ -11,11 +11,12 @@ if [ "${BR_CARGO_MANIFEST_PATH}" ]; then fi manifest=Cargo.toml -while getopts "n:o:m:" OPT; do +while getopts "n:o:m:l:" OPT; do case "${OPT}" in o) output="${OPTARG}";; n) base_name="${OPTARG}";; m) manifest="${OPTARG}";; + l) lockfile="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac@@ -31,6 +32,17 @@ post_process_unpack "${base_name}" "${output}" # Do the Cargo vendoring pushd "${base_name}" > /dev/null +# Copy the custom lockfile path if given +# TODO: use --lockfile-path once stable +if [ -n "${lockfile}" ] ; then + rm -f "${lockfile}" + if [ -f "${lockfile}" ] ; then + cp "${lockfile}" Cargo.lock + else + ${WGET} "${lockfile}" -O Cargo.lock + fi +fi + # Create the local .cargo/config.toml with vendor info mkdir -p .cargo/ mkdir -p "${CARGO_HOME}" --
Quoted 3 lines
2.43.0
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v6 1/3 package/pkg-cargo: add support to bundle a custom Cargo.lock file
E.g. https://github.com/lu-zero/cargo-c/releases/tag/v0.10.15
Cargo-c releases a separate Cargo.lock file, but doesn't bundle one in its normal .tar.gz code source target.
We can't use extra downloads/patches/... as cargo is a vendored package, which is done quite early in the chain.
This patch allows us to define a custom Cargo.lock source. Both a local bundled file and remote (only wget) file can be linked.
Usage:
<PKG>_CARGO_LOCK_FILE = <PKG>_PKGDIR/Cargo.lock
<PKG>_CARGO_LOCK_FILE = https://.../Cargo.lock
Superseeds https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.
v2: no change
v3: no change
v4: no change
v5: no change
v6: fixed 'rm -f Cargo.lock'
--- package/pkg-cargo.mk | 5 +++++ support/download/cargo-post-process | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
package/pkg-cargo.mk +5 -0
@@ -195,6 +195,11 @@ ifneq ($$($(2)_SUBDIR),) $(2)_DOWNLOAD_POST_PROCESS_OPTS += -m$$($(2)_SUBDIR)/Cargo.toml endif +# Allow to download a custom Cargo.lock file. +ifneq ($$($(3)_CARGO_LOCK_FILE),) +$(2)_DOWNLOAD_POST_PROCESS_OPTS += -l$$($(3)_CARGO_LOCK_FILE) +endif + # Because we append vendored info, we can't rely on the values being empty # once we eventually get into the generic-package infra. So, we duplicate # the heuristics here
support/download/cargo-post-process +13 -1
@@ -11,11 +11,12 @@ if [ "${BR_CARGO_MANIFEST_PATH}" ]; then fi manifest=Cargo.toml -while getopts "n:o:m:" OPT; do +while getopts "n:o:m:l:" OPT; do case "${OPT}" in o) output="${OPTARG}";; n) base_name="${OPTARG}";; m) manifest="${OPTARG}";; + l) lockfile="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
@@ -31,6 +32,17 @@ post_process_unpack "${base_name}" "${output}" # Do the Cargo vendoring pushd "${base_name}" > /dev/null +# Copy the custom lockfile path if given +# TODO: use --lockfile-path once stable +if [ -n "${lockfile}" ] ; then + rm -f Cargo.lock + if [ -f "${lockfile}" ] ; then + cp "${lockfile}" Cargo.lock + else + ${WGET} "${lockfile}" -O Cargo.lock + fi +fi + # Create the local .cargo/config.toml with vendor info mkdir -p .cargo/ mkdir -p "${CARGO_HOME}"
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v6 2/3 package/cargo-c: add new package
From: Guillaume Chaye <[email protected]>
Cargo-c is a cargo applet to build and install C-ABI compatible dynamic and static libraries.
It will be required for librsvg.
---
Superseeds https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/.
v2: no change
v3: no change
v4: no change
v5: no change
v6: no change
--- DEVELOPERS | 1 + package/cargo-c/cargo-c.hash | 3 +++ package/cargo-c/cargo-c.mk | 15 +++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 package/cargo-c/cargo-c.hash create mode 100644 package/cargo-c/cargo-c.mk
DEVELOPERS +1 -0
@@ -1366,6 +1366,7 @@ F: package/rpi-rgb-led-matrix/ N: Guillaume Chaye <[email protected]> F: package/sane-airscan/ +F: package/cargo-c/ N: Guillaume William Brs <[email protected]> F: package/libnids/
package/cargo-c/cargo-c.hash new file +3 -0
@@ -0,0 +1,3 @@ +# locally computed +sha256 757034535d42b345cd7b47c9d5e3624073332437805634153a19259439491be2 cargo-c-0.10.15-cargo4.tar.gz +sha256 d69f24ad84ec2ade64c0b68bdb31b41170e997b158370342056918329cc9af1e LICENSE
package/cargo-c/cargo-c.mk new file +15 -0
@@ -0,0 +1,15 @@ +################################################################################ +# +# cargo-c +# +################################################################################ + +CARGO_C_VERSION = 0.10.15 +CARGO_C_SITE = $(call github,lu-zero,cargo-c,v$(CARGO_C_VERSION)) +CARGO_C_CARGO_LOCK_FILE = https://github.com/lu-zero/cargo-c/releases/download/v$(CARGO_C_VERSION)/Cargo.lock +CARGO_C_LICENSE = MIT +CARGO_C_LICENSE_FILES = LICENSE + +HOST_CARGO_C_DEPENDENCIES = host-libopenssl host-pkgconf + +$(eval $(host-cargo-package))
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v6 1/1 package/librsvg: bump version to 2.61.1
In reply to Thomas DevoogdtThis is a major update, which replaces autotools with meson. The package uses cargo in the background, so copy the relevant environment from the cargo package to get things working.
Note that the download URL has been changed because cargo vendoring needs .tar.gz for it's post_process_unpack.
Announcement (for what it's worth):
- https://gitlab.gnome.org/GNOME/librsvg/-/releases/2.61.1
---
cat libgtk4.config
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_LIBGTK4=y
./utils/test-pkg -p libgtk4 -c libgtk4.config -a
arm-aarch64 [ 1/35]: OK
bootlin-aarch64-glibc [ 2/35]: OK
bootlin-arcle-hs38-uclibc [ 3/35]: SKIPPED
bootlin-armv5-uclibc [ 4/35]: SKIPPED
bootlin-armv7-glibc [ 5/35]: OK
bootlin-armv7m-uclibc [ 6/35]: SKIPPED
bootlin-armv7-musl [ 7/35]: OK
bootlin-m68k-5208-uclibc [ 8/35]: SKIPPED
bootlin-m68k-68040-uclibc [ 9/35]: SKIPPED
bootlin-microblazeel-uclibc [10/35]: SKIPPED
bootlin-mipsel32r6-glibc [11/35]: SKIPPED
bootlin-mipsel-uclibc [12/35]: SKIPPED
bootlin-openrisc-uclibc [13/35]: SKIPPED
bootlin-powerpc64le-power8-glibc [14/35]: OK
bootlin-powerpc-e500mc-uclibc [15/35]: SKIPPED
bootlin-riscv32-glibc [16/35]: SKIPPED
bootlin-riscv64-glibc [17/35]: SKIPPED
bootlin-riscv64-musl [18/35]: SKIPPED
bootlin-s390x-z13-glibc [19/35]: OK
bootlin-sh4-uclibc [20/35]: SKIPPED
bootlin-sparc64-glibc [21/35]: OK
bootlin-sparc-uclibc [22/35]: SKIPPED
bootlin-x86-64-glibc [23/35]: OK
bootlin-x86-64-musl [24/35]: OK
bootlin-x86-64-uclibc [25/35]: SKIPPED
bootlin-x86-i686-musl [26/35]: OK
bootlin-xtensa-uclibc [27/35]: SKIPPED
br-arm-basic [28/35]: SKIPPED
br-arm-full-nothread [29/35]: SKIPPED
br-arm-full-static [30/35]: SKIPPED
br-i386-pentium4-full [31/35]: SKIPPED
br-mips64-n64-full [32/35]: SKIPPED
br-mips64r6-el-hf-glibc [33/35]: SKIPPED
br-powerpc-603e-basic-cpp [34/35]: SKIPPED
br-powerpc64-power7-glibc [35/35]: OK35 builds, 24 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
v2:
- added cargo vendoring for the DL phase
- disabled rsvg-convert by default to fix some compile errors v3:
- Ensure that -cargo4 is part of the dl file.
v4:
- Dropped LIBRSVG_SOURCE, not needed to define.
v5:
- Dropped 0001-cargo_wrapper-fixup-the-usage-of-cargo_c.patch, not needed, buildroot defines the right PATH already.
v6: no change
--- ...r-Makefile.am-set-GDK_PIXBUF_MODULED.patch | 41 ------------- ...ake-building-rsvg-convert-selectable.patch | 59 ++++++++++++++++++ package/librsvg/librsvg.hash | 4 +- package/librsvg/librsvg.mk | 61 +++++++++++++------ 4 files changed, 103 insertions(+), 62 deletions(-) delete mode 100644 package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch create mode 100644 package/librsvg/0001-meson-make-building-rsvg-convert-selectable.patch
package/librsvg/0001-gdk-pixbuf-loader-Makefile.am-set-GDK_PIXBUF_MODULED.patch deleted +0 -41
@@ -1,41 +0,0 @@ -From 2c472bf55289ccbd7f305aa3e98d6fd70be4e3ab Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <[email protected]> -Date: Sat, 19 Feb 2022 12:02:10 +0100 -Subject: [PATCH] gdk-pixbuf-loader/Makefile.am: set GDK_PIXBUF_MODULEDIR - -Set GDK_PIXBUF_MODULEDIR to gdk_pixbuf_moduledir before calling -gdk-pixbuf-query-loaders to build a correct gdk_pixbuf_cache_file and -gdk-pixbuf.loaders on 'exotic' systems - -Signed-off-by: Fabrice Fontaine <[email protected]> -[Upstream status: -https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/668] ---- - gdk-pixbuf-loader/Makefile.am | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdk-pixbuf-loader/Makefile.am b/gdk-pixbuf-loader/Makefile.am -index c3493736..de1f9641 100644 ---- a/gdk-pixbuf-loader/Makefile.am -+++ b/gdk-pixbuf-loader/Makefile.am -@@ -49,7 +49,7 @@ rsvg_loader_LDADD = \ - EXTRA_rsvg_loader_DEPENDENCIES = libpixbufloader-svg.la gdk-pixbuf-loaders - - gdk-pixbuf-loaders: Makefile -- $(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null -+ $(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null - - if CROSS_COMPILING - RUN_QUERY_LOADER_TEST=false -@@ -68,7 +68,7 @@ endif - install-data-hook: - @if $(RUN_QUERY_LOADER_TEST) ; then \ - $(mkinstalldirs) $(DESTDIR)$(gdk_pixbuf_binarydir) ; \ -- $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \ -+ GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \ - else \ - echo "***" ; \ - echo "*** Warning: loaders.cache not built" ; \ --- -2.34.1 -
package/librsvg/0001-meson-make-building-rsvg-convert-selectable.patch new file +59 -0
59 lines not on this page · raw message
package/librsvg/librsvg.hash +1 -3
@@ -1,5 +1,3 @@ -# From https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.9.sha256sum -sha256 518905fffa879b6c7f3db1aae961cf31333e0eadc7b4cdd4f531707868c54b53 librsvg-2.50.9.tar.xz - # Locally computed +sha256 902edb88757cdb33bb2c660527768733a57487a8b6ed597ea492055f25345b13 librsvg-2.61.1-cargo4.tar.gz sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
package/librsvg/librsvg.mk +43 -18
74 lines not on this page · raw message
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v6] package/librsvg: bump version to 2.61.1
Hello Thomas,
Quoted 11 lines · On Sun, 19 Oct 2025 08:45:03 +0200 Thomas Devoogdt <[email protected]> wrote:
This is a major update, which replaces autotools with meson. The package uses cargo in the background, so copy the relevant environment from the cargo package to get things working.
Note that the download URL has been changed because cargo vendoring needs .tar.gz for it's
post_process_unpack.Announcement (for what it's worth):
- https://gitlab.gnome.org/GNOME/librsvg/-/releases/2.61.1Signed-off-by Thomas Devoogdt <[email protected]>
Thanks for the patch!
Quoted 5 lines
cat libgtk4.config
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_LIBGTK4=y
It's good to test large configs, but they risk bringing extra dependencies, making you not aware of dependencies you might be missing for librsvg.
I realized only later that this patch needs cargo-c, which isn't in Buildroot yet. Could you make sure to always send patches with their dependencies?
Quoted 24 lines
package/librsvg/librsvg.mk +6
-14-LIBRSVG_VERSION_MAJOR = 2.50 -LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).9 -LIBRSVG_SITE = https://download.gnome.org/sources/librsvg/$(LIBRSVG_VERSION_MAJOR) -LIBRSVG_SOURCE = librsvg-$(LIBRSVG_VERSION).tar.xz +LIBRSVG_VERSION = 2.61.1 +LIBRSVG_SITE = https://gitlab.gnome.org/GNOME/librsvg/-/archive/$(LIBRSVG_VERSION) LIBRSVG_INSTALL_STAGING = YES -LIBRSVG_CONF_ENV = \ - LIBS=$(TARGET_NLS_LIBS) \ - RUST_TARGET=$(RUSTC_TARGET_NAME) -LIBRSVG_CONF_OPTS = --disable-pixbuf-loader --disable-tools -HOST_LIBRSVG_CONF_OPTS = --enable-introspection=no -LIBRSVG_DEPENDENCIES = cairo host-gdk-pixbuf gdk-pixbuf host-rustc libglib2 libxml2 pango \ - $(TARGET_NLS_DEPENDENCIES) -HOST_LIBRSVG_DEPENDENCIES = host-cairo host-gdk-pixbuf host-libglib2 host-libxml2 host-pango host-rustc LIBRSVG_LICENSE = LGPL-2.1+ LIBRSVG_LICENSE_FILES = COPYING.LIB LIBRSVG_CPE_ID_VENDOR = gnome -# We're patching gdk-pixbuf-loader/Makefile.am -LIBRSVG_AUTORECONF = YES + +LIBRSVG_DOWNLOAD_POST_PROCESS = cargo +LIBRSVG_DL_ENV = $(PKG_CARGO_ENV) +
package/librsvg/librsvg.mk line 26
Quoted 10 lines
package/librsvg/librsvg.mk +10
-0+LIBRSVG_CONF_ENV = $(PKG_CARGO_ENV) +LIBRSVG_NINJA_ENV = $(PKG_CARGO_ENV) +LIBRSVG_CONF_OPTS = \ + -Dtriplet=$(RUSTC_TARGET_NAME) \ + -Drsvg-convert=disabled \ + -Dpixbuf-loader=disabled \ + -Ddocs=disabled \ + -Dtests=false +LIBRSVG_DEPENDENCIES = \ + host-cairo \
Are you sure host-cairo is needed?
Review
Quoted 2 lines
(quoted diff) +2
-0+ host-cargo-c \ + host-libxml2 \
And host-libxml2?
Review
Quoted 1 line
(quoted diff) +1
-0+ host-pango \
And host-pango2 ?
package/librsvg/librsvg.mk line 32
Quoted 3 lines
package/librsvg/librsvg.mk +3
-0+ host-rustc \ + cairo \ + gdk-pixbuf \
According to the documentation of librsvg, gdk-pixbuf is an optional dependency.
However, according to the documentation, freetype is mandatory. You get it automatically as it is a dependency of cairo, but I think it would be preferable to express this dependency here.
package/librsvg/librsvg.mk line 45
Quoted 13 lines
package/librsvg/librsvg.mk +13
-0+ libglib2 \ + libxml2 \ + pango \ + $(TARGET_NLS_DEPENDENCIES) + +HOST_LIBRSVG_CONF_ENV = $(HOST_PKG_CARGO_ENV) +HOST_LIBRSVG_NINJA_ENV = $(HOST_PKG_CARGO_ENV) +HOST_LIBRSVG_CONF_OPTS = \ + -Dintrospection=disabled +HOST_LIBRSVG_DEPENDENCIES = \ + host-cairo \ + host-cargo-c \ + host-gdk-pixbuf \
Maybe not needed?
Could you investigate this, and resend as part of the cargo-c series?
Thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v6] package/librsvg: bump version to 2.61.1
Hi Thomas,
There was something wrong with sending this patch - it should have been part of the cargo-c series. It also depends on the discussion about having patches at the pre-vendoring stage (
https://lore.kernel.org/buildroot/20260101173630.10079d1b@windsurf/).
I remember that I already did a quite extensive search on which packages are and are not required to be selected in both the target and the host package. I will investigate this further once we have cargo-c support in buildroot.
Kind regards,
Thomas Devoogdt
Op do 1 jan 2026 om 18:00 schreef Thomas Petazzoni < [email protected]>:
Quoted 113 lines
Hello Thomas,
Quoted 11 lines · On Sun, 19 Oct 2025 08:45:03 +0200 Thomas Devoogdt <[email protected]> wrote:
This is a major update, which replaces autotools with meson. The package uses cargo in the background, so copy the relevant environment from the cargo package to get things working.
Note that the download URL has been changed because cargo vendoring needs .tar.gz for it's
post_process_unpack.Announcement (for what it's worth):
- https://gitlab.gnome.org/GNOME/librsvg/-/releases/2.61.1Signed-off-by Thomas Devoogdt <[email protected]>Thanks for the patch!
Quoted 5 lines
cat libgtk4.config
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_LIBGTK4=yIt's good to test large configs, but they risk bringing extra dependencies, making you not aware of dependencies you might be missing for librsvg.
I realized only later that this patch needs cargo-c, which isn't in Buildroot yet. Could you make sure to always send patches with their dependencies?
package/librsvg/librsvg.mk
Quoted 3 lines
package/librsvg/librsvg.mk +0
-3-LIBRSVG_VERSION_MAJOR = 2.50 -LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).9 -LIBRSVG_SITE =https://download.gnome.org/sources/librsvg/$(LIBRSVG_VERSION_MAJOR)
package/librsvg/librsvg.mk
Quoted 3 lines
package/librsvg/librsvg.mk +2
-1-LIBRSVG_SOURCE = librsvg-$(LIBRSVG_VERSION).tar.xz +LIBRSVG_VERSION = 2.61.1 +LIBRSVG_SITE =https://gitlab.gnome.org/GNOME/librsvg/-/archive/$(LIBRSVG_VERSION)
package/librsvg/librsvg.mk
Quoted 7 lines
LIBRSVG_INSTALL_STAGING= YESpackage/librsvg/librsvg.mk +0
-6-LIBRSVG_CONF_ENV = \ - LIBS=$(TARGET_NLS_LIBS) \ - RUST_TARGET=$(RUSTC_TARGET_NAME) -LIBRSVG_CONF_OPTS = --disable-pixbuf-loader --disable-tools -HOST_LIBRSVG_CONF_OPTS = --enable-introspection=no -LIBRSVG_DEPENDENCIES = cairo host-gdk-pixbuf gdk-pixbuf host-rustclibglib2 libxml2 pango \
Review
Quoted 2 lines
(quoted diff) +0
-2- $(TARGET_NLS_DEPENDENCIES) -HOST_LIBRSVG_DEPENDENCIES = host-cairo host-gdk-pixbuf host-libglib2host-libxml2 host-pango host-rustc
Quoted 9 lines
LIBRSVG_LICENSE= LGPL-2.1+
LIBRSVG_LICENSE_FILES= COPYING.LIB
LIBRSVG_CPE_ID_VENDOR= gnomepackage/librsvg/librsvg.mk +4
-2-# We're patching gdk-pixbuf-loader/Makefile.am -LIBRSVG_AUTORECONF = YES + +LIBRSVG_DOWNLOAD_POST_PROCESS = cargo +LIBRSVG_DL_ENV = $(PKG_CARGO_ENV) +package/librsvg/librsvg.mk line 26
Quoted 10 lines
package/librsvg/librsvg.mk +10
-0+LIBRSVG_CONF_ENV = $(PKG_CARGO_ENV) +LIBRSVG_NINJA_ENV = $(PKG_CARGO_ENV) +LIBRSVG_CONF_OPTS = \ + -Dtriplet=$(RUSTC_TARGET_NAME) \ + -Drsvg-convert=disabled \ + -Dpixbuf-loader=disabled \ + -Ddocs=disabled \ + -Dtests=false +LIBRSVG_DEPENDENCIES = \ + host-cairo \Are you sure host-cairo is needed?
Review
Quoted 2 lines
(quoted diff) +2
-0+ host-cargo-c \ + host-libxml2 \And host-libxml2?
Quoted 1 line
+ host-pango \
And host-pango2 ?
package/librsvg/librsvg.mk line 32
Quoted 3 lines
package/librsvg/librsvg.mk +3
-0+ host-rustc \ + cairo \ + gdk-pixbuf \According to the documentation of librsvg, gdk-pixbuf is an optional dependency.
However, according to the documentation, freetype is mandatory. You get it automatically as it is a dependency of cairo, but I think it would be preferable to express this dependency here.
package/librsvg/librsvg.mk line 45
Quoted 13 lines
package/librsvg/librsvg.mk +13
-0+ libglib2 \ + libxml2 \ + pango \ + $(TARGET_NLS_DEPENDENCIES) + +HOST_LIBRSVG_CONF_ENV = $(HOST_PKG_CARGO_ENV) +HOST_LIBRSVG_NINJA_ENV = $(HOST_PKG_CARGO_ENV) +HOST_LIBRSVG_CONF_OPTS = \ + -Dintrospection=disabled +HOST_LIBRSVG_DEPENDENCIES = \ + host-cairo \ + host-cargo-c \ + host-gdk-pixbuf \Maybe not needed?
Could you investigate this, and resend as part of the cargo-c series?
Quoted 9 lines
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Thomas,
Adding Buildroot maintainers in Cc.
Quoted 11 lines · On Sun, 19 Oct 2025 08:45:01 +0200 Thomas Devoogdt <[email protected]> wrote:
E.g. https://github.com/lu-zero/cargo-c/releases/tag/v0.10.15
Cargo-c releases a separate Cargo.lock file, but doesn't bundle one in its normal .tar.gz code source target.
We can't use extra downloads/patches/... as cargo is a vendored package, which is done quite early in the chain.
This patch allows us to define a custom Cargo.lock source. Both a local bundled file and remote (only wget) file can be linked.
Quoted 7 lines
Usage:
<PKG>_CARGO_LOCK_FILE = <PKG>_PKGDIR/Cargo.lock
<PKG>_CARGO_LOCK_FILE = https://.../Cargo.lock
Signed-off-by Thomas Devoogdt <[email protected]>
Thanks for this patch.
I understand the need, but I am wondering if we shouldn't craft a more generic solution, such as providing the ability to apply patches *before* the vendoring step. This would allow many more things than just adding the Cargo.lock in this case: it would allow to fix issues that exist prior to vendoring, which is something that has already popped up a few times (I don't remember if it was for Cargo packages or Go packages though).
The one thing I'm not sure about is (of course) naming. Should we have something like *.patch-prevendoring ? Or a dedicated variable in the .mk file ? Or what other convention ?
Feedback from the other maintainers on this topic?
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 1/2 package/pkg-cargo: add support for prevendored Cargo.lock
Add support for using pre-vendored Cargo.lock files in Buildroot packages. This allows package maintainers to provide a Cargo.lock file directly in the package directory, which is useful when:
- The upstream package doesn't provide a Cargo.lock file
- Specific dependency versions need to be pinned
The implementation automatically detects if a Cargo.lock file exists in the package directory (next to the .mk file) and uses it during the vendoring process. The download helper searches upwards from the manifest to find the top-most Cargo.toml and places the lockfile there.
To handle updates to the Cargo.lock file without bumping the package version, a FOO_CARGO_LOCK_VERSION variable is introduced. This defaults to 1 and should be incremented (to 2, 3, etc.) each time the Cargo.lock is updated independently. When set to values greater than 1, it adds a "-lockN" suffix to the tarball name to force re-downloading. When the package version is bumped, this variable should be removed to reset to the default.
This work is based on ideas from:
- Yann E. Morin's cargo-unchained branch:
https://gitlab.com/ymorin/buildroot/-/tree/yem/cargo-unchained
- Thomas Devoogdt's patch series:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
---
v7: reworked based on talks at DeveloperDaysFOSDEM2026
https://mensuel.framapad.org/p/buildroot-fosdem-2026-ajdk?lang=en
--- docs/manual/adding-packages-cargo.adoc | 35 ++++++++++++++++++++++---- package/pkg-cargo.mk | 14 +++++++++++ package/pkg-utils.mk | 3 ++- support/download/cargo-post-process | 19 +++++++++++++- 4 files changed, 64 insertions(+), 7 deletions(-)
docs/manual/adding-packages-cargo.adoc +30 -5
@@ -77,6 +77,13 @@ typical packages will therefore only use a few of them. is not at the root of the tree extracted by the tarball. If +HOST_FOO_SUBDIR+ is not specified, it defaults to +FOO_SUBDIR+. +* +FOO_CARGO_LOCK_VERSION+ defaults to +1+ when a +Cargo.lock+ file is + provided in the Buildroot package directory (next to the +.mk+ file). + Only set this explicitly if you need to increment it (to +2+, +3+, + etc.) when updating the +Cargo.lock+ without bumping +FOO_VERSION+. + When +FOO_VERSION+ is bumped, remove this variable to let it default + back to +1+. + * +FOO_CARGO_ENV+ can be used to pass additional variables in the environment of +cargo+ invocations. It used at both build and installation time
@@ -94,8 +101,26 @@ step of packages that use the +cargo-package+ infrastructure. Such dependencies are then kept together with the package source code in the tarball cached in Buildroot's +DL_DIR+, and therefore the hash of the package's tarball doesn't only cover the source of the package -itself, but also covers the sources of the dependencies. Thus, a change -injected into one of the dependencies will also be discovered by the -hash check. In addition, this mechanism allows the build to be -performed completely offline since cargo will not do any downloads -during the build. This mechanism is called vendoring the dependencies. +itself, but also covers the sources of the dependencies. In addition, +this mechanism allows the build to be performed completely offline +since cargo will not do any downloads during the build. This mechanism +is called vendoring the dependencies. + +==== Pre-vendoring with +Cargo.lock+ + +In some cases, you may need to provide a custom +Cargo.lock+ file in +Buildroot (e.g., when the upstream package doesn't provide one, or you +need to pin specific dependency versions). To do this, place a ++Cargo.lock+ file in the package directory (next to the +.mk+ file). +Buildroot will automatically detect and use it during vendoring. + +When you update the +Cargo.lock+ without bumping +FOO_VERSION+, you must +increment +FOO_CARGO_LOCK_VERSION+: + +---- +FOO_CARGO_LOCK_VERSION = 2 +---- + +Increment it for each subsequent +Cargo.lock+ change (+3+, +4+, etc.). +When +FOO_VERSION+ is bumped, remove this variable to let it default +back to +1+.
package/pkg-cargo.mk +14 -0
@@ -195,6 +195,20 @@ ifneq ($$($(2)_SUBDIR),) $(2)_DOWNLOAD_POST_PROCESS_OPTS += -m$$($(2)_SUBDIR)/Cargo.toml endif +# Automatically detect if a Cargo.lock file exists in the package directory +# and use it for vendoring if present +ifneq ($$(wildcard $(pkgdir)/Cargo.lock),) +# Set the lock version if not already set, defaulting to 1 +ifndef $(3)_CARGO_LOCK_VERSION + $(3)_CARGO_LOCK_VERSION = 1 +endif +# Only set EXTRA_FMT_VERSION if lock version is greater than 1 +ifneq ($$($(3)_CARGO_LOCK_VERSION),1) +$(2)_EXTRA_FMT_VERSION = -lock$$($(3)_CARGO_LOCK_VERSION) +endif +$(2)_DOWNLOAD_POST_PROCESS_OPTS += -l $$(abspath $(pkgdir)/Cargo.lock) +endif + # Because we append vendored info, we can't rely on the values being empty # once we eventually get into the generic-package infra. So, we duplicate # the heuristics here
package/pkg-utils.mk +2 -1
@@ -47,8 +47,9 @@ pkgname = $(lastword $(subst /, ,$(pkgdir))) # Helper to build the extension for a package archive, based on various # conditions. +# NOTE! _EXTRA_FMT_VERSION should only be set by the infra, not individual packages! # $(1): upper-case package name -pkg_source_ext = $(BR_FMT_VERSION_$($(1)_SITE_METHOD))$(BR_FMT_VERSION_$($(1)_DOWNLOAD_POST_PROCESS)).tar.gz +pkg_source_ext = $(BR_FMT_VERSION_$($(1)_SITE_METHOD))$(BR_FMT_VERSION_$($(1)_DOWNLOAD_POST_PROCESS))$($(1)_EXTRA_FMT_VERSION).tar.gz # Define extractors for different archive suffixes INFLATE.bz2 = $(BZCAT)
support/download/cargo-post-process +18 -1
@@ -11,11 +11,12 @@ if [ "${BR_CARGO_MANIFEST_PATH}" ]; then fi manifest=Cargo.toml -while getopts "n:o:m:" OPT; do +while getopts "n:o:m:l:" OPT; do case "${OPT}" in o) output="${OPTARG}";; n) base_name="${OPTARG}";; m) manifest="${OPTARG}";; + l) lockfile="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
@@ -31,6 +32,22 @@ post_process_unpack "${base_name}" "${output}" # Do the Cargo vendoring pushd "${base_name}" > /dev/null +# If a lockfile was explicitly provided via -l option, use it +if [ -n "${lockfile}" ]; then + # Search upwards from the manifest to find the top-most Cargo.toml + dir="${manifest}" + lock_dir="$(dirname "${manifest}")" + while [ "${dir}" != "." ]; do + dir="$(dirname "${dir}")" + if [ -e "${dir}/Cargo.toml" ]; then + lock_dir="${dir}" + fi + done + + cp "${lockfile}" "${lock_dir}/Cargo.lock" + printf 'Using provided Cargo.lock from %s\n' "${lockfile}" +fi + # Create the local .cargo/config.toml with vendor info mkdir -p .cargo/ mkdir -p "${CARGO_HOME}"
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v7 2/2 package/cargo-c: add new package
Cargo-c is a cargo applet to build and install C-ABI compatible dynamic and static libraries.
It will be required for librsvg.
Cargo.lock downloaded by doing:
(sha256: abc0ffb7128aa01704d63800d7a6accb8138a6f561696b19cd1cb1e3f9547e86)
$ wget https://github.com/lu-zero/cargo-c/releases/download/v0.10.15/Cargo.lock -O package/cargo-c/Cargo.lock
---
v7: reworked based on talks at DeveloperDaysFOSDEM2026
https://mensuel.framapad.org/p/buildroot-fosdem-2026-ajdk?lang=en
--- DEVELOPERS | 1 + package/cargo-c/Cargo.lock | 4037 ++++++++++++++++++++++++++++++++++ package/cargo-c/cargo-c.hash | 3 + package/cargo-c/cargo-c.mk | 14 + 4 files changed, 4055 insertions(+) create mode 100644 package/cargo-c/Cargo.lock create mode 100644 package/cargo-c/cargo-c.hash create mode 100644 package/cargo-c/cargo-c.mk
DEVELOPERS +1 -0
@@ -1373,6 +1373,7 @@ F: package/rpi-rgb-led-matrix/ N: Guillaume Chaye <[email protected]> F: package/sane-airscan/ +F: package/cargo-c/ N: Guillaume William Brs <[email protected]> F: package/libxcrypt/
package/cargo-c/Cargo.lock new file +4037 -0
2,993 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Part of the diff is not shown here. View the raw message.
PATCH v8 1/2 package/pkg-cargo: add support for prevendored Cargo.lock
Add support for using pre-vendored Cargo.lock files in Buildroot packages. This allows package maintainers to provide a Cargo.lock file directly in the package directory, which is useful when:
- The upstream package doesn't provide a Cargo.lock file
- Specific dependency versions need to be pinned
The implementation automatically detects if a Cargo.lock file exists in the package directory (next to the .mk file) and uses it during the vendoring process. The download helper searches upwards from the manifest to find the top-most Cargo.toml and places the lockfile there.
To handle updates to the Cargo.lock file without bumping the package version, a FOO_CARGO_LOCK_VERSION variable is introduced. This defaults to 1 and should be incremented (to 2, 3, etc.) each time the Cargo.lock is updated independently. When set to values greater than 1, it adds a "-lockN" suffix to the tarball name to force re-downloading. When the package version is bumped, this variable should be removed to reset to the default.
This work is based on ideas from:
- Yann E. Morin's cargo-unchained branch:
https://gitlab.com/ymorin/buildroot/-/tree/yem/cargo-unchained
- Thomas Devoogdt's patch series:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
---
v7: reworked based on talks at DeveloperDaysFOSDEM2026
https://mensuel.framapad.org/p/buildroot-fosdem-2026-ajdk?lang=en
v8: no change
--- docs/manual/adding-packages-cargo.adoc | 35 ++++++++++++++++++++++---- package/pkg-cargo.mk | 14 +++++++++++ package/pkg-utils.mk | 3 ++- support/download/cargo-post-process | 19 +++++++++++++- 4 files changed, 64 insertions(+), 7 deletions(-)
docs/manual/adding-packages-cargo.adoc +30 -5
@@ -77,6 +77,13 @@ typical packages will therefore only use a few of them. is not at the root of the tree extracted by the tarball. If +HOST_FOO_SUBDIR+ is not specified, it defaults to +FOO_SUBDIR+. +* +FOO_CARGO_LOCK_VERSION+ defaults to +1+ when a +Cargo.lock+ file is + provided in the Buildroot package directory (next to the +.mk+ file). + Only set this explicitly if you need to increment it (to +2+, +3+, + etc.) when updating the +Cargo.lock+ without bumping +FOO_VERSION+. + When +FOO_VERSION+ is bumped, remove this variable to let it default + back to +1+. + * +FOO_CARGO_ENV+ can be used to pass additional variables in the environment of +cargo+ invocations. It used at both build and installation time
@@ -94,8 +101,26 @@ step of packages that use the +cargo-package+ infrastructure. Such dependencies are then kept together with the package source code in the tarball cached in Buildroot's +DL_DIR+, and therefore the hash of the package's tarball doesn't only cover the source of the package -itself, but also covers the sources of the dependencies. Thus, a change -injected into one of the dependencies will also be discovered by the -hash check. In addition, this mechanism allows the build to be -performed completely offline since cargo will not do any downloads -during the build. This mechanism is called vendoring the dependencies. +itself, but also covers the sources of the dependencies. In addition, +this mechanism allows the build to be performed completely offline +since cargo will not do any downloads during the build. This mechanism +is called vendoring the dependencies. + +==== Pre-vendoring with +Cargo.lock+ + +In some cases, you may need to provide a custom +Cargo.lock+ file in +Buildroot (e.g., when the upstream package doesn't provide one, or you +need to pin specific dependency versions). To do this, place a ++Cargo.lock+ file in the package directory (next to the +.mk+ file). +Buildroot will automatically detect and use it during vendoring. + +When you update the +Cargo.lock+ without bumping +FOO_VERSION+, you must +increment +FOO_CARGO_LOCK_VERSION+: + +---- +FOO_CARGO_LOCK_VERSION = 2 +---- + +Increment it for each subsequent +Cargo.lock+ change (+3+, +4+, etc.). +When +FOO_VERSION+ is bumped, remove this variable to let it default +back to +1+.
package/pkg-cargo.mk +14 -0
@@ -195,6 +195,20 @@ ifneq ($$($(2)_SUBDIR),) $(2)_DOWNLOAD_POST_PROCESS_OPTS += -m$$($(2)_SUBDIR)/Cargo.toml endif +# Automatically detect if a Cargo.lock file exists in the package directory +# and use it for vendoring if present +ifneq ($$(wildcard $(pkgdir)/Cargo.lock),) +# Set the lock version if not already set, defaulting to 1 +ifndef $(3)_CARGO_LOCK_VERSION + $(3)_CARGO_LOCK_VERSION = 1 +endif +# Only set EXTRA_FMT_VERSION if lock version is greater than 1 +ifneq ($$($(3)_CARGO_LOCK_VERSION),1) +$(2)_EXTRA_FMT_VERSION = -lock$$($(3)_CARGO_LOCK_VERSION) +endif +$(2)_DOWNLOAD_POST_PROCESS_OPTS += -l $$(abspath $(pkgdir)/Cargo.lock) +endif + # Because we append vendored info, we can't rely on the values being empty # once we eventually get into the generic-package infra. So, we duplicate # the heuristics here
package/pkg-utils.mk +2 -1
@@ -47,8 +47,9 @@ pkgname = $(lastword $(subst /, ,$(pkgdir))) # Helper to build the extension for a package archive, based on various # conditions. +# NOTE! _EXTRA_FMT_VERSION should only be set by the infra, not individual packages! # $(1): upper-case package name -pkg_source_ext = $(BR_FMT_VERSION_$($(1)_SITE_METHOD))$(BR_FMT_VERSION_$($(1)_DOWNLOAD_POST_PROCESS)).tar.gz +pkg_source_ext = $(BR_FMT_VERSION_$($(1)_SITE_METHOD))$(BR_FMT_VERSION_$($(1)_DOWNLOAD_POST_PROCESS))$($(1)_EXTRA_FMT_VERSION).tar.gz # Define extractors for different archive suffixes INFLATE.bz2 = $(BZCAT)
support/download/cargo-post-process +18 -1
@@ -11,11 +11,12 @@ if [ "${BR_CARGO_MANIFEST_PATH}" ]; then fi manifest=Cargo.toml -while getopts "n:o:m:" OPT; do +while getopts "n:o:m:l:" OPT; do case "${OPT}" in o) output="${OPTARG}";; n) base_name="${OPTARG}";; m) manifest="${OPTARG}";; + l) lockfile="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
@@ -31,6 +32,22 @@ post_process_unpack "${base_name}" "${output}" # Do the Cargo vendoring pushd "${base_name}" > /dev/null +# If a lockfile was explicitly provided via -l option, use it +if [ -n "${lockfile}" ]; then + # Search upwards from the manifest to find the top-most Cargo.toml + dir="${manifest}" + lock_dir="$(dirname "${manifest}")" + while [ "${dir}" != "." ]; do + dir="$(dirname "${dir}")" + if [ -e "${dir}/Cargo.toml" ]; then + lock_dir="${dir}" + fi + done + + cp "${lockfile}" "${lock_dir}/Cargo.lock" + printf 'Using provided Cargo.lock from %s\n' "${lockfile}" +fi + # Create the local .cargo/config.toml with vendor info mkdir -p .cargo/ mkdir -p "${CARGO_HOME}"
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v8 2/2 package/cargo-c: add new package
Cargo-c is a cargo applet to build and install C-ABI compatible dynamic and static libraries.
It will be required for librsvg.
Cargo.lock downloaded by doing:
(sha256: 8a5d9bad62a910c65f542842a9df4376973f439a332da79e28bb7f818c8abe36)
$ wget https://github.com/lu-zero/cargo-c/releases/download/v0.10.25/Cargo.lock -O package/cargo-c/Cargo.lock
---
v7: reworked based on talks at DeveloperDaysFOSDEM2026
https://mensuel.framapad.org/p/buildroot-fosdem-2026-ajdk?lang=en
v8: bump to 0.10.25
--- DEVELOPERS | 1 + package/cargo-c/Cargo.lock | 4346 ++++++++++++++++++++++++++++++++++ package/cargo-c/cargo-c.hash | 3 + package/cargo-c/cargo-c.mk | 14 + 4 files changed, 4364 insertions(+) create mode 100644 package/cargo-c/Cargo.lock create mode 100644 package/cargo-c/cargo-c.hash create mode 100644 package/cargo-c/cargo-c.mk
DEVELOPERS +1 -0
@@ -1395,6 +1395,7 @@ F: package/rpi-rgb-led-matrix/ N: Guillaume Chaye <[email protected]> F: package/sane-airscan/ +F: package/cargo-c/ N: Guillaume William Brs <[email protected]> F: package/libxcrypt/
package/cargo-c/Cargo.lock new file +4346 -0
2,993 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Part of the diff is not shown here. View the raw message.
PATCH v8 2/2 package/cargo-c: add new package
In reply to Thomas DevoogdtCargo-c is a cargo applet to build and install C-ABI compatible dynamic and static libraries.
It will be required for librsvg.
Cargo.lock downloaded by doing:
(sha256: 8a5d9bad62a910c65f542842a9df4376973f439a332da79e28bb7f818c8abe36)
$ wget https://github.com/lu-zero/cargo-c/releases/download/v0.10.25/Cargo.lock -O package/cargo-c/Cargo.lock
---
v7: reworked based on talks at DeveloperDaysFOSDEM2026
https://mensuel.framapad.org/p/buildroot-fosdem-2026-ajdk?lang=en
v8: bump to 0.10.25
--- DEVELOPERS | 1 + package/cargo-c/Cargo.lock | 4346 ++++++++++++++++++++++++++++++++++ package/cargo-c/cargo-c.hash | 3 + package/cargo-c/cargo-c.mk | 14 + 4 files changed, 4364 insertions(+) create mode 100644 package/cargo-c/Cargo.lock create mode 100644 package/cargo-c/cargo-c.hash create mode 100644 package/cargo-c/cargo-c.mk
DEVELOPERS +1 -0
@@ -1395,6 +1395,7 @@ F: package/rpi-rgb-led-matrix/ N: Guillaume Chaye <[email protected]> F: package/sane-airscan/ +F: package/cargo-c/ N: Guillaume William Brs <[email protected]> F: package/libxcrypt/
package/cargo-c/Cargo.lock new file +4346 -0
2,993 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Part of the diff is not shown here. View the raw message.