Skip to content

Commit

Permalink
Build Mac: use shared file for dependency build scripts
Browse files Browse the repository at this point in the history
from Charlie Fenton
  • Loading branch information
ChristianBeer committed Mar 23, 2017
1 parent b27e56a commit 9c8697d
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 36 deletions.
17 changes: 10 additions & 7 deletions 3rdParty/buildMacDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,17 @@ if [ "${doclean}" = "yes" ]; then
mkdir -p ${PREFIX}
fi

# this will pull in the variables used below
source "${ROOTDIR}/mac_build/dependencyNames.sh"

#download_and_build $DIRNAME $FILENAME $DOWNLOADURL $BUILDSCRIPT
download_and_build "openssl-1.1.0" "openssl-1.1.0.tar.gz" "https://www.openssl.org/source/openssl-1.1.0.tar.gz" "${ROOTDIR}/mac_build/buildopenssl.sh"
download_and_build "c-ares-1.11.0" "c-ares-1.11.0.tar.gz" "http://c-ares.haxx.se/download/c-ares-1.11.0.tar.gz" "${ROOTDIR}/mac_build/buildc-ares.sh"
download_and_build "curl-7.50.2" "curl-7.50.2.tar.gz" "http://curl.haxx.se/download/curl-7.50.2.tar.gz" "${ROOTDIR}/mac_build/buildcurl.sh"
download_and_build "wxWidgets-3.0.0" "wxWidgets-3.0.0.tar.bz2" "http://sourceforge.net/projects/wxwindows/files/3.0.0/wxWidgets-3.0.0.tar.bz2" "${ROOTDIR}/mac_build/buildWxMac.sh ${wxoption}"
download_and_build "sqlite-autoconf-3110000" "sqlite-autoconf-3110000.tar.gz" "http://www.sqlite.org/2016/sqlite-autoconf-3110000.tar.gz" "${ROOTDIR}/mac_build/buildsqlite3.sh"
download_and_build "freetype-2.6.2" "freetype-2.6.2.tar.bz2" "http://sourceforge.net/projects/freetype/files/freetype2/2.6.2/freetype-2.6.2.tar.bz2" "${ROOTDIR}/mac_build/buildfreetype.sh"
download_and_build "ftgl-2.1.3~rc5" "ftgl-2.1.3-rc5.tar.gz" "http://sourceforge.net/projects/ftgl/files/FTGL%20Source/2.1.3%7Erc5/ftgl-2.1.3-rc5.tar.gz" "${ROOTDIR}/mac_build/buildFTGL.sh"
download_and_build "${opensslDirName}" "${opensslFileName}" "${opensslURL}" "${ROOTDIR}/mac_build/buildopenssl.sh"
download_and_build "${caresDirName}" "${caresFileName}" "${caresURL}" "${ROOTDIR}/mac_build/buildc-ares.sh"
download_and_build "${curlDirName}" "${curlFileName}" "${curlURL}" "${ROOTDIR}/mac_build/buildcurl.sh"
download_and_build "${wxWidgetsDirName}" "${wxWidgetsFileName}" "${wxWidgetsURL}" "${ROOTDIR}/mac_build/buildWxMac.sh ${wxoption}"
download_and_build "${sqliteDirName}" "${sqliteFileName}" "${sqliteURL}" "${ROOTDIR}/mac_build/buildsqlite3.sh"
download_and_build "${freetypeDirName}" "${freetypeFileName}" "${freetypeURL}" "${ROOTDIR}/mac_build/buildfreetype.sh"
download_and_build "${ftglDirName}" "${ftglFileName}" "${ftglURL}" "${ROOTDIR}/mac_build/buildFTGL.sh"

# change back to root directory
cd ${ROOTDIR} || exit 1
4 changes: 3 additions & 1 deletion mac_build/buildFTGL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ SRCDIR=$PWD

if [ "${doclean}" != "yes" ]; then
if [ -f "${libPath}/libftgl.a" ]; then
echo "ftgl-2.1.3~rc5 already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
8 changes: 6 additions & 2 deletions mac_build/buildWxMac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ fi
retval=0

if [ "${doclean}" != "clean" ] && [ -f "${libPathRel}/libwx_osx_cocoa_static.a" ]; then
echo "Release libwx_osx_cocoa_static.a already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} Release libwx_osx_cocoa_static.a already built"
else

## export DEVELOPER_SDK_DIR="/Developer/SDKs"
Expand All @@ -199,7 +201,9 @@ if [ ${nodebug} = "yes" ]; then
fi

