1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
#!/bin/bash
#
#This is configured to be specific to the mac build machine.
# Do not assume that this will work on any given mac system
export PATH=/opt/local/bin:$PATH:/opt//local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin
#This will make the mac .app bundle
if [ $1 = '--update-config=yes' ]; then
echo "Updating configuration files"
if [ $2 = '--parallel=yes' ]; then
echo "Building parallel"
SHOULD_PARALLEL="--enable-openmp-parallel"
fi
if [ $3 = '--debug=no' ]; then
echo "Building debug off"
DISABLE_DEBUG="--disable-debug-checks"
fi
CFLAGS="$CFLAGS -I/opt/local/include " \
LDFLAGS="$LDFLAGS -L/opt/local/lib " \
CXXFLAGS="$CXXFLAGS -std=c++11 -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ -I/opt/local/include " \
./configure $SHOULD_PARALLEL $DISABLE_DEBUG
if [ $? -ne 0 ]; then
echo "Configure unsuccessful - exiting"
exit 1
fi
make clean
fi
read -p "have you changed the makefile?" yn
CFLAGS="$CFLAGS -I/opt/local/include " \
LDFLAGS="$LDFLAGS -L/opt/local/lib " \
CXXFLAGS="$CXXFLAGS -std=c++11 -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ -I/opt/local/include " \
make -j8
if [ $? -ne 0 ]; then
echo "Make unsuccessful - exiting"
exit 1
fi
fi
echo "Updating .app bundle..."
mkdir -p ./3Depict.app/Contents/MacOS/
mkdir -p ./3Depict.app/Contents/Resources/textures/
mkdir -p ./3Depict.app/Contents/libs/
cp ./src/3Depict ./3Depict.app/Contents/MacOS/3Depict
cp data/textures/tex-source/3Depict-icon.icns ./3Depict.app/Contents/Resources/3Depict-icon.icns
touch ./3Depict.app/Contents/PkgInfo
touch ./3Depict.app/Contents/Info.plist
#copy all information from data folder
cp ./data/* ./3Depict.app/Contents/Resources/
#Update gettext translation
#----
echo "Updating translation files..."
cd ./translations;./makeTranslations;cd ..
for i in `ls ./translations/3Depict_*.mo`
do
j=`echo $i | sed 's/.\/translations\/3Depict_//' | sed 's/.mo//'`
mkdir -p ./3Depict.app/Contents/Resources/$j/LC_MESSAGES/
cp $i ./3Depict.app/Contents/Resources/$j/LC_MESSAGES/3Depict.mo
echo "$i $j"
done
#----
# relabel libraries for packaging
if [ x`which dylibbundler` == x"" ] ; then
echo "dyllibbundler command does not appear to be available. Package built, but cannot relabel libaries to use in-package versions"
exit 1
fi
dylibbundler -od -b -x ./3Depict.app/Contents/MacOS/3Depict -d ./3Depict.app/Contents/libs
echo "Done"
|