summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEtienne Cordonnier <ecordonnier@snap.com>2022-07-21 11:22:46 +0200
committerKhem Raj <raj.khem@gmail.com>2022-08-24 08:26:55 -0700
commita9bb79e1b9bef281e4d83eb575426c60b5abc5e1 (patch)
tree62ac095e1160ea195a65b88c3b8460935e21c187
parent6d54ec022d8c09bf900e47f1e38c4fafc7529209 (diff)
downloadmeta-openembedded-a9bb79e1b9bef281e4d83eb575426c60b5abc5e1.tar.gz
uutils-coreutils: add recipe
uutils-coreutils is a rewrite of GNU coreutils in Rust. It is licensed under MIT license. To use this recipe add this line to your distro configuration: PREFERRED_PROVIDER_coreutils = "uutils-coreutils" Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/conf/layer.conf2
-rw-r--r--meta-oe/recipes-core/uutils-coreutils/README.txt19
-rw-r--r--meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc57
-rw-r--r--meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.15.bb282
4 files changed, 360 insertions, 0 deletions
diff --git a/meta-oe/conf/layer.conf b/meta-oe/conf/layer.conf
index 34aa29561..6a0f05d93 100644
--- a/meta-oe/conf/layer.conf
+++ b/meta-oe/conf/layer.conf
@@ -48,6 +48,8 @@ LICENSE_PATH += "${LAYERDIR}/licenses"
48 48
49PREFERRED_RPROVIDER_libdevmapper = "lvm2" 49PREFERRED_RPROVIDER_libdevmapper = "lvm2"
50PREFERRED_PROVIDER_android-tools-conf ?= "android-tools-conf" 50PREFERRED_PROVIDER_android-tools-conf ?= "android-tools-conf"
51# Configures whether coreutils or uutils-coreutils is used.
52PREFERRED_PROVIDER_coreutils = "coreutils"
51 53
52SIGGEN_EXCLUDERECIPES_ABISAFE += " \ 54SIGGEN_EXCLUDERECIPES_ABISAFE += " \
53 fbset-modes \ 55 fbset-modes \
diff --git a/meta-oe/recipes-core/uutils-coreutils/README.txt b/meta-oe/recipes-core/uutils-coreutils/README.txt
new file mode 100644
index 000000000..cfd7b051b
--- /dev/null
+++ b/meta-oe/recipes-core/uutils-coreutils/README.txt
@@ -0,0 +1,19 @@
1How to generate/update the file uutils-coreutils_XXX.bb:
2
3cargo with version > 1.60 is needed so cargo from Ubuntu's apt will not work
4(because of https://github.com/rust-lang/cargo/issues/10623):
5This package is needed (tested on Ubuntu 22.04):
6sudo apt-get -y install librust-cargo+openssl-dev
7
8Then install cargo-bitbake with:
9$ cargo install --locked cargo-bitbake
10
11You can now update coreutils:
12$ git clone https://github.com/uutils/coreutils.git
13$ cd coreutils
14$ git tag
15$ git checkout 0.0.XXX
16$ cargo-bitbake bitbake
17Wrote: coreutils_0.0.15.bb
18
19Verify manual changes in the bb file (rename coreutils.inc to uutils-coreutils.inc)
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc
new file mode 100644
index 000000000..68cfa8178
--- /dev/null
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils.inc
@@ -0,0 +1,57 @@
1# This file contains content which was not automatically generated using cargo-bitbake on the cargo.toml file of uutils-coreutils
2# Copyright (c) 2022, Snap Inc.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5PROVIDES = "coreutils"
6RPROVIDES:${PN} = "coreutils"
7
8PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
9
10PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
11
12CARGO_BUILD_FLAGS += "--features unix"
13CARGO_BUILD_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', '--features feat_selinux', '', d)}"
14
15DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'clang-native libselinux-native', '', d)}"
16
17export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot-native${libdir}"
18export SELINUX_LIB_DIR = "${WORKDIR}/recipe-sysroot-native${libdir}"
19export SELINUX_INCLUDE_DIR = "${WORKDIR}/recipe-sysroot-native${includedir}"
20
21# The code which follows is strongly inspired from the GNU coreutils bitbake recipe:
22
23# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
24bindir_progs = "[ arch basename cksum comm csplit cut dir dircolors dirname du \
25 env expand expr factor fmt fold groups head hostid id install \
26 join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
27 pinky pr printf ptx readlink realpath seq sha1sum sha224sum sha256sum \
28 sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \
29 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
30
31bindir_progs += "${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'chcon runcon', '', d)}"
32
33base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
34 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
35
36sbindir_progs= "chroot"
37
38inherit update-alternatives
39
40# Higher than busybox (which uses 50)
41ALTERNATIVE_PRIORITY = "100"
42
43# Higher than net-tools (which uses 100)
44ALTERNATIVE_PRIORITY[hostname] = "110"
45
46ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base32 base64 nice printenv mktemp df"
47
48# Use the multicall binary named "coreutils" for symlinks
49ALTERNATIVE_TARGET = "${bindir}/coreutils"
50
51python __anonymous() {
52 for prog in d.getVar('base_bindir_progs').split():
53 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
54
55 for prog in d.getVar('sbindir_progs').split():
56 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
57}
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.15.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.15.bb
new file mode 100644
index 000000000..07004635f
--- /dev/null
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.15.bb
@@ -0,0 +1,282 @@
1# Auto-Generated by cargo-bitbake 0.3.16
2#
3inherit cargo
4
5# If this is git based prefer versioned ones if they exist
6# DEFAULT_PREFERENCE = "-1"
7
8# how to get coreutils could be as easy as but default to a git checkout:
9# SRC_URI += "crate://crates.io/coreutils/0.0.15"
10SRC_URI += "git://github.com/uutils/coreutils.git;protocol=https;nobranch=1"
11SRCREV = "5b6cd6146b40f5c1391cd812b1b929edd2283994"
12S = "${WORKDIR}/git"
13CARGO_SRC_DIR = ""
14
15
16# please note if you have entries that do not begin with crate://
17# you must change them to how that package can be fetched
18SRC_URI += " \
19 crate://crates.io/Inflector/0.11.4 \
20 crate://crates.io/adler/1.0.2 \
21 crate://crates.io/ahash/0.7.6 \
22 crate://crates.io/aho-corasick/0.7.18 \
23 crate://crates.io/aliasable/0.1.3 \
24 crate://crates.io/android_system_properties/0.1.4 \
25 crate://crates.io/ansi_term/0.12.1 \
26 crate://crates.io/arrayref/0.3.6 \
27 crate://crates.io/arrayvec/0.7.2 \
28 crate://crates.io/atty/0.2.14 \
29 crate://crates.io/autocfg/1.1.0 \
30 crate://crates.io/bigdecimal/0.3.0 \
31 crate://crates.io/binary-heap-plus/0.4.1 \
32 crate://crates.io/bindgen/0.59.2 \
33 crate://crates.io/bitflags/1.3.2 \
34 crate://crates.io/blake2b_simd/1.0.0 \
35 crate://crates.io/blake3/1.3.1 \
36 crate://crates.io/block-buffer/0.10.2 \
37 crate://crates.io/bstr/0.2.17 \
38 crate://crates.io/bumpalo/3.10.0 \
39 crate://crates.io/byte-unit/4.0.14 \
40 crate://crates.io/bytecount/0.6.3 \
41 crate://crates.io/byteorder/1.4.3 \
42 crate://crates.io/cc/1.0.73 \
43 crate://crates.io/cexpr/0.6.0 \
44 crate://crates.io/cfg-if/0.1.10 \
45 crate://crates.io/cfg-if/1.0.0 \
46 crate://crates.io/chrono/0.4.22 \
47 crate://crates.io/clang-sys/1.3.3 \
48 crate://crates.io/clap/2.34.0 \
49 crate://crates.io/clap/3.2.17 \
50 crate://crates.io/clap_complete/3.2.4 \
51 crate://crates.io/clap_lex/0.2.4 \
52 crate://crates.io/compare/0.1.0 \
53 crate://crates.io/constant_time_eq/0.1.5 \
54 crate://crates.io/conv/0.3.3 \
55 crate://crates.io/core-foundation-sys/0.8.3 \
56 crate://crates.io/coz/0.1.3 \
57 crate://crates.io/cpp/0.5.7 \
58 crate://crates.io/cpp_build/0.4.0 \
59 crate://crates.io/cpp_common/0.4.0 \
60 crate://crates.io/cpp_common/0.5.7 \
61 crate://crates.io/cpp_macros/0.5.7 \
62 crate://crates.io/cpp_syn/0.12.0 \
63 crate://crates.io/cpp_synmap/0.3.0 \
64 crate://crates.io/cpp_synom/0.12.0 \
65 crate://crates.io/cpufeatures/0.2.2 \
66 crate://crates.io/crc32fast/1.3.2 \
67 crate://crates.io/crossbeam-channel/0.5.6 \
68 crate://crates.io/crossbeam-deque/0.8.2 \
69 crate://crates.io/crossbeam-epoch/0.9.10 \
70 crate://crates.io/crossbeam-utils/0.8.11 \
71 crate://crates.io/crossterm/0.25.0 \
72 crate://crates.io/crossterm_winapi/0.9.0 \
73 crate://crates.io/crypto-common/0.1.6 \
74 crate://crates.io/ctor/0.1.23 \
75 crate://crates.io/ctrlc/3.2.3 \
76 crate://crates.io/custom_derive/0.1.7 \
77 crate://crates.io/data-encoding-macro-internal/0.1.10 \
78 crate://crates.io/data-encoding-macro/0.1.12 \
79 crate://crates.io/data-encoding/2.3.2 \
80 crate://crates.io/diff/0.1.13 \
81 crate://crates.io/digest/0.10.3 \
82 crate://crates.io/dlv-list/0.3.0 \
83 crate://crates.io/dns-lookup/1.0.8 \
84 crate://crates.io/dunce/1.0.2 \
85 crate://crates.io/either/1.7.0 \
86 crate://crates.io/env_logger/0.8.4 \
87 crate://crates.io/env_logger/0.9.0 \
88 crate://crates.io/exacl/0.9.0 \
89 crate://crates.io/fastrand/1.8.0 \
90 crate://crates.io/file_diff/1.0.0 \
91 crate://crates.io/filetime/0.2.17 \
92 crate://crates.io/flate2/1.0.24 \
93 crate://crates.io/fnv/1.0.7 \
94 crate://crates.io/fs_extra/1.2.0 \
95 crate://crates.io/fsevent-sys/4.1.0 \
96 crate://crates.io/fts-sys/0.2.1 \
97 crate://crates.io/gcd/2.1.0 \
98 crate://crates.io/generic-array/0.14.6 \
99 crate://crates.io/getrandom/0.2.7 \
100 crate://crates.io/glob/0.3.0 \
101 crate://crates.io/half/1.8.2 \
102 crate://crates.io/hashbrown/0.12.3 \
103 crate://crates.io/heck/0.4.0 \
104 crate://crates.io/hermit-abi/0.1.19 \
105 crate://crates.io/hex-literal/0.3.4 \
106 crate://crates.io/hex/0.4.3 \
107 crate://crates.io/hostname/0.3.1 \
108 crate://crates.io/humantime/2.1.0 \
109 crate://crates.io/iana-time-zone/0.1.45 \
110 crate://crates.io/indexmap/1.9.1 \
111 crate://crates.io/inotify-sys/0.1.5 \
112 crate://crates.io/inotify/0.9.6 \
113 crate://crates.io/instant/0.1.12 \
114 crate://crates.io/itertools/0.10.3 \
115 crate://crates.io/itoa/1.0.3 \
116 crate://crates.io/js-sys/0.3.59 \
117 crate://crates.io/keccak/0.1.2 \
118 crate://crates.io/kernel32-sys/0.2.2 \
119 crate://crates.io/kqueue-sys/1.0.3 \
120 crate://crates.io/kqueue/1.0.6 \
121 crate://crates.io/lazy_static/1.4.0 \
122 crate://crates.io/lazycell/1.3.0 \
123 crate://crates.io/libc/0.2.132 \
124 crate://crates.io/libloading/0.7.3 \
125 crate://crates.io/lock_api/0.4.7 \
126 crate://crates.io/log/0.4.17 \
127 crate://crates.io/lscolors/0.12.0 \
128 crate://crates.io/match_cfg/0.1.0 \
129 crate://crates.io/md-5/0.10.1 \
130 crate://crates.io/memchr/1.0.2 \
131 crate://crates.io/memchr/2.5.0 \
132 crate://crates.io/memmap2/0.5.7 \
133 crate://crates.io/memoffset/0.6.5 \
134 crate://crates.io/minimal-lexical/0.2.1 \
135 crate://crates.io/miniz_oxide/0.5.3 \
136 crate://crates.io/mio/0.8.4 \
137 crate://crates.io/nix/0.25.0 \
138 crate://crates.io/nom/7.1.1 \
139 crate://crates.io/notify/5.0.0-pre.16 \
140 crate://crates.io/num-bigint/0.4.3 \
141 crate://crates.io/num-integer/0.1.45 \
142 crate://crates.io/num-traits/0.2.15 \
143 crate://crates.io/num_cpus/1.13.1 \
144 crate://crates.io/num_threads/0.1.6 \
145 crate://crates.io/number_prefix/0.4.0 \
146 crate://crates.io/numtoa/0.1.0 \
147 crate://crates.io/once_cell/1.13.1 \
148 crate://crates.io/onig/6.3.2 \
149 crate://crates.io/onig_sys/69.8.1 \
150 crate://crates.io/ordered-multimap/0.4.3 \
151 crate://crates.io/os_display/0.1.3 \
152 crate://crates.io/os_str_bytes/6.0.1 \
153 crate://crates.io/ouroboros/0.15.2 \
154 crate://crates.io/ouroboros_macro/0.15.2 \
155 crate://crates.io/output_vt100/0.1.3 \
156 crate://crates.io/parking_lot/0.12.1 \
157 crate://crates.io/parking_lot_core/0.9.3 \
158 crate://crates.io/paste/1.0.8 \
159 crate://crates.io/peeking_take_while/0.1.2 \
160 crate://crates.io/phf/0.10.1 \
161 crate://crates.io/phf_codegen/0.10.0 \
162 crate://crates.io/phf_generator/0.10.0 \
163 crate://crates.io/phf_shared/0.10.0 \
164 crate://crates.io/pin-utils/0.1.0 \
165 crate://crates.io/pkg-config/0.3.25 \
166 crate://crates.io/platform-info/1.0.0 \
167 crate://crates.io/ppv-lite86/0.2.16 \
168 crate://crates.io/pretty_assertions/1.2.1 \
169 crate://crates.io/proc-macro-error-attr/1.0.4 \
170 crate://crates.io/proc-macro-error/1.0.4 \
171 crate://crates.io/proc-macro2/1.0.43 \
172 crate://crates.io/quick-error/2.0.1 \
173 crate://crates.io/quickcheck/1.0.3 \
174 crate://crates.io/quote/0.3.15 \
175 crate://crates.io/quote/1.0.21 \
176 crate://crates.io/rand/0.8.5 \
177 crate://crates.io/rand_chacha/0.3.1 \
178 crate://crates.io/rand_core/0.6.3 \
179 crate://crates.io/rayon-core/1.9.3 \
180 crate://crates.io/rayon/1.5.3 \
181 crate://crates.io/redox_syscall/0.2.16 \
182 crate://crates.io/redox_termios/0.1.2 \
183 crate://crates.io/reference-counted-singleton/0.1.1 \
184 crate://crates.io/regex-automata/0.1.10 \
185 crate://crates.io/regex-syntax/0.6.27 \
186 crate://crates.io/regex/1.6.0 \
187 crate://crates.io/remove_dir_all/0.5.3 \
188 crate://crates.io/remove_dir_all/0.7.0 \
189 crate://crates.io/retain_mut/0.1.7 \
190 crate://crates.io/rlimit/0.8.3 \
191 crate://crates.io/rust-ini/0.18.0 \
192 crate://crates.io/rustc-hash/1.1.0 \
193 crate://crates.io/rustversion/1.0.9 \
194 crate://crates.io/same-file/1.0.6 \
195 crate://crates.io/scopeguard/1.1.0 \
196 crate://crates.io/selinux-sys/0.5.2 \
197 crate://crates.io/selinux/0.2.7 \
198 crate://crates.io/sha1/0.10.1 \
199 crate://crates.io/sha2/0.10.2 \
200 crate://crates.io/sha3/0.10.2 \
201 crate://crates.io/shlex/1.1.0 \
202 crate://crates.io/signal-hook-mio/0.2.3 \
203 crate://crates.io/signal-hook-registry/1.4.0 \
204 crate://crates.io/signal-hook/0.3.14 \
205 crate://crates.io/siphasher/0.3.10 \
206 crate://crates.io/smallvec/1.9.0 \
207 crate://crates.io/smawk/0.3.1 \
208 crate://crates.io/socket2/0.4.4 \
209 crate://crates.io/strsim/0.10.0 \
210 crate://crates.io/strsim/0.8.0 \
211 crate://crates.io/strum/0.24.1 \
212 crate://crates.io/strum_macros/0.24.3 \
213 crate://crates.io/subtle/2.4.1 \
214 crate://crates.io/syn/1.0.99 \
215 crate://crates.io/tempfile/3.3.0 \
216 crate://crates.io/term_grid/0.1.7 \
217 crate://crates.io/termcolor/1.1.3 \
218 crate://crates.io/terminal_size/0.1.17 \
219 crate://crates.io/termion/1.5.6 \
220 crate://crates.io/termsize/0.1.6 \
221 crate://crates.io/textwrap/0.11.0 \
222 crate://crates.io/textwrap/0.15.0 \
223 crate://crates.io/thiserror-impl/1.0.32 \
224 crate://crates.io/thiserror/1.0.32 \
225 crate://crates.io/time-macros/0.2.4 \
226 crate://crates.io/time/0.3.9 \
227 crate://crates.io/typenum/1.15.0 \
228 crate://crates.io/unicode-ident/1.0.3 \
229 crate://crates.io/unicode-linebreak/0.1.2 \
230 crate://crates.io/unicode-segmentation/1.9.0 \
231 crate://crates.io/unicode-width/0.1.9 \
232 crate://crates.io/unicode-xid/0.0.4 \
233 crate://crates.io/unindent/0.1.10 \
234 crate://crates.io/unix_socket/0.5.0 \
235 crate://crates.io/users/0.11.0 \
236 crate://crates.io/utf-8/0.7.6 \
237 crate://crates.io/utf8-width/0.1.6 \
238 crate://crates.io/uuid/1.1.2 \
239 crate://crates.io/vec_map/0.8.2 \
240 crate://crates.io/version_check/0.9.4 \
241 crate://crates.io/walkdir/2.3.2 \
242 crate://crates.io/wasi/0.11.0+wasi-snapshot-preview1 \
243 crate://crates.io/wasm-bindgen-backend/0.2.82 \
244 crate://crates.io/wasm-bindgen-macro-support/0.2.82 \
245 crate://crates.io/wasm-bindgen-macro/0.2.82 \
246 crate://crates.io/wasm-bindgen-shared/0.2.82 \
247 crate://crates.io/wasm-bindgen/0.2.82 \
248 crate://crates.io/which/4.2.5 \
249 crate://crates.io/wild/2.1.0 \
250 crate://crates.io/winapi-build/0.1.1 \
251 crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
252 crate://crates.io/winapi-util/0.1.5 \
253 crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
254 crate://crates.io/winapi/0.2.8 \
255 crate://crates.io/winapi/0.3.9 \
256 crate://crates.io/windows-sys/0.36.1 \
257 crate://crates.io/windows_aarch64_msvc/0.36.1 \
258 crate://crates.io/windows_i686_gnu/0.36.1 \
259 crate://crates.io/windows_i686_msvc/0.36.1 \
260 crate://crates.io/windows_x86_64_gnu/0.36.1 \
261 crate://crates.io/windows_x86_64_msvc/0.36.1 \
262 crate://crates.io/xattr/0.2.3 \
263 crate://crates.io/z85/3.0.5 \
264 crate://crates.io/zip/0.6.2 \
265"
266
267
268
269# FIXME: update generateme with the real MD5 of the license file
270LIC_FILES_CHKSUM = " \
271 file://LICENSE;md5=41f7469eaacac62c67d5664fff2c062d \
272"
273
274SUMMARY = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust"
275HOMEPAGE = "https://github.com/uutils/coreutils"
276LICENSE = "MIT"
277
278# includes this file if it exists but does not fail
279# this is useful for anything you may want to override from
280# what cargo-bitbake generates.
281include uutils-coreutils-${PV}.inc
282include uutils-coreutils.inc