diff options
Diffstat (limited to 'meta/recipes-core/coreutils/coreutils_9.5.bb')
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_9.5.bb | 219 |
1 files changed, 219 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/coreutils_9.5.bb b/meta/recipes-core/coreutils/coreutils_9.5.bb new file mode 100644 index 0000000000..9a5f836ebe --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils_9.5.bb | |||
@@ -0,0 +1,219 @@ | |||
1 | SUMMARY = "The basic file, shell and text manipulation utilities" | ||
2 | DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ | ||
3 | manipulation utilities. These are the core utilities which are expected to exist on \ | ||
4 | every system." | ||
5 | HOMEPAGE = "http://www.gnu.org/software/coreutils/" | ||
6 | BUGTRACKER = "http://debbugs.gnu.org/coreutils" | ||
7 | LICENSE = "GPL-3.0-or-later" | ||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ | ||
9 | file://src/ls.c;beginline=1;endline=15;md5=9ac94aaed7fd46fd8df7147a9e3410cb \ | ||
10 | " | ||
11 | DEPENDS = "gmp libcap" | ||
12 | DEPENDS:class-native = "" | ||
13 | |||
14 | inherit autotools gettext texinfo | ||
15 | |||
16 | SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ | ||
17 | file://remove-usr-local-lib-from-m4.patch \ | ||
18 | file://0001-local.mk-fix-cross-compiling-problem.patch \ | ||
19 | file://run-ptest \ | ||
20 | " | ||
21 | SRC_URI[sha256sum] = "cd328edeac92f6a665de9f323c93b712af1858bc2e0d88f3f7100469470a1b8a" | ||
22 | |||
23 | # http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=v8.27-101-gf5d7c0842 | ||
24 | # | ||
25 | CVE_STATUS[CVE-2016-2781] = "disputed: runcon is not really a sandbox command, use `runcon ... setsid ...` to avoid this particular issue." | ||
26 | |||
27 | EXTRA_OECONF:class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}" | ||
28 | EXTRA_OECONF:class-nativesdk = "--enable-install-program=arch,hostname" | ||
29 | |||
30 | # acl and xattr are not default features | ||
31 | # | ||
32 | PACKAGECONFIG:class-target ??= "\ | ||
33 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ | ||
34 | " | ||
35 | |||
36 | # The lib/oe/path.py requires xattr | ||
37 | PACKAGECONFIG:class-native ??= "xattr" | ||
38 | |||
39 | # oe-core builds need xattr support | ||
40 | PACKAGECONFIG:class-nativesdk ??= "xattr" | ||
41 | |||
42 | # with, without, depends, rdepends | ||
43 | # | ||
44 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," | ||
45 | PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," | ||
46 | PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,," | ||
47 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" | ||
48 | PACKAGECONFIG[openssl] = "--with-openssl=yes,--with-openssl=no,openssl" | ||
49 | |||
50 | # [ df mktemp nice printenv base64 gets a special treatment and is not included in this | ||
51 | bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \ | ||
52 | env expand expr factor fmt fold groups head hostid id install \ | ||
53 | join link logname md5sum mkfifo nl nohup nproc od paste pathchk \ | ||
54 | pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \ | ||
55 | sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \ | ||
56 | tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes" | ||
57 | |||
58 | # hostname gets a special treatment and is not included in this | ||
59 | base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \ | ||
60 | mknod mv pwd rm rmdir sleep stty sync touch true uname stat" | ||
61 | |||
62 | sbindir_progs= "chroot" | ||
63 | |||
64 | # Split stdbuf into its own package, so one can include | ||
65 | # coreutils-stdbuf without getting the rest of coreutils, but make | ||
66 | # coreutils itself pull in stdbuf, so IMAGE_INSTALL += "coreutils" | ||
67 | # always provides all coreutils | ||
68 | PACKAGE_BEFORE_PN:class-target += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', '', 'coreutils-stdbuf', d)}" | ||
69 | FILES:coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so" | ||
70 | RDEPENDS:coreutils:class-target += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', '', 'coreutils-stdbuf', d)}" | ||
71 | |||
72 | # However, when the single-binary PACKAGECONFIG is used, stdbuf | ||
73 | # functionality is built into the single coreutils binary, so there's | ||
74 | # no point splitting /usr/bin/stdbuf to its own package. Instead, add | ||
75 | # an RPROVIDE so that rdepending on coreutils-stdbuf will work | ||
76 | # regardless of whether single-binary is in effect. | ||
77 | RPROVIDES:coreutils += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', 'coreutils-stdbuf', '', d)}" | ||
78 | |||
79 | # Let aclocal use the relative path for the m4 file rather than the | ||
80 | # absolute since coreutils has a lot of m4 files, otherwise there might | ||
81 | # be an "Argument list too long" error when it is built in a long/deep | ||
82 | # directory. | ||
83 | acpaths = "-I ./m4" | ||
84 | |||
85 | # Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h | ||
86 | do_compile:prepend () { | ||
87 | mkdir -p ${B}/src | ||
88 | } | ||
89 | |||
90 | do_install:class-native() { | ||
91 | autotools_do_install | ||
92 | # remove groups to fix conflict with shadow-native | ||
93 | rm -f ${D}${STAGING_BINDIR_NATIVE}/groups | ||
94 | # The return is a must since native doesn't need the | ||
95 | # do_install:append() in the below. | ||
96 | return | ||
97 | } | ||
98 | |||
99 | do_install:append() { | ||
100 | for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done | ||
101 | |||
102 | install -d ${D}${base_bindir} | ||
103 | [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done | ||
104 | |||
105 | install -d ${D}${sbindir} | ||
106 | [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done | ||
107 | |||
108 | # [ requires special handling because [.coreutils will cause the sed stuff | ||
109 | # in update-alternatives to fail, therefore use lbracket - the name used | ||
110 | # for the actual source file. | ||
111 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} | ||
112 | } | ||
113 | |||
114 | inherit update-alternatives | ||
115 | |||
116 | ALTERNATIVE_PRIORITY = "100" | ||
117 | # Make hostname's priority higher than busybox but lower than net-tools | ||
118 | ALTERNATIVE_PRIORITY[hostname] = "90" | ||
119 | ALTERNATIVE:${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base32 base64 nice printenv mktemp df" | ||
120 | ALTERNATIVE:${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1" | ||
121 | |||
122 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" | ||
123 | |||
124 | ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" | ||
125 | ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" | ||
126 | ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" | ||
127 | |||
128 | ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" | ||
129 | ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" | ||
130 | ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" | ||
131 | |||
132 | ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" | ||
133 | ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" | ||
134 | ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" | ||
135 | |||
136 | ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice" | ||
137 | ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}" | ||
138 | ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1" | ||
139 | |||
140 | ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv" | ||
141 | ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}" | ||
142 | |||
143 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" | ||
144 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" | ||
145 | |||
146 | ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" | ||
147 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" | ||
148 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" | ||
149 | ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" | ||
150 | |||
151 | # The statx() requires glibc >= 2.28 and linux kernel >= 4.11, it doesn't work | ||
152 | # when glibc >= 2.28 ((Ubuntu 20.04 in docker) and kernel < 4.11 (Host OS | ||
153 | # CentOS 7), we can check kernel version and disable it, but that would cause | ||
154 | # two different signatures for coreutils-native, so disable it unconditionally | ||
155 | # for deterministic build. | ||
156 | EXTRA_OECONF:append:class-native = " ac_cv_func_statx=0" | ||
157 | |||
158 | python __anonymous() { | ||
159 | for prog in d.getVar('base_bindir_progs').split(): | ||
160 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) | ||
161 | |||
162 | for prog in d.getVar('sbindir_progs').split(): | ||
163 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog)) | ||
164 | } | ||
165 | |||
166 | BBCLASSEXTEND = "native nativesdk" | ||
167 | |||
168 | inherit ptest | ||
169 | |||
170 | RDEPENDS:${PN}-ptest += "bash findutils gawk make perl perl-modules python3-core sed shadow" | ||
171 | |||
172 | # -dev automatic dependencies fails as we don't want libmodule-build-perl-dev, its too heavy | ||
173 | # may need tweaking if DEPENDS changes | ||
174 | # Can't use ${PN}-dev here since flags with overrides and key expansion not supported | ||
175 | RRECOMMENDS:coreutils-dev[nodeprrecs] = "1" | ||
176 | RRECOMMENDS:${PN}-dev += "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev" | ||
177 | |||
178 | do_install_ptest () { | ||
179 | install -d ${D}${PTEST_PATH}/tests | ||
180 | cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests | ||
181 | sed -i 's/ginstall/install/g' `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq` | ||
182 | install -d ${D}${PTEST_PATH}/build-aux | ||
183 | install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ | ||
184 | install -Dm 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/config.h | ||
185 | cp ${B}/Makefile ${D}${PTEST_PATH}/ | ||
186 | cp ${S}/init.cfg ${D}${PTEST_PATH}/ | ||
187 | cp -r ${B}/src ${D}${PTEST_PATH}/ | ||
188 | cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src | ||
189 | sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile | ||
190 | sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile | ||
191 | sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile | ||
192 | sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
193 | sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
194 | sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
195 | sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile | ||
196 | sed -i '/^CC =/s/ --sysroot=.*recipe-sysroot/ /g' ${D}${PTEST_PATH}/Makefile | ||
197 | chmod -R 777 ${D}${PTEST_PATH} | ||
198 | |||
199 | # Disable subcase stty-pairs.sh, it will cause test framework hang | ||
200 | sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile | ||
201 | |||
202 | # Disable subcase tail-2/assert.sh as it has issues on 32-bit systems | ||
203 | sed -i '/assert.sh/d' ${D}${PTEST_PATH}/Makefile | ||
204 | |||
205 | # Tweak test d_type-check to use python3 instead of python | ||
206 | sed -i "1s@.*@#!/usr/bin/python3@" ${D}${PTEST_PATH}/tests/d_type-check | ||
207 | install ${B}/src/getlimits ${D}/${bindir} | ||
208 | |||
209 | # handle multilib | ||
210 | sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest | ||
211 | } | ||
212 | |||
213 | do_install_ptest:append:libc-musl () { | ||
214 | # these tests fail due to bash on musl systems | ||
215 | # xmalloc: cannot allocate 16146 bytes | ||
216 | sed -i -e '/tests\/dd\/no-allocate.sh/d' ${D}${PTEST_PATH}/Makefile | ||
217 | sed -i -e '/tests\/split\/line-bytes.sh/d' ${D}${PTEST_PATH}/Makefile | ||
218 | } | ||
219 | FILES:${PN}-ptest += "${bindir}/getlimits" | ||