summaryrefslogtreecommitdiff
path: root/build_stage1_package.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-01-28 21:39:15 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-01-28 21:39:15 +0100
commiteeefbe0d6b4f602b6e70d093b287aed8b5e9501f (patch)
tree1eb850e38e4c53da4f161275085c52fd60c40145 /build_stage1_package.sh
parent7478bb7a8eaefdd53e26372810d8580b8509b0c7 (diff)
downloadbootstrap32-eeefbe0d6b4f602b6e70d093b287aed8b5e9501f.tar.xz
some more packages, readline fails, no clue
Diffstat (limited to 'build_stage1_package.sh')
-rwxr-xr-xbuild_stage1_package.sh31
1 files changed, 18 insertions, 13 deletions
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