Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Static checks (shellcheck) for the build scripts
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint build scripts
run: bash tests/test_lint.sh

# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ sslv3=""
autobuild=""

# Formatting
default="\033[39m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
Expand Down
25 changes: 8 additions & 17 deletions curl/libcurl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
set -e

# Formatting
default="\033[39m"
wihte="\033[97m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
yellow="\033[33m"
Expand Down Expand Up @@ -311,20 +310,18 @@ buildCatalyst()
NGHTTP2CFG="--without-nghttp2"
NGHTTP2LIB=""
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}.sdk"
export CC="${DEVELOPER}/usr/bin/gcc"
export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -target $TARGET ${CC_BITCODE_FLAG}"
export LDFLAGS="-arch ${ARCH} -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -L${OPENSSL}/catalyst/lib ${NGHTTP2LIB}"
export LDFLAGS="-arch ${ARCH} -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -L${OPENSSL}/Catalyst/lib ${NGHTTP2LIB}"

echo -e "${subbold}Building ${CURL_VERSION} for ${archbold}${ARCH}${dim} ${BITCODE} (Mac Catalyst iOS ${CATALYST_IOS})"

if [[ "${ARCH}" == "arm64" ]]; then
./configure -prefix="/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}" $CONF_FLAGS --with-ssl=${OPENSSL}/catalyst ${NGHTTP2CFG} --host="arm-apple-darwin" &> "/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}.log"
./configure -prefix="/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}" $CONF_FLAGS --with-ssl=${OPENSSL}/Catalyst ${NGHTTP2CFG} --host="arm-apple-darwin" &> "/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}.log"
else
./configure -prefix="/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}" $CONF_FLAGS --with-ssl=${OPENSSL}/catalyst ${NGHTTP2CFG} --host="${ARCH}-apple-darwin" &> "/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}.log"
./configure -prefix="/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}" $CONF_FLAGS --with-ssl=${OPENSSL}/Catalyst ${NGHTTP2CFG} --host="${ARCH}-apple-darwin" &> "/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}.log"
fi

make -j${CORES} >> "/tmp/${CURL_VERSION}-catalyst-${ARCH}-${BITCODE}.log" 2>&1
Expand Down Expand Up @@ -358,8 +355,6 @@ buildIOS()
NGHTTP2CFG="--without-nghttp2"
NGHTTP2LIB=""
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
export CC="${DEVELOPER}/usr/bin/gcc"
Expand Down Expand Up @@ -415,7 +410,6 @@ buildIOSsim()
fi

# set up exports for build
export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
export CC="${DEVELOPER}/usr/bin/gcc"
Expand Down Expand Up @@ -465,8 +459,6 @@ buildTVOS()
NGHTTP2CFG="--without-nghttp2"
NGHTTP2LIB=""
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${TVOS_SDK_VERSION}.sdk"
export CC="${DEVELOPER}/usr/bin/gcc"
Expand Down Expand Up @@ -516,9 +508,8 @@ buildTVOSsim()

TARGET="darwin64-${ARCH}-cc"
RUNTARGET="-target ${ARCH}-apple-tvos${TVOS_MIN_SDK_VERSION}-simulator"

export $PLATFORM
export SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
export SYSROOT
export CC="${DEVELOPER}/usr/bin/gcc"
export CXX="${DEVELOPER}/usr/bin/gcc"
export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SYSROOT} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} ${CC_BITCODE_FLAG} ${RUNTARGET}"
Expand Down Expand Up @@ -550,8 +541,8 @@ mkdir -p lib
mkdir -p include/curl/

rm -fr "/tmp/curl"
rm -rf "/tmp/${CURL_VERSION}-*"
rm -rf "/tmp/${CURL_VERSION}-*.log"
rm -rf "/tmp/${CURL_VERSION}-"*
rm -rf "/tmp/${CURL_VERSION}-"*.log

rm -rf "${CURL_VERSION}"

Expand Down
2 changes: 1 addition & 1 deletion latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ echo ""

# Tar the build
echo " Creating archive libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2.tgz ..."
cd archive
cd archive || exit 1
tar -czf libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2.tgz libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2

# Load the README into the clipboard
Expand Down
4 changes: 2 additions & 2 deletions nghttp2/automake-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ if ! type "brew" > /dev/null; then
# AUTOCONF
curl -OL http://ftpmirror.gnu.org/autoconf/${AUTOCONF}.tar.gz
tar -xzf ${AUTOCONF}.tar.gz
cd ${AUTOCONF}
cd ${AUTOCONF} || exit 1
echo "building..."
#./configure && make && sudo make install
cd ..

curl -OLs http://ftpmirror.gnu.org/automake/${AUTOMAKE}.tar.gz
tar -xzf ${AUTOMAKE}.tar.gz
cd ${AUTOMAKE}
cd ${AUTOMAKE} || exit 1
echo "building..."
#./configure && make && sudo make install
cd ..
Expand Down
20 changes: 5 additions & 15 deletions nghttp2/nghttp2-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck disable=SC2034 # TARGET is set per-arch but only used by the OpenSSL scripts
# This script downlaods and builds the Mac, iOS and tvOS nghttp2 libraries
#
# Credits:
Expand All @@ -16,8 +17,7 @@
set -e

