diff mbox series

[v2,3/3] package/genuinetools-img: new host and target package

Message ID 20210516010521.1375959-3-christian@paral.in
State Changes Requested
Headers show
Series [v2,1/3] package/libfuse3: allow building as a host package | expand

Commit Message

Christian Stewart May 16, 2021, 1:05 a.m. UTC
Img is a standalone, daemon-less, unprivileged Dockerfile and OCI compatible
container image builder. It uses the moby-buildkit solver internally. The
commands/UX mirror the Docker CLI for workflow compatibility.

Using the genuinetools- prefix due to the generic nature of the "img" name.

Adds both host and target variants. fuse-overlayfs can be used as an
unprivileged and rootless overlay filesystem backend.

https://github.com/genuinetools/img

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/Config.in                             |  1 +
 package/Config.in.host                        |  1 +
 package/genuinetools-img/Config.in            | 23 ++++++++++++++++
 package/genuinetools-img/Config.in.host       |  9 +++++++
 .../genuinetools-img/genuinetools-img.hash    |  3 +++
 package/genuinetools-img/genuinetools-img.mk  | 27 +++++++++++++++++++
 6 files changed, 64 insertions(+)
 create mode 100644 package/genuinetools-img/Config.in
 create mode 100644 package/genuinetools-img/Config.in.host
 create mode 100644 package/genuinetools-img/genuinetools-img.hash
 create mode 100644 package/genuinetools-img/genuinetools-img.mk

Comments

Yann E. MORIN May 18, 2021, 8:44 a.m. UTC | #1
Christian, All,

On 2021-05-15 18:05 -0700, Christian Stewart spake thusly:
> Img is a standalone, daemon-less, unprivileged Dockerfile and OCI compatible
> container image builder. It uses the moby-buildkit solver internally. The
> commands/UX mirror the Docker CLI for workflow compatibility.
> 
> Using the genuinetools- prefix due to the generic nature of the "img" name.
> 
> Adds both host and target variants. fuse-overlayfs can be used as an
> unprivileged and rootless overlay filesystem backend.
> 
> https://github.com/genuinetools/img
> 
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
[--SNIP--]
> diff --git a/package/genuinetools-img/Config.in b/package/genuinetools-img/Config.in
> new file mode 100644
> index 0000000000..eb4992db07
> --- /dev/null
> +++ b/package/genuinetools-img/Config.in
> @@ -0,0 +1,23 @@
> +config BR2_PACKAGE_GENUINETOOLS_IMG
> +	bool "genuinetools-img"
> +	depends on BR2_USE_MMU # fuse-overlayfs libfuse3
> +	depends on !BR2_STATIC_LIBS # fuse-overlayfs libfuse3
> +	depends on BR2_TOOLCHAIN_HAS_THREADS # fuse-overlayfs libfuse3
> +	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 # fuse-overlayfs
> +	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> +	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS

You forgot to add those two to the comment, below...

> +	depends on BR2_TOOLCHAIN_HAS_THREADS

Duplicate. ;-)

> +	depends on !BR2_TOOLCHAIN_USES_UCLIBC

... and this one too...

Also, keep arch-related dependencies first, then toolchain-related
dependencies, the package-related dependencies (with the comments):

    depends on BR2_USE_MMU
    depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
    depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
    depends on !BR2_STATIC_LIBS
    depends on BR2_TOOLCHAIN_HAS_THREADS
    depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15

> +	select BR2_PACKAGE_CGROUPFS_MOUNT if !BR2_PACKAGE_SYSTEMD # runtime dependency
> +	select BR2_PACKAGE_FUSE_OVERLAYFS # runtime dependency
> +	select BR2_PACKAGE_LIBFUSE3 # fuse-overlayfs
> +	help
> +	  Img is a standalone, daemon-less, unprivileged Dockerfile
> +	  and OCI compatible container image builder.
> +
> +	  https://github.com/genuinetools/img
> +
> +comment "genuinetools-img needs a toolchain w/ threads, dynamic library, headers >= 3.15"
> +	depends on BR2_USE_MMU
> +	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
> +		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15

    comment "genuinetools-img needs a glibc or musl toolchain w/ ..."
        depends on BR2_USE_MMU
        depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
        depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
        depends on BR2_TOOLCHAIN_USES_UCLIB || !BR2_TOOLCHAIN_HAS_THREADS \
                || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15

[--SNIP--]

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 82b28d2835..62ac9d292c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2443,6 +2443,7 @@  menu "System tools"
 	source "package/emlog/Config.in"
 	source "package/ftop/Config.in"
 	source "package/getent/Config.in"
