diff --git a/srcpkgs/busybox-static b/srcpkgs/busybox-static new file mode 120000 index 00000000000..c3fa810285e --- /dev/null +++ b/srcpkgs/busybox-static @@ -0,0 +1 @@ +busybox \ No newline at end of file diff --git a/srcpkgs/busybox-static/files b/srcpkgs/busybox-static/files deleted file mode 120000 index 282d65b8cdf..00000000000 --- a/srcpkgs/busybox-static/files +++ /dev/null @@ -1 +0,0 @@ -../busybox/files \ No newline at end of file diff --git a/srcpkgs/busybox-static/template b/srcpkgs/busybox-static/template deleted file mode 100644 index da259deff9d..00000000000 --- a/srcpkgs/busybox-static/template +++ /dev/null @@ -1,14 +0,0 @@ -. ${XBPS_SRCPKGDIR}/busybox/template - -pkgname="busybox-static" -version=1.22.1 -revision=1 -wrksrc="busybox-${version}" -short_desc+=" (statically linked)" -update_pkgname=busybox - -CFLAGS+=" -static" - -do_install() { - vbin busybox busybox.static -} diff --git a/srcpkgs/busybox/files/busybox-static.dotconfig b/srcpkgs/busybox/files/busybox-static.dotconfig new file mode 120000 index 00000000000..9dd22d2792f --- /dev/null +++ b/srcpkgs/busybox/files/busybox-static.dotconfig @@ -0,0 +1 @@ +busybox.dotconfig \ No newline at end of file diff --git a/srcpkgs/busybox/files/dotconfig b/srcpkgs/busybox/files/busybox.dotconfig similarity index 100% rename from srcpkgs/busybox/files/dotconfig rename to srcpkgs/busybox/files/busybox.dotconfig diff --git a/srcpkgs/busybox/template b/srcpkgs/busybox/template index c7c7edc638a..aa31b6e6233 100644 --- a/srcpkgs/busybox/template +++ b/srcpkgs/busybox/template @@ -1,7 +1,7 @@ # Build template for 'busybox'. pkgname=busybox version=1.22.1 -revision=2 +revision=3 hostmakedepends="perl" short_desc="The Swiss Army Knife of Embedded Linux" maintainer="Juan RP " @@ -10,16 +10,47 @@ homepage="http://www.busybox.net" distfiles="${homepage}/downloads/busybox-$version.tar.bz2" checksum=ae0b029d0a9e4dd71a077a790840e496dd838998e4571b87b60fed7462b6678b +_cflags() { + local t=$1 + local c="$CFLAGS" + case $t in + busybox-static) c="$c -static";; + esac + echo "$c" +} + pre_build() { - cp -f ${FILESDIR}/dotconfig .config - if [ "$CROSS_BUILD" ]; then - sed -e "s,\(CONFIG_CROSS_COMPILER_PREFIX\).*,\1=\"${XBPS_CROSS_TRIPLET}-\",g" -i .config - fi + mkdir -p src + mv * src || true + + local t + for t in busybox busybox-static; do + mkdir -p $t + make -C $t CFLAGS="$(_cflags $t)" KBUILD_SRC=${wrksrc}/src \ + -f ${wrksrc}/src/Makefile defconfig + cp -f ${FILESDIR}/${t}.dotconfig ${t}/.config + + if [ "$CROSS_BUILD" ]; then + sed -e \ + "s,\(CONFIG_CROSS_COMPILER_PREFIX\).*,\1=\"${XBPS_CROSS_TRIPLET}-\",g" \ + -i ${t}/.config + fi + done } do_build() { - make ${makejobs} + local t + for t in busybox busybox-static; do + make -C $t CFLAGS="$(_cflags $t)" ${makejobs} + done } do_install() { - vbin busybox - vman docs/busybox.1 + vbin busybox/busybox + vman busybox/docs/busybox.1 +} + +busybox-static_package() { + short_desc+=" (statically linked)" + pkg_install() { + vbin busybox-static/busybox busybox.static + } }