From eeefbe0d6b4f602b6e70d093b287aed8b5e9501f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 28 Jan 2018 21:39:15 +0100 Subject: some more packages, readline fails, no clue --- build_stage1_package.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'build_stage1_package.sh') diff --git a/build_stage1_package.sh b/build_stage1_package.sh index 060a582..bd2de31 100755 --- a/build_stage1_package.sh +++ b/build_stage1_package.sh @@ -15,29 +15,28 @@ export PATH="$XTOOLS_ARCH/bin:${PATH}" . "$SCRIPT_DIR/packages-$TARGET_CPU-stage1/template" -if test $(pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Q | grep -c "$PACKAGE") = 0; then +if test $(pacman --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Q | grep -c "$PACKAGE") = 0; then echo "Building package $PACKAGE." cd $STAGE1_BUILD || exit 1 rm -rf "$PACKAGE" - - # source the package specific configuration - - PACKAGE_CONF="$SCRIPT_DIR/packages-$TARGET_CPU-stage1/$PACKAGE" - if test -f "$PACKAGE_CONF"; then - . "$PACKAGE_CONF" - fi - # get the package build description - + PACKAGE_CONF="$SCRIPT_DIR/packages-$TARGET_CPU-stage1/$PACKAGE" + if test $(grep -c NEEDS_YAOURT $PACKAGE_CONF) = 1; then + NEEDS_YAOURT=$(grep NEEDS_YAOURT $PACKAGE_CONF | cut -f 2 -d =) + fi if test "$NEEDS_YAOURT"; then yaourt -G "$PACKAGE" else asp export "$PACKAGE" fi + cd "$PACKAGE" || exit 1 + # attach our destination platform to be a supported architecture + sed -i "/^arch=[^#]*any/!{/^arch=(/s/(/($TARGET_CPU /}" PKGBUILD + # if exists packages32 diff-PKGBUILD, attach at the end # (we assume, we build only 'core' packages) DIFF_PKGBUILD="$ARCHLINUX32_PACKAGES/core/$PACKAGE/PKGBUILD" @@ -45,7 +44,12 @@ if test $(pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAG cat "$DIFF_PKGBUILD" >> PKGBUILD fi - sed -i "/^arch=[^#]*any/!{/^arch=(/s/(/($TARGET_CPU /}" PKGBUILD + # source package descriptions, sets variables for this script + # and executes whatever is needed to build the package + + if test -f "$PACKAGE_CONF"; then + . "$PACKAGE_CONF" + fi if test "$NOPARALLEL_BUILD" = 0; then CPUS=$(nproc) @@ -70,13 +74,14 @@ if test $(pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAG rm -rf $STAGE1_CHROOT/packages/$TARGET_CPU/temp.files* repo-add $STAGE1_CHROOT/packages/$TARGET_CPU/temp.db.tar.gz $STAGE1_CHROOT/packages/$TARGET_CPU/*pkg.tar.xz - # for util-linux also libutil-linux + # install into chroot via pacman sudo pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Syy "$PACKAGE" pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Q + # optionally install into cross-compiler sysroot with bsdtar if test "$SYSROOT_INSTALL" = 1; then cd "$XTOOLS_ARCH/$TARGET_CPU-unknown-linux-gnu/sysroot" || exit 1 - sudo bsdtar xvf "$STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE-*.pkg.tar.xz" + sudo bsdtar xvf $STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE-*.pkg.tar.xz cd "$STAGE1_BUILD/$PACKAGE" || exit 1 fi -- cgit v1.2.3-54-g00ecf