Ports: Add curl port!

This commit is contained in:
Bananymous 2024-06-17 21:40:13 +03:00
parent 5236e1ef0d
commit 78928b7eb4
3 changed files with 71 additions and 0 deletions

1
ports/curl/.gitignore vendored Normal file
View File

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

58
ports/curl/build.sh Executable file
View File

@ -0,0 +1,58 @@
#!/bin/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 doom ../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 && make install

View File

@ -0,0 +1,12 @@
diff -ruN curl-8.8.0/config.sub curl-patched/config.sub
--- curl-8.8.0/config.sub 2023-03-13 00:39:42.000000000 +0200
+++ curl-patched/config.sub 2024-06-17 21:16:00.348556957 +0300
@@ -1754,7 +1754,7 @@
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
- | fiwix* )
+ | fiwix* | banan_os* )
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)