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
|
#!/bin/bash
source Scripts/util.sh || source util.sh
TARGETPATH=Build
TARGETAPP=ImageVis3D.app
PREFIX="${TARGETPATH}/${TARGETAPP}"
if test -n "$1" -a -d "$1" ; then
echo "Using '$1' as .app directory."
PREFIX="$1"
fi
if ! test -d "${PREFIX}" ; then
die "$PREFIX does not exist, build the application first!"
fi
echo "Copying Shaders ..."
rm -f "${PREFIX}/Contents/Resources/*.glsl"
mkdir -p "${PREFIX}/Contents/Resources"
cp tuvok/Shaders/* "${PREFIX}/Contents/Resources"
echo "Removing subversion garbage ..."
find "${PREFIX}" -iname .svn -exec rm -fr {} +
echo "done!"
macdeployqt="macdeployqt"
if test -n "${QT_BIN}" -a -x "${QT_BIN}/macdeployqt" ; then
macdeployqt="${QT_BIN}/macdeployqt"
fi
echo "Running Qt's mac deployment tool."
${macdeployqt} ${PREFIX}
version
revision
echo "Copying ImageVis3D Manual into app..."
man=$(manual)
import=$(import_data_manual)
pushd ${PREFIX}/Contents/Resources
rm -f ImageVis3D.pdf
curl -skLO "${man}"
mv $(basename "${man}") ImageVis3D.pdf
curl -skLO "${import}"
popd
tarball=$(nm_tarball)
zipfile=$(nm_zipfile)
pushd Build/ &>/dev/null
ver="${IV3D_MAJOR}.${IV3D_MINOR}.${IV3D_PATCH}"
sed -i -e "s,VERSION,${ver}," \
ImageVis3D.app/Contents/Info.plist
tar zcf ${tarball} ImageVis3D.app
zip -9r ${zipfile} ImageVis3D.app
popd &>/dev/null
mv Build/${tarball} Build/${zipfile} .
mkdir -p staging
cp -R CmdLineConverter/Build/uvfconvert.app staging/
cp -R Build/ImageVis3D.app staging/
echo "Running Qt's mac deployment tool on uvfconvert..."
pushd staging/ &>/dev/null
${macdeployqt} uvfconvert.app
popd &>/dev/null
echo "Copying manuals into root of dmg..."
pushd staging/ &>/dev/null
ln ImageVis3D.app/Contents/Resources/ImageVis3D.pdf
ln ImageVis3D.app/Contents/Resources/$(basename "${import}")
popd &>/dev/null
hdiutil create \
-volname "ImageVis3D" \
-srcfolder staging/ \
-format UDZO \
-imagekey zlib-level=9 \
${zipfile%%zip}dmg
rm -fr staging/
hdiutil internet-enable -yes ${zipfile%%zip}dmg
|