# Formatting
default="\033[39m"
wihte="\033[97m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
yellow="\033[33m"
Expand All @@ -38,7 +38,6 @@ trap 'exit 1' INT
NGHTTP2_VERNUM="1.41.0"

# Set defaults
VERSION="1.1.1i" # OpenSSL version default
catalyst="0"
BUILDFOR="all"

Expand Down Expand Up @@ -225,7 +224,7 @@ buildMac()

pushd . > /dev/null
cd "${NGHTTP2_VERSION}"
if [[ $ARCH != ${BUILD_MACHINE} ]]; then
if [[ $ARCH != "${BUILD_MACHINE}" ]]; then
# cross compile required
if [[ "${ARCH}" == "arm64" || "${ARCH}" == "arm64e" ]]; then
./configure --disable-shared --disable-app --disable-threads --enable-lib-only --prefix="${NGHTTP2}/Mac/${ARCH}" --host="arm-apple-darwin" &> "/tmp/${NGHTTP2_VERSION}-${ARCH}.log"
Expand Down Expand Up @@ -338,8 +337,6 @@ buildIOS()
else
CC_BITCODE_FLAG="-fembed-bitcode"
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
export BUILD_TOOLS="${DEVELOPER}"
Expand Down Expand Up @@ -376,7 +373,6 @@ buildIOSsim()
cd "${NGHTTP2_VERSION}"

PLATFORM="iPhoneSimulator"
export $PLATFORM

TARGET="darwin-i386-cc"
RUNTARGET=""
Expand All @@ -392,8 +388,6 @@ buildIOSsim()
else
CC_BITCODE_FLAG="-fembed-bitcode"
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
export BUILD_TOOLS="${DEVELOPER}"
Expand Down Expand Up @@ -433,8 +427,6 @@ buildTVOS()
else
PLATFORM="AppleTVOS"
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${TVOS_SDK_VERSION}.sdk"
export BUILD_TOOLS="${DEVELOPER}"
Expand Down Expand Up @@ -480,11 +472,9 @@ buildTVOSsim()

PLATFORM="AppleTVSimulator"

TARGET="darwin64-${ARCH}-cc"
RUNTARGET="-target ${ARCH}-apple-tvos${TVOS_MIN_SDK_VERSION}-simulator"

export $PLATFORM
export SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
export SYSROOT
export BUILD_TOOLS="${DEVELOPER}"
export CC="${BUILD_TOOLS}/usr/bin/gcc"
export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SYSROOT} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} -fembed-bitcode ${RUNTARGET}"
Expand Down
17 changes: 7 additions & 10 deletions openssl/openssl-build-phase1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ set -e
CUSTOMCONFIG="enable-ssl-trace"

# Formatting
default="\033[39m"
wihte="\033[97m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
yellow="\033[33m"
Expand All @@ -40,6 +39,7 @@ MACOS_X86_64_VERSION="" # Empty = use host version
MACOS_ARM64_VERSION="" # Min supported is MacOS 11.0 Big Sur
CATALYST_IOS="15.0" # Min supported is iOS 15.0 for Mac Catalyst
IOS_MIN_SDK_VERSION="8.0"
# shellcheck disable=SC2034 # kept for parity with phase2
IOS_SDK_VERSION=""
TVOS_MIN_SDK_VERSION="9.0"
TVOS_SDK_VERSION=""
Expand Down Expand Up @@ -306,8 +306,6 @@ buildTVOS()
PLATFORM="AppleTVOS"
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${TVOS_SDK_VERSION}.sdk"
export BUILD_TOOLS="${DEVELOPER}"
Expand Down Expand Up @@ -382,9 +380,8 @@ buildTVOSsim()
PLATFORM="AppleTVSimulator"
TARGET="darwin64-${ARCH}-cc"
RUNTARGET="-target ${ARCH}-apple-tvos${TVOS_MIN_SDK_VERSION}-simulator"

export $PLATFORM
export SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
SYSROOT=$(xcrun --sdk appletvsimulator --show-sdk-path)
export SYSROOT
export BUILD_TOOLS="${DEVELOPER}"
export CC="${BUILD_TOOLS}/usr/bin/gcc -fembed-bitcode -arch ${ARCH}"
export LC_CTYPE=C
Expand Down Expand Up @@ -465,8 +462,8 @@ mkdir -p tvOS-simulator/lib
mkdir -p tvOS-simulator/include/openssl/

rm -rf "/tmp/openssl"
rm -rf "/tmp/${OPENSSL_VERSION}-*"
rm -rf "/tmp/${OPENSSL_VERSION}-*.log"
rm -rf "/tmp/${OPENSSL_VERSION}-"*
rm -rf "/tmp/${OPENSSL_VERSION}-"*.log

rm -rf "${OPENSSL_VERSION}"

