2023-06-23 13:15:35 +00:00
|
|
|
#!/bin/zsh
|
2005-12-22 02:33:59 +00:00
|
|
|
|
2009-02-21 02:42:50 +00:00
|
|
|
# This file is part of BOINC.
|
2006-02-18 05:49:24 +00:00
|
|
|
# http://boinc.berkeley.edu
|
2023-06-23 13:15:35 +00:00
|
|
|
# Copyright (C) 2023 University of California
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Lesser General Public License
|
|
|
|
# as published by the Free Software Foundation,
|
|
|
|
# either version 3 of the License, or (at your option) any later version.
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# BOINC is distributed in the hope that it will be useful,
|
2006-02-18 05:49:24 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the GNU Lesser General Public License for more details.
|
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
|
|
|
#
|
2005-12-22 02:33:59 +00:00
|
|
|
# Master script to build Universal Binary libraries needed by BOINC:
|
2016-09-10 10:26:46 +00:00
|
|
|
# curl-7.47.1 with c-ares-1.10.0, openssl-1.1.0, wxWidgets-3.0.0,
|
2016-03-02 12:37:41 +00:00
|
|
|
# sqlite-3.11.0, FreeType-2.4.10 and FTGL-2.1.3
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2006-07-22 09:30:34 +00:00
|
|
|
# by Charlie Fenton 7/21/06
|
2011-10-18 12:42:53 +00:00
|
|
|
# Updated 10/18/11 for OS 10.7 lion and XCode 4.2
|
2012-06-26 07:54:38 +00:00
|
|
|
# Updated 7/6/11 for wxMac-2.8.10 and Unicode
|
|
|
|
# Updated 6/25/12 for curl-7.26.0 and c-ares-1.9.1
|
|
|
|
# Updated 6/26/12 for openssl-1.0.1c
|
2012-08-03 22:08:27 +00:00
|
|
|
# Updated 8/3/12 for FreeType-2.4.10 and FTGL-2.1.3~rc5
|
2012-12-11 10:59:24 +00:00
|
|
|
# Updated 12/11/12 for sqlite3.7.14.1 from sqlite-autoconf-3071401
|
2013-11-30 23:01:55 +00:00
|
|
|
# Updated 11/30/13 for openssl-1.0.1e
|
2014-02-07 13:59:04 +00:00
|
|
|
# Updated 2/7/14 for wxWidgets-3.0.0
|
2014-02-12 12:54:28 +00:00
|
|
|
# Updated 2/11/14 for c-ares 1.10.0, curl 7.35.0, openssl 1.0.1f, sqlite 3.8.3
|
2014-09-02 10:54:10 +00:00
|
|
|
# Updated 9/2/14 for openssl 1.0.1h
|
2015-04-08 11:56:28 +00:00
|
|
|
# Updated 4/8/15 for curl 7.39.0, openssl 1.0.1j
|
2015-11-30 10:51:18 +00:00
|
|
|
# Updated 11/30/15 to allow putting third party packages in ../mac3rdParty/
|
|
|
|
# Updated 11/30/15 to return error code indicating which builds failed
|
2016-01-06 08:41:36 +00:00
|
|
|
# Updated 1/6/16 for curl 7.46.0, openssl 1.0.2e, sqlite 3.9.2, FreeType-2.6.2
|
2016-03-02 12:37:41 +00:00
|
|
|
# Updated 3/2/16 for curl 7.47.1, openssl 1.0.2g, sqlite 3.11.0
|
2016-09-10 13:06:04 +00:00
|
|
|
# Updated 9/10/16 for c-ares 1.11.0, curl 7.50.2, openssl 1.1.0
|
2023-06-25 11:30:54 +00:00
|
|
|
# Updated 6/25/23 to download inflate libraries if needed
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2015-11-30 10:51:18 +00:00
|
|
|
# Download these seven packages and place them in a common parent directory
|
2017-03-16 09:42:50 +00:00
|
|
|
# with the BOINC source tree.
|
2015-11-30 10:51:18 +00:00
|
|
|
#
|
2017-03-16 09:42:50 +00:00
|
|
|
## In Terminal, cd to the mac_build directory of the boinc tree; for
|
2006-02-27 08:51:05 +00:00
|
|
|
## example:
|
2006-02-18 05:49:24 +00:00
|
|
|
## cd [path]/boinc/mac_build/
|
|
|
|
## then run this script:
|
|
|
|
## source setupForBoinc.sh [ -clean ]
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
|
|
|
# the -clean argument will force a full rebuild of everything.
|
|
|
|
#
|
|
|
|
# This script will work even if you have renamed the boinc/ directory
|
|
|
|
#
|
|
|
|
|
2006-12-19 09:52:02 +00:00
|
|
|
if [ "$1" = "-clean" ]; then
|
2014-02-07 13:59:04 +00:00
|
|
|
cleanit="-clean"
|
2006-12-19 09:52:02 +00:00
|
|
|
else
|
2014-02-07 13:59:04 +00:00
|
|
|
cleanit=""
|
2006-12-19 09:52:02 +00:00
|
|
|
fi
|
|
|
|
|
2012-08-03 22:08:27 +00:00
|
|
|
caresOK="NO"
|
|
|
|
curlOK="NO"
|
|
|
|
opensslOK="NO"
|
2012-07-27 12:29:16 +00:00
|
|
|
wxWidgetsOK="NO"
|
|
|
|
freetypeOK="NO"
|
|
|
|
ftglOK="NO"
|
2015-11-30 10:51:18 +00:00
|
|
|
finalResult=0
|
2012-07-27 12:29:16 +00:00
|
|
|
|
2008-01-29 11:18:45 +00:00
|
|
|
SCRIPT_DIR=`pwd`
|
2006-12-19 09:52:02 +00:00
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
# this will pull in the variables used below
|
|
|
|
source "${SCRIPT_DIR}/dependencyNames.sh"
|
|
|
|
|
2023-06-23 13:15:35 +00:00
|
|
|
# Dowload and expand libraries if needed
|
|
|
|
for rootName in "openssl" "cares" "curl" "wxWidgets" "freetype" "ftgl"
|
|
|
|
do
|
|
|
|
dirVar="${rootName}DirName"
|
|
|
|
fileVar="${rootName}FileName"
|
|
|
|
urlVar="${rootName}URL"
|
|
|
|
# Test whether shell is zsh or bash
|
|
|
|
if [ -z "${BASH_VERSINFO}" ]; then
|
|
|
|
# zsh commands
|
|
|
|
dirName="${(P)dirVar}"
|
|
|
|
fileName="${(P)fileVar}"
|
|
|
|
URLString="${(P)urlVar}"
|
|
|
|
else
|
|
|
|
# bash commands
|
|
|
|
dirName="${!dirVar}"
|
|
|
|
fileName="${!fileVar}"
|
|
|
|
URLString="${!urlVar}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ../../
|
2023-06-25 11:30:54 +00:00
|
|
|
echo
|
|
|
|
if [ -d "${dirName}" ]; then
|
|
|
|
echo `pwd`"/${dirName}"" already present"
|
|
|
|
else
|
|
|
|
if [ -e "${fileName}" ]; then
|
|
|
|
echo `pwd`"/""${fileName}"" already present"
|
|
|
|
else
|
|
|
|
echo "Downloading ""${fileName}"" to "`pwd`"/"
|
2023-06-23 13:15:35 +00:00
|
|
|
curl -L -O "${URLString}"
|
2023-06-25 11:30:54 +00:00
|
|
|
echo
|
2023-06-23 13:15:35 +00:00
|
|
|
fi
|
2023-06-25 11:30:54 +00:00
|
|
|
echo "Expanding ""${fileName}"" to ""${dirName}" in `pwd`"/"
|
2023-06-23 13:15:35 +00:00
|
|
|
tar -xf "${fileName}"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo;echo "**************************************"
|
|
|
|
echo "ERROR: can't expand " "${dirName}"
|
|
|
|
echo "**************************************";echo
|
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
done
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "--------- BUILD OPENSSL ----------"
|
2005-12-22 02:33:59 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${opensslDirName}"
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
source "${SCRIPT_DIR}/buildopenssl.sh" ${cleanit}
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
opensslOK="YES"
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
fi
|
2008-01-29 11:18:45 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2008-01-29 11:18:45 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "---------- BUILD C-ARES- ---------"
|
2008-01-29 11:18:45 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${caresDirName}"
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
source "${SCRIPT_DIR}/buildc-ares.sh" ${cleanit}
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
caresOK="YES"
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
fi
|
2012-06-26 07:54:38 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2012-06-26 07:54:38 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "----------- BUILD CURL -----------"
|
2012-06-26 07:54:38 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${curlDirName}"
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
source "${SCRIPT_DIR}/buildcurl.sh" ${cleanit}
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2016-09-10 10:26:46 +00:00
|
|
|
curlOK="YES"
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "-------- BUILD wxWidgets ---------"
|
2005-12-22 02:33:59 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${wxWidgetsDirName}"
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2014-02-07 13:59:04 +00:00
|
|
|
source "${SCRIPT_DIR}/buildWxMac.sh" ${cleanit}
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
wxWidgetsOK="YES"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2012-07-27 12:29:16 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "--------- BUILD FreeType ---------"
|
2012-07-27 12:29:16 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
2005-12-22 02:33:59 +00:00
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${freetypeDirName}"
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2014-02-07 13:59:04 +00:00
|
|
|
source "${SCRIPT_DIR}/buildfreetype.sh" ${cleanit}
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
freetypeOK="YES"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2012-07-27 12:29:16 +00:00
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "----------- BUILD FTGL -----------"
|
2012-07-27 12:29:16 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
2017-03-23 16:47:26 +00:00
|
|
|
cd "../../${ftglDirName}"
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2014-02-07 13:59:04 +00:00
|
|
|
source "${SCRIPT_DIR}/buildFTGL.sh" ${cleanit}
|
2012-07-27 12:29:16 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
ftglOK="YES"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
|
2012-08-03 22:08:27 +00:00
|
|
|
if [ "${caresOK}" = "NO" ]; then
|
|
|
|
echo ""
|
2014-02-12 12:54:28 +00:00
|
|
|
echo "-----------------------------------"
|
|
|
|
echo "------------ WARNING --------------"
|
|
|
|
echo "------------ --------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "-- COULD NOT BUILD ${caresDirName} --"
|
2014-02-12 12:54:28 +00:00
|
|
|
echo "-----------------------------------"
|
2012-08-03 22:08:27 +00:00
|
|
|
echo ""
|
2015-11-30 10:51:18 +00:00
|
|
|
|
|
|
|
finalResult=$[ finalResult | 1 ]
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${curlOK}" = "NO" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "-----------------------------------"
|
|
|
|
echo "------------ WARNING --------------"
|
|
|
|
echo "------------ --------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "--- COULD NOT BUILD ${curlDirName} ---"
|
2012-08-03 22:08:27 +00:00
|
|
|
echo "-----------------------------------"
|
|
|
|
echo ""
|
2015-11-30 10:51:18 +00:00
|
|
|
|
|
|
|
finalResult=$[ finalResult | 2 ]
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${opensslOK}" = "NO" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "----------------------------------"
|
|
|
|
echo "------------ WARNING -------------"
|
|
|
|
echo "------------ -------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "- COULD NOT BUILD ${opensslDirName} -"
|
2012-08-03 22:08:27 +00:00
|
|
|
echo "----------------------------------"
|
|
|
|
echo ""
|
2017-03-17 14:38:58 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
finalResult=$[ finalResult | 4 ]
|
2012-08-03 22:08:27 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-27 13:20:10 +00:00
|
|
|
if [ "${wxWidgetsOK}" = "NO" ]; then
|
|
|
|
echo ""
|
2014-02-07 13:59:04 +00:00
|
|
|
echo "-----------------------------------"
|
|
|
|
echo "------------ WARNING --------------"
|
|
|
|
echo "------------ --------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "- COULD NOT BUILD ${wxWidgetsDirName} -"
|
2014-02-07 13:59:04 +00:00
|
|
|
echo "-----------------------------------"
|
2012-07-27 13:20:10 +00:00
|
|
|
echo ""
|
2017-03-17 14:38:58 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
finalResult=$[ finalResult | 8 ]
|
2012-07-27 13:20:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${freetypeOK}" = "NO" ]; then
|
2012-07-27 12:29:16 +00:00
|
|
|
echo ""
|
|
|
|
echo "-----------------------------------"
|
|
|
|
echo "------------ WARNING --------------"
|
2014-02-07 13:59:04 +00:00
|
|
|
echo "------------ --------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "- COULD NOT BUILD ${freetypeDirName} -"
|
2012-07-27 13:20:10 +00:00
|
|
|
echo "-----------------------------------"
|
|
|
|
echo ""
|
2017-03-17 14:38:58 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
finalResult=$[ finalResult | 32 ]
|
2012-07-27 13:20:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${ftglOK}" = "NO" ]; then
|
|
|
|
echo ""
|
2012-07-27 12:35:21 +00:00
|
|
|
echo "-----------------------------------"
|
2012-07-27 13:20:10 +00:00
|
|
|
echo "------------ WARNING --------------"
|
2014-02-07 13:59:04 +00:00
|
|
|
echo "------------ --------------"
|
2017-03-23 16:47:26 +00:00
|
|
|
echo "- COULD NOT BUILD ${ftglDirName} --"
|
2012-07-27 12:29:16 +00:00
|
|
|
echo "-----------------------------------"
|
|
|
|
echo ""
|
2017-03-17 14:38:58 +00:00
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
finalResult=$[ finalResult | 64 ]
|
2012-07-27 12:29:16 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
2015-11-30 10:51:18 +00:00
|
|
|
return $finalResult
|