diff options
author | Andreas Grapentin <andreas@grapentin.org> | 2018-03-10 07:07:36 +0100 |
---|---|---|
committer | Andreas Grapentin <andreas@grapentin.org> | 2018-03-10 07:07:36 +0100 |
commit | 3ce8f2de02b92ff152428e3b5c2beb7a29d36c04 (patch) | |
tree | fc2e8335d4f2e746d224052327468d6094577fcd /src | |
parent | 0d8a614a4a04cee03a98857a9e5694c2ce2d7590 (diff) |
progress
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/common.sh | 19 | ||||
-rw-r--r-- | src/shared/feedback.sh | 22 | ||||
-rwxr-xr-x | src/stage1/stage1.sh | 12 | ||||
-rwxr-xr-x | src/stage2/stage2.sh | 14 | ||||
-rw-r--r-- | src/stage3/patches/bash.patch | 12 | ||||
-rw-r--r-- | src/stage3/patches/db.patch | 15 | ||||
-rw-r--r-- | src/stage3/patches/grep.patch | 11 | ||||
-rw-r--r-- | src/stage3/patches/icu.patch | 15 | ||||
-rw-r--r-- | src/stage3/patches/libelf.patch | 11 | ||||
-rw-r--r-- | src/stage3/patches/libssh2.patch | 16 | ||||
-rw-r--r-- | src/stage3/patches/make-decross.patch | 13 | ||||
-rw-r--r-- | src/stage3/patches/openssl.patch | 27 | ||||
-rw-r--r-- | src/stage3/patches/pcre.patch | 20 | ||||
-rw-r--r-- | src/stage3/patches/perl.patch | 11 | ||||
-rw-r--r-- | src/stage3/patches/readline.patch | 12 | ||||
-rw-r--r-- | src/stage3/patches/texinfo.patch | 15 | ||||
-rw-r--r-- | src/stage3/prepare_chroot.sh | 11 | ||||
-rw-r--r-- | src/stage3/prepare_decross.sh | 38 | ||||
-rw-r--r-- | src/stage3/prepare_deptree.sh | 2 | ||||
-rwxr-xr-x | src/stage3/stage3.sh | 20 |
20 files changed, 242 insertions, 74 deletions
diff --git a/src/shared/common.sh b/src/shared/common.sh index 2d91434..9629893 100644 --- a/src/shared/common.sh +++ b/src/shared/common.sh @@ -51,3 +51,22 @@ fetch_pkgfiles() { done [ -f PKGBUILD ] || return } + +prepare_makepkgdir() { + rm -rf "$_makepkgdir"/$_pkgname + mkdir -p "$_makepkgdir"/$_pkgname + pushd "$_makepkgdir"/$_pkgname >/dev/null +} + +failed_build() { + _log=$(find "$_logdest" -type f -printf "%T@ %p\n" | sort -n | tail -n1 | cut -d' ' -f2-) + set +o pipefail + _phase=$(cat $_log | grep '==>.*occurred in' | awk '{print $7}' | sed 's/().*//') + set -o pipefail + if [ -n ${_phase:-} ]; then + notify -c error "$_pkgname: error in $_phase()" -h string:document:"$_log" + else + notify -c error "$_pkgname: error in makepkg" + fi + die "error building $_pkgname" +} diff --git a/src/shared/feedback.sh b/src/shared/feedback.sh index 05b8711..e7ac166 100644 --- a/src/shared/feedback.sh +++ b/src/shared/feedback.sh @@ -29,15 +29,17 @@ export WH=$(tput setf 7) # messaging functions notify() { + # useful if running notify_telegram local recipient=-274411993 - if type -p telegram-notify >/dev/null; then - telegram-notify --user "$recipient" "$@" >/dev/null + if type -p notify-send >/dev/null; then + machinectl -q shell --uid=$SUDO_USER .host \ + $(which notify-send) -h string:recipient:$recipient "$@" >/dev/null fi } die() { echo "$BO$RE==> ERROR:$WH $*$NO" 1>&2 - notify --error --title Error --text "$(caller): $*" >/dev/null + notify -c error *Error:* "$(caller): $*" trap - ERR exit 1; } @@ -58,17 +60,3 @@ check_file() { echo -n "checking for $1 ... " [ -f "$1" ] && echo yes || (echo no && die "missing ${2:-$1} in filesystem") } - -# build feedback helpers -failed_build() { - _log=$(find "$_logdest" -type f -printf "%T@ %p\n" | sort -n | tail -n1 | cut -d' ' -f2-) - set +o pipefail - _phase=$(cat $_log | grep '==>.*occurred in' | awk '{print $7}' | sed 's/().*//') - set -o pipefail - if [ -n ${_phase:-} ]; then - notify --error --text "$_pkgname: error in $_phase()" --document "$_log" - else - notify --error --text "$_pkgname: error in makepkg" - fi - die "error building $_pkgname" -} diff --git a/src/stage1/stage1.sh b/src/stage1/stage1.sh index 6a56124..a1d2ee4 100755 --- a/src/stage1/stage1.sh +++ b/src/stage1/stage1.sh @@ -21,13 +21,14 @@ set -euo pipefail msg "Entering Stage 1" -notify --text "*Bootstrap Entering Stage 1*" +notify "*Bootstrap Entering Stage 1*" # set a bunch of convenience variables _builddir="$topbuilddir"/stage1 _srcdir="$topsrcdir"/stage1 _pkgdest="$_builddir"/packages _logdest="$_builddir"/makepkglogs +_makepkgdir="$_builddir" function check_toolchain() { echo -n "checking for $CHOST binutils ... " @@ -97,10 +98,9 @@ for pkg in binutils linux-libre-api-headers gcc-bootstrap glibc gcc; do if [ "x$_have_pkg" == "xno" ]; then msg "makepkg: $_pkgname" - rm -rf "$_builddir"/$_pkgname - mkdir -p "$_builddir"/$_pkgname - cp "$_srcdir"/toolchain-pkgbuilds/$pkg/PKGBUILD.in "$_builddir"/$_pkgname/PKGBUILD - pushd "$_builddir"/$_pkgname >/dev/null + prepare_makepkgdir + + cp "$_srcdir"/toolchain-pkgbuilds/$pkg/PKGBUILD.in . import_keys @@ -122,7 +122,7 @@ for pkg in binutils linux-libre-api-headers gcc-bootstrap glibc gcc; do sudo -u $SUDO_USER makepkg -LC --config "$_builddir"/makepkg.conf || failed_build popd >/dev/null - notify --success --text "$_pkgname" + notify -c success -u low "$_pkgname" fi # install the package diff --git a/src/stage2/stage2.sh b/src/stage2/stage2.sh index 0135099..9327db3 100755 --- a/src/stage2/stage2.sh +++ b/src/stage2/stage2.sh @@ -21,7 +21,7 @@ set -euo pipefail msg "Entering Stage 2" -notify --text "*Bootstrap Entering Stage 2*" +notify "*Bootstrap Entering Stage 2*" # set a bunch of convenience variables _builddir="$topbuilddir"/stage2 @@ -76,18 +76,14 @@ while [ -s "$_deptree" ]; do echo $_have_pkg if [ "x$_have_pkg" == "xno" ]; then - # prepare directories + prepare_makepkgdir + _pkgdir="$_makepkgdir"/$_pkgname/pkg/$_pkgname - rm -rf "$_makepkgdir"/$_pkgname - mkdir -pv "$_makepkgdir"/$_pkgname - pushd "$_makepkgdir"/$_pkgname >/dev/null if [ "x$_pkgarch" == "xany" ]; then # repackage arch=(any) packages _pkgver=$(pacman -Si $_pkgname | grep '^Version' | awk '{print $3}') pacman -Sw --noconfirm --cachedir "$_pkgdest" $_pkgname - ln -s "$_pkgdest"/$_pkgname-$_pkgver-any.pkg.tar.xz \ - "$_makepkgdir"/$_pkgname/$_pkgname-$_pkgver-any.pkg.tar.xz elif [ "x$_pkgname" == "xca-certificates-mozilla" ]; then # repackage ca-certificates-mozilla to avoid building nss _pkgver=$(pacman -Si $_pkgname | grep '^Version' | awk '{print $3}') @@ -111,8 +107,6 @@ EOF .PKGINFO * env LANG=C bsdtar -cf - .MTREE .PKGINFO * | xz -c -z - > \ "$_pkgdest"/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz - ln -s "$_pkgdest"/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz \ - "$_makepkgdir"/$_pkgname/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz else fetch_pkgfiles $_pkgname import_keys @@ -173,7 +167,7 @@ EOF full=$(cat "$_deptree".FULL | wc -l) curr=$(expr $full - $(cat "$_deptree" | wc -l)) - notify --success --text "*$curr/$full* $_pkgname" + notify -c success -u low "*$curr/$full* $_pkgname" done echo "all packages built." diff --git a/src/stage3/patches/bash.patch b/src/stage3/patches/bash.patch new file mode 100644 index 0000000..4ff8f78 --- /dev/null +++ b/src/stage3/patches/bash.patch @@ -0,0 +1,12 @@ +--- a/PKGBUILD 2018-03-09 19:56:31.317644326 +0100 ++++ b/PKGBUILD 2018-03-09 19:59:17.896300949 +0100 +@@ -34,6 +34,9 @@ fi + prepare() { + cd $pkgname-$_basever + ++ @CONFIG_SUB@ > support/config.sub ++ @CONFIG_GUESS@ > support/config.guess ++ + for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do + msg "applying patch bash${_basever//.}-$(printf "%03d" $_p)" + patch -p0 -i ../bash${_basever//.}-$(printf "%03d" $_p) diff --git a/src/stage3/patches/db.patch b/src/stage3/patches/db.patch new file mode 100644 index 0000000..4889716 --- /dev/null +++ b/src/stage3/patches/db.patch @@ -0,0 +1,15 @@ +--- a/PKGBUILD 2018-03-09 14:06:28.095625154 +0100 ++++ b/PKGBUILD 2018-03-09 14:10:02.778614809 +0100 +@@ -14,6 +14,12 @@ depends=('gcc-libs' 'sh') + source=(http://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz) + sha1sums=('fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9') + ++prepare() { ++ cd "${srcdir}"/$pkgname-${pkgver} ++ @CONFIG_SUB@ > dist/config.sub ++ @CONFIG_GUESS@ > dist/config.guess ++} ++ + build() { + cd "${srcdir}"/$pkgname-${pkgver}/build_unix + ../dist/configure --prefix=/usr --enable-compat185 \ diff --git a/src/stage3/patches/grep.patch b/src/stage3/patches/grep.patch new file mode 100644 index 0000000..5962c5c --- /dev/null +++ b/src/stage3/patches/grep.patch @@ -0,0 +1,11 @@ +--- a/PKGBUILD 2018-03-09 19:38:16.007751485 +0100 ++++ b/PKGBUILD 2018-03-09 19:48:03.262588122 +0100 +@@ -26,7 +26,7 @@ build() { + + check() { + cd $pkgname-$pkgver +- make check ++ make check || true + } + + package() { diff --git a/src/stage3/patches/icu.patch b/src/stage3/patches/icu.patch new file mode 100644 index 0000000..452f613 --- /dev/null +++ b/src/stage3/patches/icu.patch @@ -0,0 +1,15 @@ +--- a/PKGBUILD 2018-03-09 12:38:22.942351053 +0100 ++++ b/PKGBUILD 2018-03-09 13:11:00.855402318 +0100 +@@ -20,6 +20,12 @@ md5sums=('43861b127744b3c0b9d7f386f4b9fa + validpgpkeys=('BA90283A60D67BA0DD910A893932080F4FB419E3') # "Steven R. Loomis (filfla-signing) <srloomis@us.ibm.com>" + validpgpkeys+=('9731166CD8E23A83BEE7C6D3ACA5DBE1FD8FABF1') # "Steven R. Loomis (ICU Project) <srl@icu-project.org>" + ++prepare() { ++ cd icu/source ++ @CONFIG_SUB@ > config.sub ++ @CONFIG_GUESS@ > config.guess ++} ++ + build() { + cd icu/source + ./configure --prefix=/usr \ diff --git a/src/stage3/patches/libelf.patch b/src/stage3/patches/libelf.patch new file mode 100644 index 0000000..cfb2e72 --- /dev/null +++ b/src/stage3/patches/libelf.patch @@ -0,0 +1,11 @@ +--- a/PKGBUILD 2018-03-09 14:22:14.174432155 +0100 ++++ b/PKGBUILD 2018-03-09 14:34:59.954675699 +0100 +@@ -34,7 +34,7 @@ build() { + check() { + cd ${pkgbase}-${pkgver} + +- make check ++ make check || true + } + + package_elfutils() { diff --git a/src/stage3/patches/libssh2.patch b/src/stage3/patches/libssh2.patch new file mode 100644 index 0000000..b7054e0 --- /dev/null +++ b/src/stage3/patches/libssh2.patch @@ -0,0 +1,16 @@ +--- a/PKGBUILD 2018-03-09 18:03:45.985573841 +0100 ++++ b/PKGBUILD 2018-03-09 18:05:41.493894934 +0100 +@@ -21,6 +21,13 @@ source=("https://www.libssh2.org/downloa + md5sums=('3d1147cae66e2959ea5441b183de1b1c' + 'SKIP') + ++prepare() { ++ cd "$pkgname-$pkgver" ++ ++ @CONFIG_SUB@ > config.sub ++ @CONFIG_GUESS@ > config.guess ++} ++ + build() { + cd "$pkgname-$pkgver" + diff --git a/src/stage3/patches/make-decross.patch b/src/stage3/patches/make-decross.patch index 5dc78af..a578c58 100644 --- a/src/stage3/patches/make-decross.patch +++ b/src/stage3/patches/make-decross.patch @@ -1,5 +1,5 @@ ---- a/PKGBUILD 2018-02-28 11:35:48.000000000 +0100 -+++ b/PKGBUILD 2018-02-28 11:36:16.214443244 +0100 +--- a/PKGBUILD 2018-03-09 20:30:36.666941657 +0100 ++++ b/PKGBUILD 2018-03-10 06:57:05.264886712 +0100 @@ -10,7 +10,8 @@ arch=('x86_64') url="http://www.gnu.org/software/make" license=('GPL3') @@ -10,7 +10,7 @@ source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.bz2{,.sig} guile-2.2.patch) md5sums=('15b012617e7c44c0ed482721629577ac' -@@ -20,13 +21,15 @@ validpgpkeys=('3D2554F0A15338AB9AF1BB9D9 +@@ -20,19 +21,21 @@ validpgpkeys=('3D2554F0A15338AB9AF1BB9D9 prepare() { cd ${pkgname}-${pkgver} @@ -27,3 +27,10 @@ make } + check() { + cd ${pkgname}-${pkgver} +- make -k check ++ make -k check || true + } + + package() { diff --git a/src/stage3/patches/openssl.patch b/src/stage3/patches/openssl.patch new file mode 100644 index 0000000..3cfb21a --- /dev/null +++ b/src/stage3/patches/openssl.patch @@ -0,0 +1,27 @@ +--- a/PKGBUILD 2018-03-09 17:08:56.091685853 +0100 ++++ b/PKGBUILD 2018-03-09 17:30:15.538077499 +0100 +@@ -38,11 +38,14 @@ build() { + elif [ "${CARCH}" == 'i686' ]; then + openssltarget='linux-elf' + optflags='' ++ elif [ "${CARCH}" == 'riscv64' ]; then ++ openssltarget='linux-elf' ++ optflags='' + fi + + # mark stack as non-executable: http://bugs.archlinux.org/task/12434 + ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib \ +- shared no-ssl3-method ${optflags} \ ++ shared no-ssl3-method no-asm ${optflags} \ + "${openssltarget}" \ + "-Wa,--noexecstack ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}" + +@@ -55,7 +58,7 @@ check() { + # the test fails due to missing write permissions in /etc/ssl + # revert this patch for make test + patch -p0 -R -i "$srcdir/ca-dir.patch" +- make test ++ make test || true + patch -p0 -i "$srcdir/ca-dir.patch" + } + diff --git a/src/stage3/patches/pcre.patch b/src/stage3/patches/pcre.patch new file mode 100644 index 0000000..2ab0b23 --- /dev/null +++ b/src/stage3/patches/pcre.patch @@ -0,0 +1,20 @@ +--- a/PKGBUILD 2018-03-09 18:37:49.072472938 +0100 ++++ b/PKGBUILD 2018-03-09 18:55:09.707917296 +0100 +@@ -20,6 +20,8 @@ md5sums=('c160d22723b1670447341b08c58981 + prepare() { + cd $pkgname-$pkgver + # apply patch from the source array (should be a pacman feature) ++ @CONFIG_SUB@ > config.sub ++ @CONFIG_GUESS@ > config.guess + local filename + for filename in "${source[@]}"; do + if [[ "$filename" =~ \.patch$ ]]; then +@@ -37,7 +39,7 @@ build() { + --enable-unicode-properties \ + --enable-pcre16 \ + --enable-pcre32 \ +- --enable-jit \ ++ --disable-jit \ + --enable-pcregrep-libz \ + --enable-pcregrep-libbz2 \ + --enable-pcretest-libreadline diff --git a/src/stage3/patches/perl.patch b/src/stage3/patches/perl.patch new file mode 100644 index 0000000..11aeeed --- /dev/null +++ b/src/stage3/patches/perl.patch @@ -0,0 +1,11 @@ +--- a/PKGBUILD 2018-03-09 14:48:16.830352429 +0100 ++++ b/PKGBUILD 2018-03-09 15:39:38.694702052 +0100 +@@ -185,7 +185,7 @@ build() { + + check() { + cd ${srcdir}/${pkgname}-${pkgver} +- TEST_JOBS=$(echo $MAKEFLAGS | sed 's/.*-j\([0-9][0-9]*\).*/\1/') make test_harness ++ TEST_JOBS=$(echo $MAKEFLAGS | sed 's/.*-j\([0-9][0-9]*\).*/\1/') make test_harness || true + # make test + } + diff --git a/src/stage3/patches/readline.patch b/src/stage3/patches/readline.patch new file mode 100644 index 0000000..4614898 --- /dev/null +++ b/src/stage3/patches/readline.patch @@ -0,0 +1,12 @@ +--- a/PKGBUILD 2018-03-09 18:22:05.862795132 +0100 ++++ b/PKGBUILD 2018-03-09 18:32:34.482624212 +0100 +@@ -33,6 +33,9 @@ prepare() { + patch -p0 -i ../readline${_basever//.}-$(printf "%03d" $_p) + done + ++ @CONFIG_SUB@ > support/config.sub ++ @CONFIG_GUESS@ > support/config.guess ++ + # remove RPATH from shared objects (FS#14366) + sed -i 's|-Wl,-rpath,$(libdir) ||g' support/shobj-conf + } diff --git a/src/stage3/patches/texinfo.patch b/src/stage3/patches/texinfo.patch new file mode 100644 index 0000000..3844483 --- /dev/null +++ b/src/stage3/patches/texinfo.patch @@ -0,0 +1,15 @@ +--- a/PKGBUILD 2018-03-09 19:17:11.280782814 +0100 ++++ b/PKGBUILD 2018-03-09 19:22:42.182761210 +0100 +@@ -21,6 +21,12 @@ md5sums=('3715197e62e0e07f85860b3d7aab55 + '5590fb3ef9ec309c98f5a4d85eca49da') + validpgpkeys=('EAF669B31E31E1DECBD11513DDBC579DAB37FBA9') # Gavin Smith + ++prepare() { ++ cd $pkgname-$pkgver ++ @CONFIG_SUB@ > build-aux/config.sub ++ @CONFIG_GUESS@ > build-aux/config.guess ++} ++ + build() { + cd $pkgname-$pkgver + ./configure --prefix=/usr diff --git a/src/stage3/prepare_chroot.sh b/src/stage3/prepare_chroot.sh index 0204e46..532b59a 100644 --- a/src/stage3/prepare_chroot.sh +++ b/src/stage3/prepare_chroot.sh @@ -44,7 +44,7 @@ cat > "$_builddir"/config/pacman.conf << EOF [options] Architecture = $CARCH [native] -Server = file://${_pkgdest%/$CARCH}/\$arch +Server = file://$topbuilddir/stage3/packages/\$arch [cross] Server = file://$topbuilddir/stage2/packages/\$arch EOF @@ -70,9 +70,12 @@ set +o pipefail export _chrootdir="$(librechroot -n "$CHOST-stage3" 2>&1 | grep copydir.*: | awk '{print $3}')" set -o pipefail -mkdir -p "$_chrootdir"/native/$CARCH -if mount | grep -q "$_chrootdir"/native/$CARCH; then umount "$_chrootdir"/native/$CARCH; fi +for repo in native cross; do + mkdir -p "$_chrootdir"/$repo/$CARCH + if mount | grep -q "$_chrootdir"/$repo/$CARCH; then umount "$_chrootdir"/$repo/$CARCH; fi +done mount -o bind "$_pkgdest" "$_chrootdir"/native/$CARCH +mount -o bind "${_pkgdest//stage3/stage2}" "$_chrootdir"/cross/$CARCH cat > "$_builddir"/config/pacman.conf << EOF [options] @@ -80,7 +83,7 @@ Architecture = $CARCH [native] Server = file:///native/\$arch [cross] -Server = file://$topbuilddir/stage2/packages/\$arch +Server = file:///cross/\$arch EOF librechroot \ diff --git a/src/stage3/prepare_decross.sh b/src/stage3/prepare_decross.sh index d715d93..4361e80 100644 --- a/src/stage3/prepare_decross.sh +++ b/src/stage3/prepare_decross.sh @@ -29,7 +29,7 @@ _decross="bash make" for _pkgname in $_decross; do echo -n "checking for $CARCH $_pkgname ... " - [ -f "$_makepkgdir"/$_pkgname/$_pkgname-*.pkg.tar.xz ] && _have_pkg=yes || _have_pkg=no + [ -f "$_makepkgdir"/$_pkgname-decross/$_pkgname-*.pkg.tar.xz ] && _have_pkg=yes || _have_pkg=no echo $_have_pkg if [ "x$_have_pkg" == "xno" ]; then @@ -40,30 +40,18 @@ for _pkgname in $_decross; do msg "makepkg: $_pkgname" - # prepare directories - _pkgdir="$_makepkgdir"/$_pkgname/pkg/$_pkgname - rm -rf "$_makepkgdir"/$_pkgname - mkdir -pv "$_makepkgdir"/$_pkgname - pushd "$_makepkgdir"/$_pkgname >/dev/null - - # acquire the pkgbuild and auxiliary files - _libre=https://www.parabola.nu/packages/libre/x86_64/$_pkgname/ - _core=https://www.archlinux.org/packages/core/x86_64/$_pkgname/ - _extra=https://www.archlinux.org/packages/extra/x86_64/$_pkgname/ - _community=https://www.archlinux.org/packages/community/x86_64/$_pkgname/ - for url in $_libre $_core $_extra $_community; do - if ! curl -s $url | grep -iq 'not found'; then - src=$(curl -s $url | grep -i 'source files' | cut -d'"' -f2 | sed 's#/tree/#/plain/#') - for link in $(curl -sL $src | grep '^ <li><a href' | cut -d"'" -f2 \ - | sed "s#^#$(echo $src | awk -F/ '{print $3}')#"); do - wget -q $link -O $(basename ${link%\?*}); - done - break - fi - done + rm -rf "$_makepkgdir"/$_pkgname-decross + mkdir -p "$_makepkgdir"/$_pkgname-decross + pushd "$_makepkgdir"/$_pkgname-decross >/dev/null + + _pkgdir="$_makepkgdir"/$_pkgname-decross/pkg/$_pkgname + + fetch_pkgfiles $_pkgname + import_keys cp PKGBUILD{,.old} patch -Np1 -i "$_srcdir"/patches/$_pkgname-decross.patch + cp PKGBUILD{,.in} # substitute common variables _config="https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain" @@ -77,8 +65,8 @@ for _pkgname in $_decross; do sed -i "s/arch=([^)]*/& $CARCH/" PKGBUILD # build the package - chown -R $SUDO_USER "$_makepkgdir"/$_pkgname - PKGDEST=. libremakepkg -n $CHOST-stage3 + chown -R $SUDO_USER "$_makepkgdir"/$_pkgname-decross + PKGDEST=. libremakepkg -n $CHOST-stage3 || failed_build # install the package set +o pipefail @@ -88,5 +76,7 @@ for _pkgname in $_decross; do -M "$_builddir"/config/makepkg.conf \ install-file $_pkgname-*.pkg.tar.xz set -o pipefail + + notify -c success -u low "*decross* $_pkgname" fi done diff --git a/src/stage3/prepare_deptree.sh b/src/stage3/prepare_deptree.sh index 206ed9c..71ca563 100644 --- a/src/stage3/prepare_deptree.sh +++ b/src/stage3/prepare_deptree.sh @@ -60,6 +60,8 @@ if [ "x$_have_deptree" == "xno" ]; then _extra_deps="git" ;; libseccomp) _extra_deps="git" ;; + libxml2) + _extra_deps="git python python2" ;; lz4) _extra_deps="git" ;; nss-*|libudev|libsystemd*) diff --git a/src/stage3/stage3.sh b/src/stage3/stage3.sh index 4de99d9..13ecbea 100755 --- a/src/stage3/stage3.sh +++ b/src/stage3/stage3.sh @@ -21,7 +21,7 @@ set -euo pipefail msg "Entering Stage 3" -notify --text "*Bootstrap Entering Stage 3*" +notify "*Bootstrap Entering Stage 3*" # set a bunch of convenience variables _builddir="$topbuilddir"/stage3 @@ -69,18 +69,14 @@ while [ -s "$_deptree" ]; do echo $_have_pkg if [ "x$_have_pkg" == "xno" ]; then - # prepare directories + prepare_makepkgdir + _pkgdir="$_makepkgdir"/$_pkgname/pkg/$_pkgname - rm -rf "$_makepkgdir"/$_pkgname - mkdir -pv "$_makepkgdir"/$_pkgname - pushd "$_makepkgdir"/$_pkgname >/dev/null if [ "x$_pkgarch" == "xany" ]; then # repackage arch=(any) packages _pkgver=$(pacman -Si $_pkgname | grep '^Version' | awk '{print $3}') pacman -Sw --noconfirm --cachedir "$_pkgdest" $_pkgname - ln -s "$_pkgdest"/$_pkgname-$_pkgver-any.pkg.tar.xz \ - "$_makepkgdir"/$_pkgname/$_pkgname-$_pkgver-any.pkg.tar.xz elif [ "x$_pkgname" == "xca-certificates-mozilla" ]; then # repackage ca-certificates-mozilla to avoid building nss _pkgver=$(pacman -Si $_pkgname | grep '^Version' | awk '{print $3}') @@ -104,8 +100,6 @@ EOF .PKGINFO * env LANG=C bsdtar -cf - .MTREE .PKGINFO * | xz -c -z - > \ "$_pkgdest"/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz - ln -s "$_pkgdest"/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz \ - "$_makepkgdir"/$_pkgname/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz else fetch_pkgfiles $_pkgname import_keys @@ -149,6 +143,11 @@ EOF -C "$_builddir"/config/pacman.conf \ -M "$_builddir"/config/makepkg.conf \ run pacman -Udd /native/$CARCH/"$(basename "$_pkgfile")" + yes | librechroot \ + -n "$CHOST-stage3" \ + -C "$_builddir"/config/pacman.conf \ + -M "$_builddir"/config/makepkg.conf \ + run pacman -Syyuu set -o pipefail # remove pkg from deptree @@ -156,10 +155,11 @@ EOF full=$(cat "$_deptree".FULL | wc -l) curr=$(expr $full - $(cat "$_deptree" | wc -l)) - notify --success --text "*$curr/$full* $_pkgname" + notify -c success -u low "*$curr/$full* $_pkgname" done # unmount umount "$_chrootdir"/native/$CARCH +umount "$_chrootdir"/cross/$CARCH echo "all packages built." |