BuildSystem: Rewrite port compilation system

Now ports define some environment variables, and call a unified bash
script that handles configuration, recompilation and installation.

If a port uses non-configure buildsystem, port script can also specify
custom build and install step.
This commit is contained in:
2024-08-05 15:14:09 +03:00
parent 4d96ae56ac
commit 352c1ddc16
11 changed files with 179 additions and 108 deletions

View File

@@ -1 +0,0 @@
curl-*

View File

@@ -1,58 +1,11 @@
#!/bin/sh
#!/bin/bash ../install.sh
if [ -z $BANAN_ARCH ]; then
echo "You must set the BANAN_ARCH environment variable" >&2
exit 1
fi
if [ -z $BANAN_SYSROOT ]; then
echo "You must set the BANAN_ARCH environment variable" >&2
exit 1
fi
if [ -z $BANAN_TOOLCHAIN_PREFIX ]; then
echo "You must set the BANAN_TOOLCHAIN_PREFIX environment variable" >&2
exit 1
fi
CURL_VERSION="curl-8.8.0"
CURL_TAR="$CURL_VERSION.tar.gz"
CURL_URL="https://curl.se/download/$CURL_TAR"
cd $(dirname $(realpath $0))
if [ ! -d $CURL_VERSION ]; then
if [ ! -f $CURL_TAR ]; then
wget $CURL_URL
fi
tar xf $CURL_TAR
for patch in ./patches/*; do
patch -ruN -d $CURL_VERSION < "$patch"
done
grep -qxF curl ../installed || echo curl >> ../installed
fi
cd $CURL_VERSION
export PATH="$BANAN_TOOLCHAIN_PREFIX/bin:$PATH"
if [ ! -d "build-${BANAN_ARCH}" ]; then
mkdir -p "build-${BANAN_ARCH}"
cd "build-${BANAN_ARCH}"
../configure \
--host=x86_64-banan_os \
--prefix=$BANAN_SYSROOT/usr \
--without-ssl \
--disable-threaded-resolver \
--disable-ipv6 \
--disable-docs
cd ..
fi
cd "build-${BANAN_ARCH}"
make -j $(nproc) && make install
NAME='curl'
VERSION='8.8.0'
DOWNLOAD_URL="https://curl.se/download/curl-$VERSION.tar.gz#77c0e1cd35ab5b45b659645a93b46d660224d0024f1185e8a95cdb27ae3d787d"
CONFIGURE_OPTIONS=(
'--without-ssl'
'--disable-threaded-resolver'
'--disable-ipv6'
'--disable-docs'
)