Skip to content

Commit

Permalink
Output format updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Jul 18, 2023
1 parent 88d9b01 commit 1c5699c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 41 deletions.
8 changes: 5 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,19 @@ lipo -create -output $ARCHIVE/bin/openssl /tmp/openssl-x86_64 /tmp/openssl-arm64
mv /tmp/openssl-* $ARCHIVE/bin
echo
echo -e "${bold}Testing Universal Mac binaries for ${BUILD_MACHINE}...${dim}"
echo " cURL"
echo -e " ${bold}cURL${normal}"
file $ARCHIVE/bin/curl
echo -e "${dim}"
$ARCHIVE/bin/curl -V
echo " OpenSSL"
echo -e " ${bold}OpenSSL${normal}"
file $ARCHIVE/bin/openssl
echo -e "${dim}"
$ARCHIVE/bin/openssl version
date "+%c - End"

## Done - Display Build Duration
echo
echo -e "${bold}Build Complete${dim}"
date "+ %c - End"
END=$(date +%s)
secs=$(echo "$END - $START" | bc)
printf ' Duration %02dh:%02dm:%02ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
Expand Down
24 changes: 12 additions & 12 deletions curl/libcurl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ if [ $nohttp2 == "1" ]; then
fi

if [ $nohttp2 == "1" ]; then
echo "Building with HTTP2 Support (nghttp2)"
echo -e "${dim}Building with HTTP2 Support (nghttp2)"
else
echo "Building without HTTP2 Support (nghttp2)"
echo -e "${dim}Building without HTTP2 Support (nghttp2)"
NGHTTP2CFG=""
NGHTTP2LIB=""
fi
Expand All @@ -168,12 +168,12 @@ if ! (type "pkg-config" > /dev/null 2>&1 ) ; then

# Check to see if Brew is installed
if (type "brew" > /dev/null 2>&1 ) ; then
echo " brew installed - using to install pkg-config"
echo -e " ${dim}brew installed - using to install pkg-config"
brew install pkg-config
else
# Build pkg-config from Source
curl -LOs https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
echo " Building pkg-config"
echo -e " ${dim}Building pkg-config"
tar xfz pkg-config-0.29.2.tar.gz
pushd pkg-config-0.29.2 > /dev/null
./configure --prefix=/tmp/pkg_config --with-internal-glib >> "/tmp/${NGHTTP2_VERSION}.log" 2>&1
Expand All @@ -184,7 +184,7 @@ if ! (type "pkg-config" > /dev/null 2>&1 ) ; then

# Check to see if installation worked
if (type "pkg-config" > /dev/null 2>&1 ) ; then
echo " SUCCESS: pkg-config now installed"
echo -e " ${dim}SUCCESS: pkg-config now installed"
else
echo -e "${alert}** FATAL ERROR: pkg-config failed to install - exiting.${normal}"
exit 1
Expand Down Expand Up @@ -516,20 +516,20 @@ rm -rf "/tmp/${CURL_VERSION}-*.log"
rm -rf "${CURL_VERSION}"

if [ ! -e ${CURL_VERSION}.tar.gz ]; then
echo "Downloading ${CURL_VERSION}.tar.gz"
echo -e "${dim}Downloading ${CURL_VERSION}.tar.gz"
curl -LOs https://curl.haxx.se/download/${CURL_VERSION}.tar.gz
else
echo "Using ${CURL_VERSION}.tar.gz"
echo -e"${dim}Using ${CURL_VERSION}.tar.gz"
fi

echo "Unpacking curl"
echo -e "${dim}Unpacking curl"
tar xfz "${CURL_VERSION}.tar.gz"

if [ ${FORCE_SSLV3} == 'yes' ]; then
if version_lte ${CURL_VERSION} "curl-7.76.1"; then
echo "SSLv3 Requested: No patch needed for ${CURL_VERSION}."
echo -e "${dim}SSLv3 Requested: No patch needed for ${CURL_VERSION}."
else
echo "SSLv3 Requested: This requires a patch for 7.77.0 and above - mileage may vary."
echo -e "${dim}SSLv3 Requested: This requires a patch for 7.77.0 and above - mileage may vary."
# for library
sed -i '' '/version == CURL_SSLVERSION_SSLv3/d' "${CURL_VERSION}/lib/setopt.c"
patch -N "${CURL_VERSION}/lib/vtls/openssl.c" sslv3.patch || true
Expand All @@ -542,7 +542,7 @@ echo -e "${bold}Building Mac libraries${dim}"
buildMac "x86_64"
buildMac "arm64"

