summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core
diff options
context:
space:
mode:
authorEtienne Cordonnier <ecordonnier@snap.com>2024-01-26 13:24:30 +0100
committerKhem Raj <raj.khem@gmail.com>2024-01-27 09:48:33 -0800
commit0bea9feffc93b1bdd29273ccb85fc87fee244d05 (patch)
tree7088171ccffe0d7b3d5a69bd3a57c0b69555fba7 /meta-oe/recipes-core
parent1d125e17798f055b32484ca95f004d05b8d45d4d (diff)
downloadmeta-openembedded-0bea9feffc93b1bdd29273ccb85fc87fee244d05.tar.gz
uutils_coreutils: merge .inc and .bb
I initially created a separated .inc file to follow poky's convention, but according to https://lists.openembedded.org/g/openembedded-core/message/193940 the presence of unneeded .inc files is only due to historical reasons and there is no need to follow this convention any more. Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-core')
-rw-r--r--meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc56
-rw-r--r--meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.24.bb56
2 files changed, 55 insertions, 57 deletions
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc
deleted file mode 100644
index 973b722ba..000000000
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc
+++ /dev/null
@@ -1,56 +0,0 @@
1# Copyright (c) 2022, Snap Inc.
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4PROVIDES = "coreutils"
5RPROVIDES:${PN} = "coreutils"
6
7PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
8
9PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
10
11CARGO_BUILD_FLAGS += "--features unix"
12CARGO_BUILD_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', '--features feat_selinux', '', d)}"
13
14DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'clang-native libselinux-native', '', d)}"
15
16export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot-native${libdir}"
17export SELINUX_LIB_DIR = "${WORKDIR}/recipe-sysroot-native${libdir}"
18export SELINUX_INCLUDE_DIR = "${WORKDIR}/recipe-sysroot-native${includedir}"
19
20# The code which follows is strongly inspired from the GNU coreutils bitbake recipe:
21
22# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
23bindir_progs = "[ arch basename cksum comm csplit cut dir dircolors dirname du \
24 env expand expr factor fmt fold groups head hostid id install \
25 join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
26 pinky pr printf ptx readlink realpath seq sha1sum sha224sum sha256sum \
27 sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \
28 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
29
30bindir_progs += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'chcon runcon', '', d)}"
31
32base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
33 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
34
35sbindir_progs= "chroot"
36
37inherit update-alternatives
38
39# Higher than busybox (which uses 50)
40ALTERNATIVE_PRIORITY = "100"
41
42# Higher than net-tools (which uses 100)
43ALTERNATIVE_PRIORITY[hostname] = "110"
44
45ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base32 base64 nice printenv mktemp df"
46
47# Use the multicall binary named "coreutils" for symlinks
48ALTERNATIVE_TARGET = "${bindir}/coreutils"
49
50python __anonymous() {
51 for prog in d.getVar('base_bindir_progs').split():
52 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
53
54 for prog in d.getVar('sbindir_progs').split():
55 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
56}
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.24.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.24.bb
index 35af8a97d..775af5236 100644
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.24.bb
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.24.bb
@@ -1,3 +1,5 @@
1# Copyright (c) 2022, Snap Inc.
2# Released under the MIT license (see COPYING.MIT for the terms)
1SUMMARY = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust" 3SUMMARY = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust"
2HOMEPAGE = "https://github.com/uutils/coreutils" 4HOMEPAGE = "https://github.com/uutils/coreutils"
3LICENSE = "MIT" 5LICENSE = "MIT"
@@ -16,4 +18,56 @@ S = "${WORKDIR}/git"
16 18
17require ${BPN}-crates.inc 19require ${BPN}-crates.inc
18 20
19include uutils-coreutils.inc 21PROVIDES = "coreutils"
22RPROVIDES:${PN} = "coreutils"
23
24PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
25
26PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
27
28CARGO_BUILD_FLAGS += "--features unix"
29CARGO_BUILD_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', '--features feat_selinux', '', d)}"
30
31DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'clang-native libselinux-native', '', d)}"
32
33export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot-native${libdir}"
34export SELINUX_LIB_DIR = "${WORKDIR}/recipe-sysroot-native${libdir}"
35export SELINUX_INCLUDE_DIR = "${WORKDIR}/recipe-sysroot-native${includedir}"
36
37# The code which follows is strongly inspired from the GNU coreutils bitbake recipe:
38
39# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
40bindir_progs = "[ arch basename cksum comm csplit cut dir dircolors dirname du \
41 env expand expr factor fmt fold groups head hostid id install \
42 join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
43 pinky pr printf ptx readlink realpath seq sha1sum sha224sum sha256sum \
44 sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \
45 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
46
47bindir_progs += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'chcon runcon', '', d)}"
48
49base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
50 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
51
52sbindir_progs= "chroot"
53
54inherit update-alternatives
55
56# Higher than busybox (which uses 50)
57ALTERNATIVE_PRIORITY = "100"
58
59# Higher than net-tools (which uses 100)
60ALTERNATIVE_PRIORITY[hostname] = "110"
61
62ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base32 base64 nice printenv mktemp df"
63
64# Use the multicall binary named "coreutils" for symlinks
65ALTERNATIVE_TARGET = "${bindir}/coreutils"
66
67python __anonymous() {
68 for prog in d.getVar('base_bindir_progs').split():
69 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
70
71 for prog in d.getVar('sbindir_progs').split():
72 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
73}