Ports: Update the port system once again!

This commit is contained in:
Bananymous 2024-08-09 17:08:07 +03:00
parent a12bfe4639
commit 58a3a480b9
7 changed files with 38 additions and 15 deletions

View File

@ -4,6 +4,10 @@ NAME='doom'
VERSION='git' VERSION='git'
DOWNLOAD_URL="https://github.com/ozkl/doomgeneric.git#613f870b6fa83ede448a247de5a2571092fa729d" DOWNLOAD_URL="https://github.com/ozkl/doomgeneric.git#613f870b6fa83ede448a247de5a2571092fa729d"
configure() {
:
}
build() { build() {
if [ ! -f doom1.wad ]; then if [ ! -f doom1.wad ]; then
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad || exit 1 wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad || exit 1

View File

@ -6,7 +6,7 @@ if (( $# != 1 )); then
fi fi
if [[ -z $BANAN_ROOT_DIR ]]; then if [[ -z $BANAN_ROOT_DIR ]]; then
BANAN_ROOT_DIR="$(dirname $(realpath $0))/.." BANAN_ROOT_DIR="$(realpath $(dirname $(realpath $0))/..)"
fi fi
source "$BANAN_ROOT_DIR/script/config.sh" source "$BANAN_ROOT_DIR/script/config.sh"
@ -18,6 +18,10 @@ export PKG_CONFIG_SYSROOT_DIR="$BANAN_SYSROOT"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/usr/lib/pkgconfig" export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/usr/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_SYSROOT_DIR/usr/share/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_SYSROOT_DIR/usr/share/pkgconfig"
export CC="$BANAN_TOOLCHAIN_TRIPLE-gcc"
export CXX="$BANAN_TOOLCHAIN_TRIPLE-g++"
export LD="$BANAN_TOOLCHAIN_TRIPLE-ld"
if [ ! -f "$BANAN_SYSROOT/usr/lib/libc.a" ]; then if [ ! -f "$BANAN_SYSROOT/usr/lib/libc.a" ]; then
pushd "$BANAN_ROOT_DIR" >/dev/null pushd "$BANAN_ROOT_DIR" >/dev/null
./bos libc || exit 1 ./bos libc || exit 1
@ -29,11 +33,13 @@ clean() {
find . -mindepth 1 -maxdepth 1 -not -name 'patches' -not -name 'build.sh' -exec rm -rf {} + find . -mindepth 1 -maxdepth 1 -not -name 'patches' -not -name 'build.sh' -exec rm -rf {} +
} }
build() { configure() {
configure_options=("--host=$BANAN_ARCH-banan_os" '--prefix=/usr') configure_options=("--host=$BANAN_ARCH-banan_os" '--prefix=/usr')
configure_options+=(${CONFIGURE_OPTIONS[*]}) configure_options+=("${CONFIGURE_OPTIONS[@]}")
./configure "${configure_options[@]}" || exit 1
}
./configure ${configure_options[*]} || exit 1 build() {
make -j$(nproc) || exit 1 make -j$(nproc) || exit 1
} }
@ -143,6 +149,7 @@ fi
cd "$build_dir" cd "$build_dir"
if (( $needs_compile )); then if (( $needs_compile )); then
configure
build build
sha256sum "$BANAN_SYSROOT/usr/lib/libc.a" > "../.compile_hash" sha256sum "$BANAN_SYSROOT/usr/lib/libc.a" > "../.compile_hash"
fi fi

View File

@ -4,7 +4,10 @@ NAME='ncurses'
VERSION='6.5' VERSION='6.5'
DOWNLOAD_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-$VERSION.tar.gz#136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6" DOWNLOAD_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-$VERSION.tar.gz#136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6"
CONFIGURE_OPTIONS=( CONFIGURE_OPTIONS=(
'--disable-db-intall' "--with-pkg-config='$PKG_CONFIG'"
"--with-pkg-config-libdir=/usr/lib/pkgconfig"
'--enable-pc-files'
'--enable-sigwinch'
'--disable-widec' '--disable-widec'
'--without-ada' '--without-ada'
'--without-manpages' '--without-manpages'

View File

@ -1,9 +1,16 @@
#!/bin/bash #!/bin/bash
if [ -z $BANAN_PORT_DIR ]; then
echo "You must set the BANAN_PORT_DIR environment variable" >&2
exit 1
fi
cd $(dirname $(realpath $0)) cd $(dirname $(realpath $0))
rm -f $BANAN_PORT_DIR/.installed
while IFS= read -r port; do while IFS= read -r port; do
pushd $(dirname "$port") >/dev/null pushd $(dirname "$port") >/dev/null
./build.sh ./build.sh
popd >/dev/null popd >/dev/null
done < <(find . -name '.compile_hash') done < <(find $BANAN_PORT_DIR -name '.compile_hash')

View File

@ -1,6 +1,6 @@
if [[ -z $BANAN_ROOT_DIR ]]; then if [[ -z $BANAN_ROOT_DIR ]]; then
if ! [[ -z $BANAN_SCRIPT_DIR ]]; then if ! [[ -z $BANAN_SCRIPT_DIR ]]; then
export BANAN_ROOT_DIR=$BANAN_SCRIPT_DIR/.. export BANAN_ROOT_DIR="$(realpath $BANAN_SCRIPT_DIR/..)"
else else
echo "You must set the BANAN_ROOT_DIR environment variable" >&2 echo "You must set the BANAN_ROOT_DIR environment variable" >&2
exit 1 exit 1
@ -13,10 +13,12 @@ fi
export BANAN_TOOLCHAIN_DIR=$BANAN_ROOT_DIR/toolchain export BANAN_TOOLCHAIN_DIR=$BANAN_ROOT_DIR/toolchain
export BANAN_TOOLCHAIN_PREFIX=$BANAN_TOOLCHAIN_DIR/local export BANAN_TOOLCHAIN_PREFIX=$BANAN_TOOLCHAIN_DIR/local
export BANAN_TOOLCHAIN_TRIPLE_PREFIX=$BANAN_ARCH-banan_os export BANAN_TOOLCHAIN_TRIPLE=$BANAN_ARCH-banan_os
export BANAN_BUILD_DIR=$BANAN_ROOT_DIR/build export BANAN_BUILD_DIR=$BANAN_ROOT_DIR/build
export BANAN_PORT_DIR=$BANAN_ROOT_DIR/ports
export BANAN_SYSROOT=$BANAN_BUILD_DIR/sysroot export BANAN_SYSROOT=$BANAN_BUILD_DIR/sysroot
export BANAN_SYSROOT_TAR=$BANAN_SYSROOT.tar export BANAN_SYSROOT_TAR=$BANAN_SYSROOT.tar

View File

@ -47,8 +47,8 @@ if [[ -z $BANAN_TOOLCHAIN_PREFIX ]]; then
exit 1 exit 1
fi fi
if [[ -z $BANAN_TOOLCHAIN_TRIPLE_PREFIX ]]; then if [[ -z $BANAN_TOOLCHAIN_TRIPLE ]]; then
echo "You must set the BANAN_TOOLCHAIN_TRIPLE_PREFIX environment variable" >&2 echo "You must set the BANAN_TOOLCHAIN_TRIPLE environment variable" >&2
exit 1 exit 1
fi fi
@ -89,7 +89,7 @@ build_binutils () {
enter_clean_build enter_clean_build
../configure \ ../configure \
--target="$BANAN_TOOLCHAIN_TRIPLE_PREFIX" \ --target="$BANAN_TOOLCHAIN_TRIPLE" \
--prefix="$BANAN_TOOLCHAIN_PREFIX" \ --prefix="$BANAN_TOOLCHAIN_PREFIX" \
--with-sysroot="$BANAN_SYSROOT" \ --with-sysroot="$BANAN_SYSROOT" \
--disable-initfini-array \ --disable-initfini-array \
@ -116,7 +116,7 @@ build_gcc () {
enter_clean_build enter_clean_build
../configure \ ../configure \
--target="$BANAN_TOOLCHAIN_TRIPLE_PREFIX" \ --target="$BANAN_TOOLCHAIN_TRIPLE" \
--prefix="$BANAN_TOOLCHAIN_PREFIX" \ --prefix="$BANAN_TOOLCHAIN_PREFIX" \
--with-sysroot="$BANAN_SYSROOT" \ --with-sysroot="$BANAN_SYSROOT" \
--disable-initfini-array \ --disable-initfini-array \
@ -189,7 +189,7 @@ build_cmake() {
} }
BUILD_BINUTILS=1 BUILD_BINUTILS=1
if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE_PREFIX-ld ]]; then if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE-ld ]]; then
echo "You already seem to have a binutils installed." echo "You already seem to have a binutils installed."
read -e -p "Do you want to rebuild it [y/N]? " choice read -e -p "Do you want to rebuild it [y/N]? " choice
if ! [[ "$choice" == [Yy]* ]]; then if ! [[ "$choice" == [Yy]* ]]; then
@ -198,7 +198,7 @@ if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE_PREFIX-ld ]]; then
fi fi
BUILD_GCC=1 BUILD_GCC=1
if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE_PREFIX-gcc ]]; then if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE-gcc ]]; then
echo "You already seem to have a gcc installed." echo "You already seem to have a gcc installed."
read -e -p "Do you want to rebuild it [y/N]? " choice read -e -p "Do you want to rebuild it [y/N]? " choice
if ! [[ "$choice" == [Yy]* ]]; then if ! [[ "$choice" == [Yy]* ]]; then