From 2d807e3ca5e53becb729935fe47abb1b2cbbecaa Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 23 Oct 2022 20:03:29 +0200 Subject: [PATCH] tools: Add prefix messages that tell us where we're at in a build, inspired by SerenityOS :) --- ports/add-port.sh | 10 +++++----- ports/bc/package.sh | 2 +- ports/remove-port.sh | 2 +- tools/env.sh | 8 +++++++- tools/install-built-ports.sh | 2 +- tools/setup-binutils.sh | 8 ++++---- tools/setup-gcc.sh | 12 ++++++------ 7 files changed, 25 insertions(+), 19 deletions(-) diff --git a/ports/add-port.sh b/ports/add-port.sh index 2f36899b..73b08103 100755 --- a/ports/add-port.sh +++ b/ports/add-port.sh @@ -71,14 +71,14 @@ then if [ "$?" = "0" ] then echo "Unpacking $pkgname version $pkgver..." - port_unpack + port_unpack | filter-lines $pkgname "unpack" fi command -v port_patch >/dev/null if [ "$?" = "0" ] then echo "Patching $pkgname version $pkgver..." - port_patch + port_patch | filter-lines $pkgname "patch" fi fi @@ -91,11 +91,11 @@ command -v port_configure >/dev/null if [ "$?" = "0" ] then echo "Configuring $pkgname version $pkgver..." - port_configure + port_configure | filter-lines $pkgname "configure" fi echo "Making $pkgname version $pkgver..." -port_build # this one is required +port_build | filter-lines $pkgname "build" # this one is required cd $workdir @@ -103,7 +103,7 @@ mkdir -p $installdir cd $installdir echo "Installing $pkgname version $pkgver..." -port_install +port_install | filter-lines $pkgname "install" if ! [ "$SKIP_ADD_TO_PORTS_LIST" = "1" ] then diff --git a/ports/bc/package.sh b/ports/bc/package.sh index 4ff779b3..a307fd32 100644 --- a/ports/bc/package.sh +++ b/ports/bc/package.sh @@ -21,7 +21,7 @@ port_patch() port_configure() { - HOSTCC=gcc PREFIX=${PREFIX:-""} $workdir/bc-$pkgver/configure --disable-nls --bc-only --disable-history --disable-man-pages + HOSTCC=gcc PREFIX=${PREFIX:-""} $srcdir/configure --disable-nls --bc-only --disable-history --disable-man-pages } port_build() diff --git a/ports/remove-port.sh b/ports/remove-port.sh index 5031852a..52488000 100755 --- a/ports/remove-port.sh +++ b/ports/remove-port.sh @@ -36,7 +36,7 @@ source $pkgscript echo "Removing $pkgname version $pkgver..." cd $installdir -port_uninstall +port_uninstall | filter-lines $pkgname "uninstall" rm -rf $workdir cat $listdir/ports.list | sort | uniq | grep -v $pkgname | tee $listdir/ports.list >/dev/null diff --git a/tools/env.sh b/tools/env.sh index 0d653346..55736a21 100755 --- a/tools/env.sh +++ b/tools/env.sh @@ -8,4 +8,10 @@ export CXX=x86_64-luna-g++ export LD=x86_64-luna-ld export AR=x86_64-luna-ar export ASM=nasm -export STRIP=x86_64-luna-strip \ No newline at end of file +export STRIP=x86_64-luna-strip + +unset -f filter-lines +filter-lines() +{ + sed $'s|^|\x1b[32m('"$1/$2"$')\x1b[39m |' +} \ No newline at end of file diff --git a/tools/install-built-ports.sh b/tools/install-built-ports.sh index 01e4f225..8a535719 100755 --- a/tools/install-built-ports.sh +++ b/tools/install-built-ports.sh @@ -40,7 +40,7 @@ install_port() echo "installing port: $pkgname version $pkgver" mkdir -p $installdir cd $installdir - port_install + port_install | filter-lines $pkgname "install" } while read package; do diff --git a/tools/setup-binutils.sh b/tools/setup-binutils.sh index bb61105d..9b952131 100755 --- a/tools/setup-binutils.sh +++ b/tools/setup-binutils.sh @@ -24,7 +24,7 @@ echo Patching Binutils... cd toolchain -patch -u -i $LUNA_ROOT/tools/binutils.patch -p 1 -d build +patch -u -i $LUNA_ROOT/tools/binutils.patch -p 1 -d build | filter-lines "binutils" "patch" cd - @@ -37,12 +37,12 @@ cd toolchain/build/binutils unset CC unset CXX -../binutils-$LUNA_BINUTILS_VERSION_REQUIRED/configure --prefix="$BUILD_PREFIX" --target=$BUILD_TARGET --disable-nls --with-sysroot=$BUILD_SYSROOT --disable-werror +../binutils-$LUNA_BINUTILS_VERSION_REQUIRED/configure --prefix="$BUILD_PREFIX" --target=$BUILD_TARGET --disable-nls --with-sysroot=$BUILD_SYSROOT --disable-werror | filter-lines "binutils" "configure" echo Building Binutils... -make -j$(nproc) +make -j$(nproc) | filter-lines "binutils" "build" echo Installing Binutils... -make install \ No newline at end of file +make install | filter-lines "binutils" "install" \ No newline at end of file diff --git a/tools/setup-gcc.sh b/tools/setup-gcc.sh index 41b535f1..b448f4d0 100755 --- a/tools/setup-gcc.sh +++ b/tools/setup-gcc.sh @@ -32,7 +32,7 @@ echo Patching GCC... cd toolchain -patch -u -i $LUNA_ROOT/tools/gcc.patch -p 1 -d build +patch -u -i $LUNA_ROOT/tools/gcc.patch -p 1 -d build | filter-lines "gcc" "patch" cd - @@ -45,14 +45,14 @@ cd toolchain/build/gcc unset CC unset CXX -../gcc-$LUNA_GCC_VERSION_REQUIRED/configure --prefix="$BUILD_PREFIX" --target=$BUILD_TARGET --disable-nls --with-sysroot=$BUILD_SYSROOT --enable-languages=c,c++ --without-headers +../gcc-$LUNA_GCC_VERSION_REQUIRED/configure --prefix="$BUILD_PREFIX" --target=$BUILD_TARGET --disable-nls --with-sysroot=$BUILD_SYSROOT --enable-languages=c,c++ --without-headers | filter-lines "gcc" "configure" echo Building GCC... -make all-gcc -j$(nproc) -make all-target-libgcc -j$(nproc) CFLAGS_FOR_TARGET='-g -O2 -mcmodel=large -mno-red-zone' +make all-gcc -j$(nproc) | filter-lines "gcc" "build" +make all-target-libgcc -j$(nproc) CFLAGS_FOR_TARGET='-g -O2 -mcmodel=large -mno-red-zone' | filter-lines "libgcc" "build" echo Installing GCC... -make install-gcc -make install-target-libgcc \ No newline at end of file +make install-gcc | filter-lines "gcc" "install" +make install-target-libgcc | filter-lines "libgcc" "install" \ No newline at end of file