2020-09-23 15:03:16 +12:00
#!/bin/bash
2021-03-08 19:28:03 +13:00
if [ -d /usr/local/Cellar/qt@5 ]
then
export QTDIR = /usr/local/opt/qt@5
else
export QTDIR = /usr/local/opt/qt
fi
2020-09-23 15:03:16 +12:00
export TOONZDIR = toonz/build/toonz
# If found, use Xcode Release build
if [ -d $TOONZDIR /Release ]
then
export TOONZDIR = $TOONZDIR /Release
fi
2020-10-02 19:20:33 +13:00
echo " >>> Copying stuff to $TOONZDIR /Tahoma2D.app/tahomastuff "
2020-10-07 14:10:58 +13:00
if [ -d $TOONZDIR /Tahoma2D.app/tahomastuff ]
then
# In case of prior builds, replace stuff folder
rm -rf $TOONZDIR /Tahoma2D.app/tahomastuff
fi
2020-10-02 19:20:33 +13:00
cp -R stuff $TOONZDIR /Tahoma2D.app/tahomastuff
2020-11-09 19:56:54 +13:00
chmod -R 777 $TOONZDIR /Tahoma2D.app/tahomastuff
2020-09-23 15:03:16 +12:00
2021-03-22 07:40:38 +13:00
if [ -d thirdparty/apps/ffmpeg/bin ]
2020-09-23 15:03:16 +12:00
then
2020-10-02 19:20:33 +13:00
echo " >>> Copying FFmpeg to $TOONZDIR /Tahoma2D.app/ffmpeg "
2020-10-07 14:10:58 +13:00
if [ -d $TOONZDIR /Tahoma2D.app/ffmpeg ]
then
# In case of prior builds, replace ffmpeg folder
rm -rf $TOONZDIR /Tahoma2D.app/ffmpeg
fi
2021-03-22 07:40:38 +13:00
mkdir $TOONZDIR /Tahoma2D.app/ffmpeg
cp -R thirdparty/apps/ffmpeg/bin/ffmpeg thirdparty/apps/ffmpeg/bin/ffprobe $TOONZDIR /Tahoma2D.app/ffmpeg
2021-09-11 09:43:07 +12:00
chmod -R 755 $TOONZDIR /Tahoma2D.app/ffmpeg
2020-09-23 15:03:16 +12:00
fi
2021-03-22 07:40:38 +13:00
if [ -d thirdparty/apps/rhubarb ]
2021-03-15 07:04:05 +13:00
then
echo " >>> Copying Rhubarb Lip Sync to $TOONZDIR /Tahoma2D.app/rhubarb "
if [ -d $TOONZDIR /Tahoma2D.app/rhubarb ]
then
# In case of prior builds, replace rhubarb folder
rm -rf $TOONZDIR /Tahoma2D.app/rhubarb
fi
2021-03-22 07:40:38 +13:00
mkdir $TOONZDIR /Tahoma2D.app/rhubarb
cp -R thirdparty/apps/rhubarb/rhubarb thirdparty/apps/rhubarb/res $TOONZDIR /Tahoma2D.app/rhubarb
2021-09-11 09:43:07 +12:00
chmod -R 755 $TOONZDIR /Tahoma2D.app/rhubarb
2021-03-15 07:04:05 +13:00
fi
2020-09-23 15:03:16 +12:00
if [ -d thirdparty/canon/Framework ]
then
2020-10-02 19:20:33 +13:00
echo " >>> Copying canon framework to $TOONZDIR /Tahoma2D.app/Contents/Frameworks/EDSDK.Framework "
2020-10-07 14:10:58 +13:00
if [ ! -d $TOONZDIR /Tahoma2D.app/Contents/Frameworks ]
then
mkdir $TOONZDIR /Tahoma2D.app/Contents/Frameworks
fi
cp -R thirdparty/canon/Framework/ $TOONZDIR /Tahoma2D.app/Contents/Frameworks
2021-09-11 09:43:07 +12:00
chmod -R 755 $TOONZDIR /Tahoma2D.app/Contents/Frameworks/EDSDK.framework
2020-09-23 15:03:16 +12:00
fi
2020-10-02 19:20:33 +13:00
echo ">>> Configuring Tahoma2D.app for deployment"
2020-09-23 15:03:16 +12:00
2020-10-02 19:20:33 +13:00
$QTDIR /bin/macdeployqt $TOONZDIR /Tahoma2D.app -verbose= 0 -always-overwrite \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/lzocompress \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/lzodecompress \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/tcleanup \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/tcomposer \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/tconverter \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/tfarmcontroller \
-executable= $TOONZDIR /Tahoma2D.app/Contents/MacOS/tfarmserver
2020-09-23 15:03:16 +12:00
echo ">>> Correcting library paths"
2020-10-02 19:20:33 +13:00
for X in ` find $TOONZDIR /Tahoma2D.app/Contents -type f -name *.dylib -exec otool -l { } \; | grep -e "^toonz" -e"name \/usr\/local" | sed -e"s/://" -e" s/ (.* $// " -e"s/^ *name //" `
2020-09-23 15:03:16 +12:00
do
Z = ` echo $X | cut -c 1-1`
if [ " $Z " != "/" ]
then
LIBFILE = $X
else
Y = ` basename $X `
W = ` basename $LIBFILE `
2020-10-02 19:20:33 +13:00
if [ -f $TOONZDIR /Tahoma2D.app/Contents/Frameworks/$Y -a " $Y " != " $W " ]
2020-09-23 15:03:16 +12:00
then
echo " Fixing $X in $LIBFILE "
install_name_tool -change $X @executable_path/../Frameworks/$Y $LIBFILE
fi
fi
done
2020-10-02 19:20:33 +13:00
echo ">>> Creating Tahoma2D-osx.dmg"
2020-09-23 15:03:16 +12:00
2020-10-02 19:20:33 +13:00
$QTDIR /bin/macdeployqt $TOONZDIR /Tahoma2D.app -dmg -verbose= 0
2020-09-23 15:03:16 +12:00
2020-10-02 19:20:33 +13:00
mv $TOONZDIR /Tahoma2D.dmg $TOONZDIR /../Tahoma2D-osx.dmg
2021-03-22 07:40:38 +13:00