index : bootstrap32 | |
Archlinux32 bootstrap scripts | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | README | 29 | ||||
-rwxr-xr-x | build_stage1_package.sh | 29 | ||||
-rw-r--r-- | default.conf | 2 | ||||
-rw-r--r-- | packages-i486-stage1/perl | 1 | ||||
-rw-r--r-- | packages-i486-stage1/template | 15 |
@@ -201,36 +201,7 @@ expat bzip2 lz4 xz pcre gzip libarchive curl \ file libmpc mpfr libmnl libelf libnfnetlink iptables \ libedit sysfsutils libidn" -# cross-compiling perl doesn't work in parallel -NOPARALLEL_PACKAGE="perl" -for p in $PACKAGES; do - - - - - - # redo the whole cache - rm -rf $STAGE1_CHROOT/var/cache/pacman/pkg/* - rm -rf $STAGE1_CHROOT/packages/i486/temp.db* - rm -rf $STAGE1_CHROOT/packages/i486/temp.files* - repo-add $STAGE1_CHROOT/packages/i486/temp.db.tar.gz $STAGE1_CHROOT/packages/i486/*pkg.tar.xz - - # incrementall add of new package (works once!) - repo-add -n $STAGE1_CHROOT/packages/i486/temp.db.tar.gz $STAGE1_CHROOT/packages/i486/*pkg.tar.xz - - # for util-linux also libutil-linux - sudo pacman --noconfirm --config $STAGE1_CHROOT/etc/pacman.conf -r $STAGE1_CHROOT -Syy $p - pacman --noconfirm --config $STAGE1_CHROOT/etc/pacman.conf -r $STAGE1_CHROOT -Q - - if test $p in $SYSROOT_PACKAGES; then - pushd $HOME/x-tools/i486-unknown-linux-gnu/i486-unknown-linux-gnu/sysroot - sudo bsdtar xvf $STAGE1_CHROOT/packages/i486/$p-*.pkg.tar.xz - popd - fi - - cd .. -done # special patches for some packages ################################### diff --git a/build_stage1_package.sh b/build_stage1_package.sh index dd49693..060a582 100755 --- a/build_stage1_package.sh +++ b/build_stage1_package.sh @@ -13,10 +13,9 @@ PACKAGE=$1 export PATH="$XTOOLS_ARCH/bin:${PATH}" -NEEDS_YAOURT=0 -NOPARALLEL_BUILD=0 +. "$SCRIPT_DIR/packages-$TARGET_CPU-stage1/template" -if test ! -f "$STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE.pkg.tar.xz"; then +if test $(pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Q | grep -c "$PACKAGE") = 0; then echo "Building package $PACKAGE." cd $STAGE1_BUILD || exit 1 @@ -32,7 +31,7 @@ if test ! -f "$STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE.pkg.tar.xz"; then # get the package build description - if test $NEEDS_YAOURT; then + if test "$NEEDS_YAOURT"; then yaourt -G "$PACKAGE" else asp export "$PACKAGE" @@ -48,7 +47,7 @@ if test ! -f "$STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE.pkg.tar.xz"; then sed -i "/^arch=[^#]*any/!{/^arch=(/s/(/($TARGET_CPU /}" PKGBUILD - if test $NOPARALLEL_BUILD = 0; then + if test "$NOPARALLEL_BUILD" = 0; then CPUS=$(nproc) else CPUS=1 @@ -64,7 +63,27 @@ if test ! -f "$STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE.pkg.tar.xz"; then if test $RES = 0; then rm -f ./*debug*.pkg.tar.xz cp -v ./*.pkg.tar.xz $STAGE1_CHROOT/packages/$TARGET_CPU/. + + # redo the whole cache + rm -rf $STAGE1_CHROOT/var/cache/pacman/pkg/* + rm -rf $STAGE1_CHROOT/packages/$TARGET_CPU/temp.db* + 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 + 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 + + 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" + cd "$STAGE1_BUILD/$PACKAGE" || exit 1 + fi + fi + + cd $STAGE1_BUILD || exit 1 + fi echo "Built package $PACKAGE." diff --git a/default.conf b/default.conf index bb0834f..81b913d 100644 --- a/default.conf +++ b/default.conf @@ -29,7 +29,7 @@ GIT_URL_ARCHLINUX32_PACKAGES=https://github.com/archlinux32/packages.git ARCHLINUX32_PACKAGES=$CROSS_HOME/packages32 # uncomment to debug scripts -#set -x +set -x # some default variables, not to be changed SCRIPT=$(sudo realpath -s "$0") diff --git a/packages-i486-stage1/perl b/packages-i486-stage1/perl index 087b08b..1225990 100644 --- a/packages-i486-stage1/perl +++ b/packages-i486-stage1/perl @@ -1 +1,2 @@ +# cross-compiling perl doesn't work in parallel NOPARALLEL_BUILD=1 diff --git a/packages-i486-stage1/template b/packages-i486-stage1/template index 26af3c3..3d5d558 100644 --- a/packages-i486-stage1/template +++ b/packages-i486-stage1/template @@ -1,8 +1,17 @@ -# NEEDS_YAOURT: asp is the default tool to fetch packages, if the +# NEEDS_YAOURT = 0 | 1 +# asp is the default tool to fetch packages, if the # package is only available in AUR, the set NEEDS_YAOURT=1 NEEDS_YAOURT=0 -# NOPARALLEL_BUILD: -j<N> parameter to makepkg will be set to -j -# if NOPARALLEL_PACKAGE=1. The default is to use all avaiable cores +# NOPARALLEL_BUILD = 0 | 1 +# the -j<N> parameter to makepkg will be set to -j if +# NOPARALLEL_PACKAGE=1. The default is to use all avaiable cores # and set -j<CPUS> NOPARALLEL_BUILD=0 + +# SYSROOT_INSTALL = 0 | 1 +# packages are per default only installed in $STAGE1_CHROOT. +# if packages depened on the package being installed you can +# force the installation of the files in the package also into +# the sysroot of the cross-compiler +SYSROOT_INSTALL=0 |