echo " Copying headers"
echo -e " ${dim}Copying headers"
cp /tmp/${CURL_VERSION}-x86_64/include/curl/* include/curl/

lipo \
Expand Down Expand Up @@ -643,7 +643,7 @@ echo -e "${bold}Cleaning up${dim}"
rm -rf /tmp/${CURL_VERSION}-*
rm -rf ${CURL_VERSION}

echo "Checking libraries"
echo -e "${dim}Checking libraries"
xcrun -sdk iphoneos lipo -info lib/*.a

#reset trap
Expand Down
16 changes: 8 additions & 8 deletions nghttp2/nghttp2-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ fi

# Check to see if pkg-config is already installed
if (type "pkg-config" > /dev/null 2>&1 ) ; then
echo " pkg-config already installed"
echo -e " ${dim}pkg-config already installed"
else
echo -e "${alertdim}** WARNING: pkg-config not installed... attempting to install.${dim}"

# Check to see if Brew is installed
if (type "brew" > /dev/null 2>&1 ) ; then
echo " brew installed - using to install pkg-config"
echo -e " ${dim}brew installed - using to install pkg-config"
brew install pkg-config
else
# Build pkg-config from Source
echo " Downloading pkg-config-0.29.2.tar.gz"
echo -e " ${dim}Downloading pkg-config-0.29.2.tar.gz"
curl -LOs https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
echo " Building pkg-config"
echo -e " ${dim}Building pkg-config"
tar xfz pkg-config-0.29.2.tar.gz
pushd pkg-config-0.29.2 > /dev/null
./configure --prefix=/tmp/pkg_config --with-internal-glib >> "/tmp/${NGHTTP2_VERSION}.log" 2>&1
Expand All @@ -160,7 +160,7 @@ else

# Check to see if installation worked
if (type "pkg-config" > /dev/null 2>&1 ) ; then
echo " SUCCESS: pkg-config installed"
echo -e " ${dim}SUCCESS: pkg-config installed"
else
echo -e "${alert}** FATAL ERROR: pkg-config failed to install - exiting.${normal}"
exit 1
Expand Down Expand Up @@ -531,13 +531,13 @@ rm -rf "/tmp/${NGHTTP2_VERSION}-*.log"
rm -rf "${NGHTTP2_VERSION}"

if [ ! -e ${NGHTTP2_VERSION}.tar.gz ]; then
echo "Downloading ${NGHTTP2_VERSION}.tar.gz"
echo -e "${dim}Downloading ${NGHTTP2_VERSION}.tar.gz"
curl -LOs https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERNUM}/${NGHTTP2_VERSION}.tar.gz
else
echo "Using ${NGHTTP2_VERSION}.tar.gz"
echo -e "${dim}Using ${NGHTTP2_VERSION}.tar.gz"
fi

echo "Unpacking nghttp2"
echo -e "${dim}Unpacking nghttp2"
tar xfz "${NGHTTP2_VERSION}.tar.gz"

echo -e "${bold}Building Mac libraries${dim}"
Expand Down
20 changes: 10 additions & 10 deletions openssl/openssl-build-phase1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,28 +450,28 @@ rm -rf "/tmp/${OPENSSL_VERSION}-*.log"
rm -rf "${OPENSSL_VERSION}"

if [ ! -e ${OPENSSL_VERSION}.tar.gz ]; then
echo "Downloading ${OPENSSL_VERSION}.tar.gz"
echo -e "${dim}Downloading ${OPENSSL_VERSION}.tar.gz"
curl -LOs https://www.openssl.org/source/${OPENSSL_VERSION}.tar.gz
else
echo "Using ${OPENSSL_VERSION}.tar.gz"
echo -e "${dim}Using ${OPENSSL_VERSION}.tar.gz"
fi

if [[ "$OPENSSL_VERSION" = "openssl-1.1.1"* || "$OPENSSL_VERSION" = "openssl-3"* ]]; then
echo "** Building OpenSSL ${OPENSSL_VERSION} **"
echo -e "${dim}** Building OpenSSL ${OPENSSL_VERSION} **"
else
if [[ "$OPENSSL_VERSION" = "openssl-1.0."* ]]; then
echo "** Building OpenSSL ${OPENSSL_VERSION} ** "
echo -e "${dim}** Building OpenSSL ${OPENSSL_VERSION} ** "
echo -e "${alert}** WARNING: End of Life Version - Upgrade to 1.1.1 **${dim}"
else
echo -e "${alert}** WARNING: This build script has not been tested with $OPENSSL_VERSION **${dim}"
fi
fi

echo "Unpacking openssl"
echo -e "${dim}Unpacking openssl"
tar xfz "${OPENSSL_VERSION}.tar.gz"

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

Expand All @@ -480,7 +480,7 @@ echo -e "${bold}Building Mac libraries${dim}"
buildMac "x86_64"
buildMac "arm64"

echo " Copying headers and libraries"
echo -e " ${dim}Copying headers and libraries"
cp /tmp/${OPENSSL_VERSION}-x86_64/include/openssl/* Mac/include/openssl/

lipo \
Expand All @@ -499,7 +499,7 @@ if [ $catalyst == "1" ]; then
buildCatalyst "x86_64"
buildCatalyst "arm64"

echo " Copying headers and libraries"
echo -e " ${dim}Copying headers and libraries"
cp /tmp/${OPENSSL_VERSION}-catalyst-x86_64/include/openssl/* Catalyst/include/openssl/

lipo \
Expand All @@ -517,7 +517,7 @@ fi
echo -e "${bold}Building tvOS libraries${dim}"
buildTVOS "arm64"

echo " Copying headers and libraries"
echo -e " ${dim}Copying headers and libraries"
cp /tmp/${OPENSSL_VERSION}-tvOS-arm64/include/openssl/* tvOS/include/openssl/

lipo \
Expand All @@ -543,7 +543,7 @@ lipo \
"/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libssl.a" \
-create -output tvOS-fat/lib/libssl.a

echo " Copying headers and libraries"
echo -e " ${dim}Copying headers and libraries"
cp /tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/include/openssl/* tvOS-simulator/include/openssl/

lipo \
Expand Down
16 changes: 8 additions & 8 deletions openssl/openssl-build-phase2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,28 +295,28 @@ rm -rf "/tmp/${OPENSSL_VERSION}-*.log"
rm -rf "${OPENSSL_VERSION}"

if [ ! -e ${OPENSSL_VERSION}.tar.gz ]; then
echo "Downloading ${OPENSSL_VERSION}.tar.gz"
echo -e "${dim}Downloading ${OPENSSL_VERSION}.tar.gz"
curl -LOs https://www.openssl.org/source/${OPENSSL_VERSION}.tar.gz
else
echo "Using ${OPENSSL_VERSION}.tar.gz"
echo -e "${dim}Using ${OPENSSL_VERSION}.tar.gz"
fi

if [[ "$OPENSSL_VERSION" = "openssl-1.1.1"* || "$OPENSSL_VERSION" = "openssl-3"* ]]; then
echo "** Building OpenSSL ${OPENSSL_VERSION} **"
echo -e "${dim}** Building OpenSSL ${OPENSSL_VERSION} **"
else
if [[ "$OPENSSL_VERSION" = "openssl-1.0."* ]]; then
echo "** Building OpenSSL ${OPENSSL_VERSION} ** "
echo -e "${dim}** Building OpenSSL ${OPENSSL_VERSION} ** "
echo -e "${alert}** WARNING: End of Life Version - Upgrade to 1.1.1 **${dim}"
else
echo -e "${alert}** WARNING: This build script has not been tested with $OPENSSL_VERSION **${dim}"
fi
fi

echo "Unpacking openssl"
echo -e "${dim}Unpacking openssl"
tar xfz "${OPENSSL_VERSION}.tar.gz"

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

Expand All @@ -331,7 +331,7 @@ buildIOSsim "i386"
buildIOSsim "x86_64"
buildIOSsim "arm64"

echo " Copying headers and libraries"
echo -e " ${dim}Copying headers and libraries"
cp /tmp/${OPENSSL_VERSION}-iOS-arm64/include/openssl/* iOS/include/openssl/

lipo \
Expand Down Expand Up @@ -383,7 +383,7 @@ lipo \
"/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libssl.a" \
-create -output iOS-fat/lib/libssl.a

echo " Creating combined OpenSSL libraries for iOS"
echo -e " ${dim}Creating combined OpenSSL libraries for iOS"
libtool -no_warning_for_no_symbols -static -o openssl-ios-armv7_armv7s_arm64_arm64e.a iOS/lib/libcrypto.a iOS/lib/libssl.a
libtool -no_warning_for_no_symbols -static -o openssl-ios-i386_x86_64_arm64-simulator.a iOS-simulator/lib/libcrypto.a iOS-simulator/lib/libssl.a

Expand Down

0 comments on commit 1c5699c

Please sign in to comment.