coreutils_8.32.bb 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 = "GPLv3+"
  8. LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
  9. file://src/ls.c;beginline=1;endline=15;md5=b7d80abf5b279320fb0e4b1007ed108b \
  10. "
  11. DEPENDS = "gmp libcap"
  12. DEPENDS_class-native = ""
  13. inherit autotools gettext texinfo
  14. SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
  15. file://remove-usr-local-lib-from-m4.patch \
  16. file://fix-selinux-flask.patch \
  17. file://0001-uname-report-processor-and-hardware-correctly.patch \
  18. file://disable-ls-output-quoting.patch \
  19. file://0001-local.mk-fix-cross-compiling-problem.patch \
  20. file://run-ptest \
  21. file://0001-ls-restore-8.31-behavior-on-removed-directories.patch \
  22. "
  23. SRC_URI[md5sum] = "022042695b7d5bcf1a93559a9735e668"
  24. SRC_URI[sha256sum] = "4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa"
  25. EXTRA_OECONF_class-native = "--without-gmp"
  26. EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
  27. EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
  28. # acl and xattr are not default features
  29. #
  30. PACKAGECONFIG_class-target ??= "\
  31. ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
  32. "
  33. # The lib/oe/path.py requires xattr
  34. PACKAGECONFIG_class-native ??= "xattr"
  35. # with, without, depends, rdepends
  36. #
  37. PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
  38. PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
  39. PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
  40. # [ df mktemp nice printenv base64 gets a special treatment and is not included in this
  41. bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
  42. env expand expr factor fmt fold groups head hostid id install \
  43. join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
  44. pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
  45. sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \
  46. tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
  47. # hostname gets a special treatment and is not included in this
  48. base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
  49. mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
  50. sbindir_progs= "chroot"
  51. # Split stdbuf into its own package, so one can include
  52. # coreutils-stdbuf without getting the rest of coreutils, but make
  53. # coreutils itself pull in stdbuf, so IMAGE_INSTALL += "coreutils"
  54. # always provides all coreutils
  55. PACKAGE_BEFORE_PN_class-target += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', '', 'coreutils-stdbuf', d)}"
  56. FILES_coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so"
  57. RDEPENDS_coreutils_class-target += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', '', 'coreutils-stdbuf', d)}"
  58. # However, when the single-binary PACKAGECONFIG is used, stdbuf
  59. # functionality is built into the single coreutils binary, so there's
  60. # no point splitting /usr/bin/stdbuf to its own package. Instead, add
  61. # an RPROVIDE so that rdepending on coreutils-stdbuf will work
  62. # regardless of whether single-binary is in effect.
  63. RPROVIDES_coreutils += "${@bb.utils.contains('PACKAGECONFIG', 'single-binary', 'coreutils-stdbuf', '', d)}"
  64. # Let aclocal use the relative path for the m4 file rather than the
  65. # absolute since coreutils has a lot of m4 files, otherwise there might
  66. # be an "Argument list too long" error when it is built in a long/deep
  67. # directory.
  68. acpaths = "-I ./m4"
  69. # Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
  70. do_compile_prepend () {
  71. mkdir -p ${B}/src
  72. }
  73. do_install_class-native() {
  74. autotools_do_install
  75. # remove groups to fix conflict with shadow-native
  76. rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
  77. # The return is a must since native doesn't need the
  78. # do_install_append() in the below.
  79. return
  80. }
  81. do_install_append() {
  82. for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
  83. install -d ${D}${base_bindir}
  84. [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
  85. install -d ${D}${sbindir}
  86. [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
  87. # [ requires special handling because [.coreutils will cause the sed stuff
  88. # in update-alternatives to fail, therefore use lbracket - the name used
  89. # for the actual source file.
  90. mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
  91. }
  92. inherit update-alternatives
  93. ALTERNATIVE_PRIORITY = "100"
  94. # Make hostname's priority higher than busybox but lower than net-tools
  95. ALTERNATIVE_PRIORITY[hostname] = "90"
  96. ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
  97. ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
  98. ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
  99. ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
  100. ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
  101. ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
  102. ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
  103. ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
  104. ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
  105. ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
  106. ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
  107. ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
  108. ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
  109. ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
  110. ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
  111. ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
  112. ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
  113. ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
  114. ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
  115. ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
  116. ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
  117. ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
  118. ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
  119. python __anonymous() {
  120. for prog in d.getVar('base_bindir_progs').split():
  121. d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
  122. for prog in d.getVar('sbindir_progs').split():
  123. d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
  124. }
  125. BBCLASSEXTEND = "native nativesdk"
  126. inherit ptest
  127. RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl make perl perl-modules python3-core sed shadow"
  128. # -dev automatic dependencies fails as we don't want libmodule-build-perl-dev, its too heavy
  129. # may need tweaking if DEPENDS changes
  130. RRECOMMENDS_coreutils-dev[nodeprrecs] = "1"
  131. RRECOMMENDS_coreutils-dev = "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev"
  132. do_install_ptest () {
  133. install -d ${D}${PTEST_PATH}/tests
  134. cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
  135. sed -i 's/ginstall/install/g' `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq`
  136. install -d ${D}${PTEST_PATH}/build-aux
  137. install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
  138. cp ${B}/Makefile ${D}${PTEST_PATH}/
  139. cp ${S}/init.cfg ${D}${PTEST_PATH}/
  140. cp -r ${B}/src ${D}${PTEST_PATH}/
  141. cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src
  142. sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile
  143. sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile
  144. sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile
  145. sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
  146. sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
  147. sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
  148. sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile
  149. chmod -R 777 ${D}${PTEST_PATH}
  150. # Disable subcase stty-pairs.sh, it will cause test framework hang
  151. sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile
  152. # Disable subcase tail-2/assert.sh as it has issues on 32-bit systems
  153. sed -i '/assert.sh/d' ${D}${PTEST_PATH}/Makefile
  154. # Tweak test d_type-check to use python3 instead of python
  155. sed -i "1s@.*@#!/usr/bin/python3@" ${D}${PTEST_PATH}/tests/d_type-check
  156. install ${B}/src/getlimits ${D}/${bindir}
  157. # handle multilib
  158. sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
  159. }
  160. FILES_${PN}-ptest += "${bindir}/getlimits"