From 2be0dc5c18db474dcca05cca2f5e1c39b2e3527f Mon Sep 17 00:00:00 2001 From: ag-tsotetsi Date: Sun, 8 Feb 2026 11:32:47 +0200 Subject: [PATCH] added bash toolchain step & formatted --- build/bash/build.bash | 49 +++++++++++++++++++++++++++++++++++++ build/bash/package.env | 7 ++++++ build/ncurses/build.bash | 52 ++++++++++++++++++++-------------------- 3 files changed, 82 insertions(+), 26 deletions(-) create mode 100644 build/bash/build.bash create mode 100644 build/bash/package.env diff --git a/build/bash/build.bash b/build/bash/build.bash new file mode 100644 index 0000000..749af78 --- /dev/null +++ b/build/bash/build.bash @@ -0,0 +1,49 @@ + +. "$PROJECTDIR/build/bash/package.env" + +fetch $BASH_URL + +cd "$SOURCES" && tar xf bash-$BASH_VERSION.tar.gz && cd bash-$BASH_VERSION + + +bootstrap() { + echo bootstrap +} + + +toolchain() { + ./configure \ + --prefix=/usr \ + --build=$(sh support/config.guess) \ + --host=$TARGET \ + --without-bash-malloc > /dev/null + + make > /dev/null && make DESTDIR="$SYSROOT" install > /dev/null + ln -sv bash "$SYSROOT/bin/sh" +} + +setup() { + echo setup +} + +final() { + echo final +} + +case $1 in + bootstrap) + bootstrap + ;; + toolchain) + toolchain + ;; + setup) + setup + ;; + final) + final + ;; +esac + + +cd "$SOURCES" && rm -rf "$SOURCES/bash-$BASH_VERSION" diff --git a/build/bash/package.env b/build/bash/package.env new file mode 100644 index 0000000..dc28077 --- /dev/null +++ b/build/bash/package.env @@ -0,0 +1,7 @@ +export BASH_VERSION=5.3 + +IFS='.' read -r BASH_VERSION_MAJOR BASH_VERSION_MINOR <<< $BASH_VERSION +export BASH_VERSION_MAJOR BASH_VERSION_MINOR + +export BASH_URL=https://mirror.ufs.ac.za/gnu/bash/bash-$BASH_VERSION.tar.gz + diff --git a/build/ncurses/build.bash b/build/ncurses/build.bash index e92ce78..4dfe672 100644 --- a/build/ncurses/build.bash +++ b/build/ncurses/build.bash @@ -7,36 +7,36 @@ cd "$SOURCES" && tar xf ncurses-$NCURSES_VERSION.tar.gz && cd ncurses-$NCURSES_V bootstrap() { - echo bootstrap + echo bootstrap } toolchain() { mkdir -p build - pushd build - ../configure --prefix="$SYSROOT/cross" AWK=gawk > /dev/null - make -C include > /dev/null - make -C progs tic > /dev/null - install progs/tic "$SYSROOT/cross/bin" - popd + pushd build + ../configure --prefix="$SYSROOT/cross" AWK=gawk > /dev/null + make -C include > /dev/null + make -C progs tic > /dev/null + install progs/tic "$SYSROOT/cross/bin" + popd - ./configure \ - --prefix=/usr \ - --host=$TARGET \ - --build=$(./config.guess) \ - --mandir=/usr/share/man \ - --with-manpage-format=normal \ - --with-shared \ - --without-normal \ - --with-cxx-shared \ - --without-debug \ - --without-ada \ - --disable-stripping \ - AWK=gawk > /dev/null - - make > /dev/null && make DESTDIR="$SYSROOT" install > /dev/null - ln -s libncursesw.so "$SYSROOT/usr/lib/libncurses.so" - sed -e 's/^#if.*XOPEN.*$/#if 1/' -i "$SYSROOT/usr/include/curses.h" + ./configure \ + --prefix=/usr \ + --host=$TARGET \ + --build=$(./config.guess) \ + --mandir=/usr/share/man \ + --with-manpage-format=normal \ + --with-shared \ + --without-normal \ + --with-cxx-shared \ + --without-debug \ + --without-ada \ + --disable-stripping \ + AWK=gawk > /dev/null + + make > /dev/null && make DESTDIR="$SYSROOT" install > /dev/null + ln -s libncursesw.so "$SYSROOT/usr/lib/libncurses.so" + sed -e 's/^#if.*XOPEN.*$/#if 1/' -i "$SYSROOT/usr/include/curses.h" } setup() { @@ -48,13 +48,13 @@ final() { } case $1 in - bootstrap) + bootstrap) bootstrap ;; toolchain) toolchain ;; - setup) + setup) setup ;; final)