if [ "${doclean}" != "clean" ] && [ -f "${libPathDbg}/libwx_osx_cocoa_static.a" ]; then
echo "Debug libwx_osx_cocoa_static.a already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} Debug libwx_osx_cocoa_static.a already built"
else
## export DEVELOPER_SDK_DIR="/Developer/SDKs"
## We must override some of the build settings in wxWindows.xcodeproj
Expand Down
4 changes: 3 additions & 1 deletion mac_build/buildc-ares.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ done

if [ "${doclean}" != "yes" ]; then
if [ -f "${libPath}/libcares.a" ]; then
echo "c-ares-1.11.0 already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
4 changes: 3 additions & 1 deletion mac_build/buildcurl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ done

if [ "${doclean}" != "yes" ]; then
if [ -f "${libPath}/libcurl.a" ]; then
echo "curl-7.50.2 already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
4 changes: 3 additions & 1 deletion mac_build/buildfreetype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ done

if [ "${doclean}" != "yes" ]; then
if [ -f "${libPath}/libfreetype.a" ]; then
echo "freetype-2.6.2 already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
4 changes: 3 additions & 1 deletion mac_build/buildopenssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ done

if [ "${doclean}" != "yes" ]; then
if [ -f ${libPath}/libssl.a ] && [ -f ${libPath}/libcrypto.a ]; then
echo "openssl-1.1.0 libraries already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
4 changes: 3 additions & 1 deletion mac_build/buildsqlite3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ done