Expand All @@ -493,7 +490,7 @@ tar xfz "${OPENSSL_VERSION}.tar.gz"

if [ "$engine" == "1" ]; then
echo -e "${dim}+ Activate Static Engine"
sed -ie 's/\"engine/\"dynamic-engine/' ${OPENSSL_VERSION}/Configurations/15-ios.conf
sed -i '' 's/\"engine/\"dynamic-engine/' ${OPENSSL_VERSION}/Configurations/15-ios.conf
fi

## Mac
Expand Down
17 changes: 8 additions & 9 deletions openssl/openssl-build-phase2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ set -e
CUSTOMCONFIG="enable-ssl-trace"

# Formatting
default="\033[39m"
wihte="\033[97m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
yellow="\033[33m"
Expand All @@ -37,6 +36,7 @@ CATALYST_IOS="15.0" # Min supported is iOS 15.0 for Mac Catalyst
IOS_MIN_SDK_VERSION="8.0"
IOS_SDK_VERSION=""
TVOS_MIN_SDK_VERSION="9.0"
# shellcheck disable=SC2034 # kept for parity with phase1
TVOS_SDK_VERSION=""
catalyst="0"
VERSION="3.0.9" # OpenSSL version default
Expand Down Expand Up @@ -99,9 +99,11 @@ while getopts "v:s:t:i:a:u:p:emx3h\?" o; do
engine=1
;;
m)
# shellcheck disable=SC2034 # Catalyst is built in phase1
catalyst="1"
;;
u)
# shellcheck disable=SC2034
catalyst="1"
CATALYST_IOS="${OPTARG}"
;;
Expand Down Expand Up @@ -156,8 +158,6 @@ buildIOS()
PLATFORM="iPhoneOS"
#sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
fi

export $PLATFORM
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
export BUILD_TOOLS="${DEVELOPER}"
Expand Down Expand Up @@ -217,7 +217,6 @@ buildIOSsim()
cd "${OPENSSL_VERSION}"

PLATFORM="iPhoneSimulator"
export $PLATFORM

TARGET="darwin-i386-cc"
RUNTARGET=""
Expand Down Expand Up @@ -252,7 +251,7 @@ buildIOSsim()
export CC="${BUILD_TOOLS}/usr/bin/gcc"
export CXX="${BUILD_TOOLS}/usr/bin/gcc"

echo -e "${subbold}Building ${OPENSSL_VERSION} for ${PLATFORM} ${iOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${MIPHONEOS})"
echo -e "${subbold}Building ${OPENSSL_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${MIPHONEOS})"

# configure
if [[ "$OPENSSL_VERSION" = "openssl-1.0"* ]]; then
Expand Down Expand Up @@ -292,8 +291,8 @@ mkdir -p iOS-simulator/include/openssl/
mkdir -p iOS-fat/include/openssl/
mkdir -p tvOS/include/openssl/

rm -rf "/tmp/${OPENSSL_VERSION}-*"
rm -rf "/tmp/${OPENSSL_VERSION}-*.log"
rm -rf "/tmp/${OPENSSL_VERSION}-"*
rm -rf "/tmp/${OPENSSL_VERSION}-"*.log

rm -rf "${OPENSSL_VERSION}"

Expand All @@ -320,7 +319,7 @@ tar xfz "${OPENSSL_VERSION}.tar.gz"

if [ "$engine" == "1" ]; then
echo -e "${dim}+ Activate Static Engine"
sed -ie 's/\"engine/\"dynamic-engine/' ${OPENSSL_VERSION}/Configurations/15-ios.conf
sed -i '' 's/\"engine/\"dynamic-engine/' ${OPENSSL_VERSION}/Configurations/15-ios.conf
fi

# iOS
Expand Down
2 changes: 1 addition & 1 deletion openssl/openssl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ OPENSSL_VERSION="$VERSION" ./openssl-build-phase1.sh "$@"
OPENSSL_VERSION="$VERSION" ./openssl-build-phase2.sh "$@"

# Done
echo -e "${normal}Done"
echo "Done"
11 changes: 2 additions & 9 deletions stage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck disable=SC2034 # shared color palette; not every color is used here
#
# Sync Builds to S3 for next stage
#
Expand All @@ -8,21 +9,15 @@
# export AWS_SECRET_ACCESS_KEY=""

# Formatting
default="\033[39m"
wihte="\033[97m"
white="\033[97m"
green="\033[32m"
red="\033[91m"
yellow="\033[33m"

bold="\033[0m${green}\033[1m"
subbold="\033[0m${green}"
archbold="\033[0m${yellow}\033[1m"
normal="${white}\033[0m"
dim="\033[0m${white}\033[2m"
alert="\033[0m${red}\033[1m"
alertdim="\033[0m${red}\033[2m"

OPENSSL_PHASE="1"

EXAMPLE="example/iOS Test App"

Expand All @@ -45,8 +40,6 @@ usage ()
exit 127
}

engine=0

while getopts "o:ncduth\?" o; do
case "${o}" in
o)
Expand Down
Loading