# Template file for 'busybox' pkgname=busybox-evolution version=1.36.1 revision=4 hostmakedepends="perl pkg-config" checkdepends="tar which zip" short_desc="Swiss Army Knife of Embedded Linux (evolutionOS edition)" maintainer="Tracker-Friendly " license="GPL-2.0-only" homepage="https://www.busybox.net" distfiles="${homepage}/downloads/busybox-${version}.tar.bz2" checksum=b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314 _alternatives_core=" ash:ash:/usr/bin/busybox awk:awk:/usr/bin/busybox hostname:hostname:/usr/bin/busybox sh:sh:/usr/bin/busybox vi:vi:/usr/bin/busybox logger:logger:/usr/bin/busybox" _alternatives=" ${_alternatives_core} ntpd:ntpd:/usr/bin/busybox ntpd:ntpd:/etc/sv/busybox-ntpd" alternatives="${_alternatives}" register_shell="/usr/bin/ash" _patch_config() { local t="$1" shift while [ "$1" ]; do local p="$1" shift echo "Applying $p..." patch "${t}/.config" <"${FILESDIR}/dotconfig.d/${p}.patch" done } do_configure() { mkdir -p src mv * src || true cp ${FILESDIR}/libbb.h src/include/libbb.h local t for t in busybox busybox-static; do mkdir -p $t cp -f ${FILESDIR}/dotconfig ${t}/.config case "$XBPS_TARGET_MACHINE" in *-musl) vsed -i -e /CONFIG_FEATURE_VI_REGEX_SEARCH/s/y/n/ \ ${t}/.config;; esac if [ "$CROSS_BUILD" ]; then vsed -i -e \ "s,\(CONFIG_CROSS_COMPILER_PREFIX\).*,\1=\"${XBPS_CROSS_TRIPLET}-\",g" \ ${t}/.config fi done _patch_config busybox-static static for t in busybox busybox-static; do make -C "${t}" KBUILD_SRC="${wrksrc}/src" -f "${wrksrc}/src/Makefile" oldconfig make -C "${t}" KBUILD_SRC="${wrksrc}/src" -f "${wrksrc}/src/Makefile" prepare "${makejobs}" done if [ "$SOURCE_DATE_EPOCH" ]; then # rewrite date with the one from the date wrapper. d=$(date +"%F %T %Z") sed -i "s/\(#define AUTOCONF_TIMESTAMP\).*/\1 \"$d\"/" */include/autoconf.h fi } do_build() { for t in busybox busybox-static; do make -C "${t}" SKIP_STRIP=y "${makejobs}" done } do_check() { for t in busybox busybox-static; do make -C "${t}" "${makejobs}" \ SKIP_KNOWN_BUGS=yes SKIP_INTERNET_TESTS=yes \ check done } do_install() { vbin busybox/busybox_unstripped busybox vman busybox/docs/busybox.1 } busybox-static_package() { short_desc+=" (statically linked)" pkg_install() { vbin busybox-static/busybox busybox.static } }