if [ "${doclean}" != "yes" ]; then
if [ -f "${libPath}/libsqlite3.a" ]; then
echo "sqlite-3.11.0 already built"
cwd=$(pwd)
dirname=${cwd##*/}
echo "${dirname} already built"
return 0
fi
fi
Expand Down
49 changes: 49 additions & 0 deletions mac_build/dependencyNames.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

## This file contains the names and download URLs for the 7 third-party
## libraries needed for building BOINC for Macintosh computers.
##
## This file is usually source'ed by scripts that build the dependencies.
##
## Update this file and the Xcode project build settings when upgrading
## to a newer version of one of these libraries. Note that the scripts
## buildcurl,sh and buildWxMac.sh contain code to patch source files
## for their respective libraries, so they may need to be modified
## for new versions of those source files.
##
## To ensure that rebuilds of older versions of BOINC always use the
## same versions of the third party libraries as the original builds,
## always hard-code the path to the correct libraries in the Xcode build
## settings; please do NOT include or reference this file in the Xcode
## build settings.
##

opensslDirName="openssl-1.1.0"
opensslFileName="openssl-1.1.0.tar.gz"
opensslURL="https://www.openssl.org/source/openssl-1.1.0.tar.gz"

caresDirName="c-ares-1.11.0"
caresFileName="c-ares-1.11.0.tar.gz"
caresURL= "http://c-ares.haxx.se/download/c-ares-1.11.0.tar.gz"

curlDirName="curl-7.50.2"
curlFileName="curl-7.50.2.tar.gz"
curlURL="http://curl.haxx.se/download/curl-7.50.2.tar.gz"

wxWidgetsDirName="wxWidgets-3.0.0"
wxWidgetsFileName="wxWidgets-3.0.0.tar.bz2"
wxWidgetsURL="http://sourceforge.net/projects/wxwindows/files/3.0.0/wxWidgets-3.0.0.tar.bz2"

sqliteDirName="sqlite-autoconf-3110000"
sqliteFileName="sqlite-autoconf-3110000.tar.gz"
sqliteURL="http://www.sqlite.org/2016/sqlite-autoconf-3110000.tar.gz"

freetypeDirName="freetype-2.6.2"
freetypeFileName="freetype-2.6.2.tar.bz2"
freetypeURL="http://sourceforge.net/projects/freetype/files/freetype2/2.6.2/freetype-2.6.2.tar.bz2"

ftglDirName="ftgl-2.1.3~rc5"
ftglFileName="ftgl-2.1.3-rc5.tar.gz"
ftglURL="http://sourceforge.net/projects/ftgl/files/FTGL%20Source/2.1.3%7Erc5/ftgl-2.1.3-rc5.tar.gz"

return 0
45 changes: 24 additions & 21 deletions mac_build/setupForBOINC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ finalResult=0

SCRIPT_DIR=`pwd`

# this will pull in the variables used below
source "${SCRIPT_DIR}/dependencyNames.sh"

echo ""
echo "----------------------------------"
echo "----- BUILD OPENSSL-1.1.0 -------"
echo "--------- BUILD OPENSSL ----------"
echo "----------------------------------"
echo ""

cd ../../openssl-1.1.0/
cd "../../${opensslDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildopenssl.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -89,11 +92,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "------- BUILD C-ARES-1.11.0 ------"
echo "---------- BUILD C-ARES- ---------"
echo "----------------------------------"
echo ""

cd ../../c-ares-1.11.0/
cd "../../${caresDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildc-ares.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -105,11 +108,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "------- BUILD CURL-7.50.2 --------"
echo "----------- BUILD CURL -----------"
echo "----------------------------------"
echo ""

cd ../../curl-7.50.2/
cd "../../${curlDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildcurl.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -121,11 +124,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "----- BUILD wxWidgets-3.0.0 ------"
echo "-------- BUILD wxWidgets ---------"
echo "----------------------------------"
echo ""

cd ../../wxWidgets-3.0.0/
cd "../../${wxWidgetsDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildWxMac.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -137,11 +140,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "------- BUILD sqlite-3.11.0 -------"
echo "---------- BUILD sqlite ----------"
echo "----------------------------------"
echo ""

cd ../../sqlite-autoconf-3110000/
cd "../../${sqliteDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildsqlite3.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -153,11 +156,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "----- BUILD FreeType-2.6.2 ------"
echo "--------- BUILD FreeType ---------"
echo "----------------------------------"
echo ""

cd ../../freetype-2.6.2/
cd "../../${freetypeDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildfreetype.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -169,11 +172,11 @@ cd "${SCRIPT_DIR}"

echo ""
echo "----------------------------------"
echo "------ BUILD FTGL-2.1.3~rc5 ------"
echo "----------- BUILD FTGL -----------"
echo "----------------------------------"
echo ""

cd ../../ftgl-2.1.3~rc5/
cd "../../${ftglDirName}"
if [ $? -eq 0 ]; then
source "${SCRIPT_DIR}/buildFTGL.sh" ${cleanit}
if [ $? -eq 0 ]; then
Expand All @@ -188,7 +191,7 @@ if [ "${caresOK}" = "NO" ]; then
echo "-----------------------------------"
echo "------------ WARNING --------------"
echo "------------ --------------"
echo "-- COULD NOT BUILD C-ARES-1.11.0 --"
echo "-- COULD NOT BUILD ${caresDirName} --"
echo "-----------------------------------"
echo ""

Expand All @@ -200,7 +203,7 @@ if [ "${curlOK}" = "NO" ]; then
echo "-----------------------------------"
echo "------------ WARNING --------------"
echo "------------ --------------"
echo "--- COULD NOT BUILD CURL-7.50.2 ---"
echo "--- COULD NOT BUILD ${curlDirName} ---"
echo "-----------------------------------"
echo ""

Expand All @@ -212,7 +215,7 @@ if [ "${opensslOK}" = "NO" ]; then
echo "----------------------------------"
echo "------------ WARNING -------------"
echo "------------ -------------"
echo "- COULD NOT BUILD OPENSSL-1.1.0 -"
echo "- COULD NOT BUILD ${opensslDirName} -"
echo "----------------------------------"
echo ""

Expand All @@ -224,7 +227,7 @@ if [ "${wxWidgetsOK}" = "NO" ]; then
echo "-----------------------------------"
echo "------------ WARNING --------------"
echo "------------ --------------"
echo "- COULD NOT BUILD wxWidgets-3.0.0 -"
echo "- COULD NOT BUILD ${wxWidgetsDirName} -"
echo "-----------------------------------"
echo ""

Expand All @@ -236,7 +239,7 @@ if [ "${sqlite3OK}" = "NO" ]; then
echo "----------------------------------"
echo "------------ WARNING -------------"
echo "------------ -------------"
echo "-- COULD NOT BUILD sqlite-3.11.0 -"
echo "-- COULD NOT BUILD ${sqliteDirName} -"
echo "----------------------------------"
echo ""

Expand All @@ -248,7 +251,7 @@ if [ "${freetypeOK}" = "NO" ]; then
echo "-----------------------------------"
echo "------------ WARNING --------------"
echo "------------ --------------"
echo "- COULD NOT BUILD FreeType-2.6.2 -"
echo "- COULD NOT BUILD ${freetypeDirName} -"
echo "-----------------------------------"
echo ""

Expand All @@ -260,7 +263,7 @@ if [ "${ftglOK}" = "NO" ]; then
echo "-----------------------------------"
echo "------------ WARNING --------------"
echo "------------ --------------"
echo "- COULD NOT BUILD FTGL-2.1.3~rc5 --"
echo "- COULD NOT BUILD ${ftglDirName} --"
echo "-----------------------------------"
echo ""

Expand Down

0 comments on commit 9c8697d

Please sign in to comment.