Skip to content

Commit

Permalink
adding curl
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jan 23, 2025
1 parent 68c7306 commit 45fbce3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions libcurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Require MacOS 11 or up now
if [ "x${OSTYPE:6:1}" = "x1" ]; then return 0; fi
bottle="https://github.com/autobrew/bundler/releases/download/curl-8.11.1_1/curl-lite-8.11.1_1-universal.tar.xz"

# Skip if disabled
if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
echo "Using autobrew bundle: $(basename $bottle)"

# General setup
BREWDIR="$PWD/.deps"
mkdir -p $BREWDIR

# Download if we did not do it yet
if [ ! -f "$BREWDIR/lib/libbrewcurl.a" ]; then
curl -sSL $bottle -o libs.tar.xz
tar -xf libs.tar.xz --strip 1 -C $BREWDIR
rm -f libs.tar.xz
fi

# Hardcoded flags
PKG_CFLAGS="-I${BREWDIR}/include -mmacosx-version-min=11.0"
PKG_LIBS="-L${BREWDIR}/lib -lcurl -lnghttp2 -lssl -lcrypto -lldap $(krb5-config --libs) -lz -framework Security -framework SystemConfiguration"

# Prevent linking against other libs in /usr/local/lib
for FILE in $BREWDIR/lib/*.a; do
BASENAME=$(basename $FILE)
LIBNAME=$(echo "${BASENAME%.*}" | cut -c4-)
cp -f $FILE $BREWDIR/lib/libbrew$LIBNAME.a
PKG_LIBS=$(echo $PKG_LIBS | sed "s/-l$LIBNAME /-lbrew$LIBNAME /g")
done

0 comments on commit 45fbce3

Please sign in to comment.