+	source "package/genuinetools-img/Config.in"
 	source "package/gkrellm/Config.in"
 	source "package/htop/Config.in"
 	source "package/ibm-sw-tpm2/Config.in"
diff --git a/package/Config.in.host b/package/Config.in.host
index 90a6afdf4f..851ab401fd 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -32,6 +32,7 @@  menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/genuinetools-img/Config.in.host"
 	source "package/gnupg/Config.in.host"
 	source "package/go/Config.in.host"
 	source "package/go-bootstrap/Config.in.host"
diff --git a/package/genuinetools-img/Config.in b/package/genuinetools-img/Config.in
new file mode 100644
index 0000000000..eb4992db07
--- /dev/null
+++ b/package/genuinetools-img/Config.in
@@ -0,0 +1,23 @@ 
+config BR2_PACKAGE_GENUINETOOLS_IMG
+	bool "genuinetools-img"
+	depends on BR2_USE_MMU # fuse-overlayfs libfuse3
+	depends on !BR2_STATIC_LIBS # fuse-overlayfs libfuse3
+	depends on BR2_TOOLCHAIN_HAS_THREADS # fuse-overlayfs libfuse3
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 # fuse-overlayfs
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
+	select BR2_PACKAGE_CGROUPFS_MOUNT if !BR2_PACKAGE_SYSTEMD # runtime dependency
+	select BR2_PACKAGE_FUSE_OVERLAYFS # runtime dependency
+	select BR2_PACKAGE_LIBFUSE3 # fuse-overlayfs
+	help
+	  Img is a standalone, daemon-less, unprivileged Dockerfile
+	  and OCI compatible container image builder.
+
+	  https://github.com/genuinetools/img
+
+comment "genuinetools-img needs a toolchain w/ threads, dynamic library, headers >= 3.15"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
diff --git a/package/genuinetools-img/Config.in.host b/package/genuinetools-img/Config.in.host
new file mode 100644
index 0000000000..bbef88acf6
--- /dev/null
+++ b/package/genuinetools-img/Config.in.host
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_HOST_GENUINETOOLS_IMG
+	bool "host genuinetools-img"
+	depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_FUSE_OVERLAYFS # runtime dependency
+	help
+	  Img is a standalone, daemon-less, unprivileged Dockerfile
+	  and OCI compatible container image builder.
+
+	  https://github.com/genuinetools/img
diff --git a/package/genuinetools-img/genuinetools-img.hash b/package/genuinetools-img/genuinetools-img.hash
new file mode 100644
index 0000000000..097ad17d91
--- /dev/null
+++ b/package/genuinetools-img/genuinetools-img.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  c6d805ab899db639fa08f0e33fe6673593be8336d288bb1cb4cb81a3229a916f  genuinetools-img-0.5.11.tar.gz
+sha256	c696614021eafe355c7fb0af3e724fc7fa8729a0c10c27cbed2505bf30a853ce  LICENSE
diff --git a/package/genuinetools-img/genuinetools-img.mk b/package/genuinetools-img/genuinetools-img.mk
new file mode 100644
index 0000000000..08330d1113
--- /dev/null
+++ b/package/genuinetools-img/genuinetools-img.mk
@@ -0,0 +1,27 @@ 
+################################################################################
+#
+# genuinetools-img
+#
+################################################################################
+
+GENUINETOOLS_IMG_VERSION = 0.5.11
+GENUINETOOLS_IMG_SITE = $(call github,genuinetools,img,v$(GENUINETOOLS_IMG_VERSION))
+
+GENUINETOOLS_IMG_LICENSE = MIT
+GENUINETOOLS_IMG_LICENSE_FILES = LICENSE
+
+GENUINETOOLS_IMG_DEPENDENCIES = host-pkgconf
+GENUINETOOLS_IMG_GOMOD = github.com/genuinetools/img
+
+GENUINETOOLS_IMG_TAGS = cgo noembed
+GENUINETOOLS_IMG_LDFLAGS = \
+	-X $(GENUINETOOLS_IMG_GOMOD)/version.VERSION="$(GENUINETOOLS_IMG_VERSION)"
+
+HOST_GENUINETOOLS_IMG_TAGS = $(GENUINETOOLS_IMG_TAGS)
+HOST_GENUINETOOLS_IMG_LDFLAGS = $(GENUINETOOLS_IMG_LDFLAGS)
+
+HOST_GENUINETOOLS_IMG_BIN_NAME = genuinetools-img
+HOST_GENUINETOOLS_IMG_INSTALL_BINS = $(HOST_GENUINETOOLS_IMG_BIN_NAME)
+
+$(eval $(golang-package))
+$(eval $(host-golang-package))