blob: 57b2c1bdba735bbd1f339237816eb991b7912032 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "The basic file, shell and text manipulation utilities"
2DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
3manipulation utilities. These are the core utilities which are expected to exist on \
4every system."
5HOMEPAGE = "http://www.gnu.org/software/coreutils/"
6BUGTRACKER = "http://debbugs.gnu.org/coreutils"
7LICENSE = "GPLv3+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
9 file://src/ls.c;beginline=1;endline=15;md5=c456f9896277a0543e3866777ccc0255"
10DEPENDS = "gmp libcap"
11DEPENDS_class-native = ""
12
13inherit autotools gettext texinfo
14
15SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
16 file://remove-usr-local-lib-from-m4.patch \
17 file://fix-selinux-flask.patch \
18 file://0001-uname-report-processor-and-hardware-correctly.patch \
19 file://disable-ls-output-quoting.patch \
20 file://0001-local.mk-fix-cross-compiling-problem.patch \
21 "
22
23SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch"
24
25SRC_URI[md5sum] = "0009a224d8e288e8ec406ef0161f9293"
26SRC_URI[sha256sum] = "ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd"
27
28EXTRA_OECONF_class-native = "--without-gmp"
29EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
30EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
31
32# acl and xattr are not default features
33#
34PACKAGECONFIG_class-target ??= "\
35 ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
36"
37
38# The lib/oe/path.py requires xattr
39PACKAGECONFIG_class-native ??= "xattr"
40
41# with, without, depends, rdepends
42#
43PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
44PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
45PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
46
47# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
48bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
49 env expand expr factor fmt fold groups head hostid id install \
50 join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
51 pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
Brad Bishop64c979e2019-11-04 13:55:29 -050052 sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \
Brad Bishopc342db32019-05-15 21:57:59 -040053 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
54
55# hostname gets a special treatment and is not included in this
56base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
57 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
58
59sbindir_progs= "chroot"
60
Brad Bishop64c979e2019-11-04 13:55:29 -050061PACKAGE_BEFORE_PN_class-target += "coreutils-stdbuf"
62FILES_coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so"
63RDEPENDS_coreutils_class-target += "coreutils-stdbuf"
64
Brad Bishopc342db32019-05-15 21:57:59 -040065# Let aclocal use the relative path for the m4 file rather than the
66# absolute since coreutils has a lot of m4 files, otherwise there might
67# be an "Argument list too long" error when it is built in a long/deep
68# directory.
69acpaths = "-I ./m4"
70
71# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
72do_compile_prepend () {
73 mkdir -p ${B}/src
74}
75
76do_install_class-native() {
77 autotools_do_install
78 # remove groups to fix conflict with shadow-native
79 rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
80 # The return is a must since native doesn't need the
81 # do_install_append() in the below.
82 return
83}
84
85do_install_append() {
86 for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
87
88 install -d ${D}${base_bindir}
89 [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
90
91 install -d ${D}${sbindir}
92 [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
93
94 # [ requires special handling because [.coreutils will cause the sed stuff
95 # in update-alternatives to fail, therefore use lbracket - the name used
96 # for the actual source file.
97 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
98}
99
100inherit update-alternatives
101
102ALTERNATIVE_PRIORITY = "100"
103# Make hostname's priority higher than busybox but lower than net-tools
104ALTERNATIVE_PRIORITY[hostname] = "90"
105ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
106ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
107
108ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
109
110ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
111ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
112ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
113
114ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
115ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
116ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
117
118ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
119ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
120ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
121
122ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
123ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
124ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
125
126ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
127ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
128
129ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
130ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
131
132ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
133ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
134ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
135ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
136
137python __anonymous() {
138 for prog in d.getVar('base_bindir_progs').split():
139 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
140
141 for prog in d.getVar('sbindir_progs').split():
142 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
143}
144
145BBCLASSEXTEND = "native nativesdk"