diff options
Diffstat (limited to 'meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.26.bb')
-rw-r--r-- | meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.26.bb | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.26.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.26.bb new file mode 100644 index 000000000..5668aaac5 --- /dev/null +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.26.bb | |||
@@ -0,0 +1,73 @@ | |||
1 | # Copyright (c) 2022, Snap Inc. | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | SUMMARY = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust" | ||
4 | HOMEPAGE = "https://github.com/uutils/coreutils" | ||
5 | LICENSE = "MIT" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e74349878141b240070458d414ab3b64" | ||
7 | |||
8 | inherit cargo cargo-update-recipe-crates | ||
9 | |||
10 | SRC_URI += "git://github.com/uutils/coreutils.git;protocol=https;branch=main" | ||
11 | |||
12 | # musl not supported because the libc crate does not support functions like "endutxent" at the moment, | ||
13 | # so src/uucore/src/lib/features.rs disables utmpx when targetting musl. | ||
14 | COMPATIBLE_HOST:libc-musl = "null" | ||
15 | |||
16 | SRCREV = "f95f363096610d7e5e1556d6d0a32b5018065c4c" | ||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | require ${BPN}-crates.inc | ||
20 | |||
21 | PROVIDES = "coreutils" | ||
22 | RPROVIDES:${PN} = "coreutils" | ||
23 | |||
24 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" | ||
25 | |||
26 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" | ||
27 | |||
28 | CARGO_BUILD_FLAGS += "--features unix" | ||
29 | CARGO_BUILD_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', '--features feat_selinux', '', d)}" | ||
30 | |||
31 | DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'clang-native libselinux-native', '', d)}" | ||
32 | |||
33 | export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot-native${libdir}" | ||
34 | export SELINUX_LIB_DIR = "${WORKDIR}/recipe-sysroot-native${libdir}" | ||
35 | export 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 | ||
40 | bindir_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 | |||
47 | bindir_progs += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'chcon runcon', '', d)}" | ||
48 | |||
49 | base_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 | |||
52 | sbindir_progs= "chroot" | ||
53 | |||
54 | inherit update-alternatives | ||
55 | |||
56 | # Higher than busybox (which uses 50) | ||
57 | ALTERNATIVE_PRIORITY = "100" | ||
58 | |||
59 | # Higher than net-tools (which uses 100) | ||
60 | ALTERNATIVE_PRIORITY[hostname] = "110" | ||
61 | |||
62 | ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base32 base64 nice printenv mktemp df" | ||
63 | |||
64 | # Use the multicall binary named "coreutils" for symlinks | ||
65 | ALTERNATIVE_TARGET = "${bindir}/coreutils" | ||
66 | |||
67 | python __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 | } | ||