mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 16:33:31 +00:00

Commits included: b677423cdd2a46b5abc1a8cdb21b79f9cde968ba 662da36ac5cee6c9786b83413daf9524979be5b0 d3eebd61e14efb00754f49bcefd962ab5e24b760 4d08b1eb78955378fbb13537b3f8cfc43450fa92 c03ab2e54c2d2410350dbbd4c6c8ef5fdc92e501
89 lines
2.3 KiB
Bash
Executable File
89 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Fix_Xcode_Dependencies
|
|
# Martin Hrubý (hrubymar10), 2016 - 2018
|
|
# Victor Sergienko (singalen), 2018
|
|
#
|
|
|
|
starttimestamp=$(date +%s)
|
|
|
|
###Functions
|
|
time_interval_to_string() {
|
|
local START=$1
|
|
local END=$2
|
|
|
|
declare -i timestamp
|
|
declare -i days
|
|
declare -i hours
|
|
declare -i minutes
|
|
declare -i seconds
|
|
timestamp=$END-$START
|
|
|
|
days=$timestamp/60/60/24
|
|
hours=$((($timestamp-($days*60*60*24))/60/60))
|
|
minutes=$((($timestamp-($days*60*60*24)-($hours*60*60))/60))
|
|
seconds=$((($timestamp-($days*60*60*24)-($hours*60*60)-($minutes*60))))
|
|
if [ $days -eq 0 ]; then
|
|
if [ $hours -eq 0 ]; then
|
|
if [ $minutes -eq 0 ]; then
|
|
echo "==> Operation took $seconds seconds ..."
|
|
else
|
|
echo "==> Operation took $minutes minutes and $seconds seconds ..."
|
|
fi
|
|
else
|
|
echo "==> Operation took $hours hours $minutes minutes and $seconds seconds ..."
|
|
fi
|
|
else
|
|
echo "==> Operation took $days days $hours hours $minutes minutes and $seconds seconds ..."
|
|
fi
|
|
}
|
|
###/Functions
|
|
|
|
starttimestamp=`date +%s`
|
|
|
|
MY_PATH=$(cd `dirname $0` && pwd)
|
|
if [ -z "$MY_PATH" ] ; then
|
|
# error; for some reason, the path is not accessible
|
|
# to the script (e.g. permissions re-evaled after suid)
|
|
echo 'Error: Script path is for some reason not accessible' >&2
|
|
exit 1 # fail
|
|
fi
|
|
cd "$MY_PATH"
|
|
|
|
if ! [ -d "The Battle for Wesnoth.xcodeproj" ]; then
|
|
echo "Error: I am in bad directory! I must be in wesnoth/projectfiles/Xcode !" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! [ -x "$(command -v git)" ]; then
|
|
echo 'Error: Git is not installed. Use for example Homebrew to install git. https://brew.sh/' >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! [ -d temp ]; then
|
|
mkdir temp
|
|
fi
|
|
cd temp
|
|
if ! [ -d MacCompileStuff-1.14 ]; then
|
|
git clone -b 1.14 https://github.com/hrubymar10/MacCompileStuff MacCompileStuff-1.14
|
|
fi
|
|
cd MacCompileStuff-1.14
|
|
git pull
|
|
cd ..
|
|
cd ..
|
|
|
|
if ! [ -L "Headers" ]; then
|
|
rm -rf Headers
|
|
ln -s temp/MacCompileStuff-1.14/Headers
|
|
fi
|
|
|
|
if ! [ -L "lib" ]; then
|
|
rm -rf lib
|
|
ln -s temp/MacCompileStuff-1.14/lib
|
|
fi
|
|
|
|
echo "==> DONE ..."
|
|
echo
|
|
time_interval_to_string "$starttimestamp" "$(date +%s)"
|
|
echo
|