Skip to content

Commit

Permalink
containers: toolbox: add recipe
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Held <[email protected]>
  • Loading branch information
leonheldattoradex committed Jan 29, 2024
1 parent f8cf742 commit 8b867e2
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From c85e9e7dff2ecba5741eebfbacc805a86ba1f64d Mon Sep 17 00:00:00 2001
From: Leonardo Held <[email protected]>
Date: Mon, 29 Jan 2024 15:34:18 -0300
Subject: [PATCH] Modify compiler detection for Yocto

... as it won't solve for 'cc' like most distros.

Signed-off-by: Leonardo Held <[email protected]>
---
src/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/meson.build b/src/meson.build
index 098c692..da33fde 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -59,6 +59,8 @@ endif

message('Host machine dynamic linker:', dynamic_linker)

+yocto_compiler = cc.cmd_array().get(0)
+
toolbox_go = custom_target(
'toolbox',
command: [
@@ -67,7 +69,7 @@ toolbox_go = custom_target(
meson.project_build_root(),
'@OUTPUT@',
meson.project_version(),
- cc.cmd_array().get(-1),
+ yocto_compiler,
dynamic_linker,
migration_path_for_coreos_toolbox.to_string(),
],
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
From d57b7e1aaa3c5862b40917798871ad2a6b212059 Mon Sep 17 00:00:00 2001
From: Leonardo Held <[email protected]>
Date: Mon, 29 Jan 2024 15:52:59 -0300
Subject: [PATCH] Remove completions generation

Bitbake really doesn't like it.

Signed-off-by: Leonardo Held <[email protected]>
---
src/meson.build | 47 -----------------------------------------------
1 file changed, 47 deletions(-)

diff --git a/src/meson.build b/src/meson.build
index 098c692..d7cc811 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,7 +1,6 @@
go_build_wrapper_file = files('go-build-wrapper')
go_build_wrapper_program = find_program('go-build-wrapper')

-meson_generate_completions_program = find_program('meson_generate_completions.py')
meson_go_fmt_program = find_program('meson_go_fmt.py')

sources = files(
@@ -77,52 +76,6 @@ toolbox_go = custom_target(
output: 'toolbox',
)

-if bashcompletionsdir != ''
- custom_target(
- 'bash-completion',
- capture: true,
- command: [
- meson_generate_completions_program,
- meson.current_source_dir(),
- 'bash',
- ],
- depends: [toolbox_go],
- install: true,
- install_dir: bashcompletionsdir,
- output: 'toolbox.bash',
-)
-endif
-
-if fishcompletionsdir != ''
- custom_target(
- 'fish-completion',
- capture: true,
- command: [
- meson_generate_completions_program,
- meson.current_source_dir(),
- 'fish',
- ],
- depends: [toolbox_go],
- install: true,
- install_dir: fishcompletionsdir,
- output: 'toolbox.fish',
-)
-endif
-
-custom_target(
- 'zsh-completion',
- capture: true,
- command: [
- meson_generate_completions_program,
- meson.current_source_dir(),
- 'zsh',
- ],
- depends: [toolbox_go],
- install: true,
- install_dir: zshcompletionsdir,
- output: '_toolbox',
-)
-
if shellcheck.found()
test('shellcheck src/go-build-wrapper', shellcheck, args: [go_build_wrapper_file])
endif
--
2.43.0

30 changes: 30 additions & 0 deletions recipes-containers/toolbox/toolbox_0.0.99.5.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
SUMMARY = " Tool for interactive command line environments on Linux "

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

SRC_URI = "git://github.com/containers/toolbox.git;branch=main;protocol=https"
SRCREV = "ccc3eee72722e29172ec35184df89cad7c100a5b"

S = "${WORKDIR}/git"

FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

FILES:${PN} += " \
${datadir}/profile.d/toolbox.sh \
${libdir}/tmpfiles.d/toolbox.conf \
"

# Skip specifically for some Go recipes
# rpaths has to be skipped because toolbox hardcodes an rpath inside the container
INSANE_SKIP:${PN} = "ldflags textrel rpaths"

SRC_URI:append = " \
file://0001-Modify-compiler-detection-for-Yocto.patch \
file://0002-Remove-completions-generation.patch \
"

DEPENDS = "go go-md2man-native shadow systemd"

inherit meson
inherit pkgconfig
1 change: 1 addition & 0 deletions recipes-images/images/torizon-core-common-podman.bb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ CORE_IMAGE_BASE_INSTALL:append = " \
podman \
podman-compose \
fuse-overlayfs \
toolbox \
"

0 comments on commit 8b867e2

Please sign in to comment.