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
|
#!/bin/bash
FILENAME="$1"
if [ $# -ne 1 ]; then
echo "Usage: $0 FILENAME";
exit;
fi
if [ ! -f "${REPO_ROOT}"/build/bin/qrenderdoc.app/Contents/MacOS/qrenderdoc ] || [ ! -f "${REPO_ROOT}"/build/bin/renderdoccmd ]; then
echo "ERROR: Missing qrenderdoc.app or renderdoccmd builds";
exit 1;
fi
if ! which convert > /dev/null 2>&1; then
echo "ERROR: Require imagemagick for packaging step";
echo " brew install imagemagick";
exit 1;
fi
if ! which create-dmg > /dev/null 2>&1; then
echo "ERROR: Require create-dmg for packaging step";
echo " brew install create-dmg";
exit 1;
fi
# create final bundle folder
mkdir -p "${REPO_ROOT}"/dist/RenderDoc.app
# copy in qrenderdoc bundle
cp -R "${REPO_ROOT}"/build/bin/qrenderdoc.app/* "${REPO_ROOT}"/dist/RenderDoc.app/
# copy in renderdoccmd
cp "${REPO_ROOT}"/build/bin/renderdoccmd "${REPO_ROOT}"/dist/RenderDoc.app/Contents/MacOS/
# copy in plugins
if [ -d "${REPO_ROOT}"/plugins-macos ]; then
cp -R "${REPO_ROOT}"/plugins-macos "${REPO_ROOT}/dist/RenderDoc.app/Contents/plugins"
else
echo "WARNING: Plugins not present. Download and extract https://renderdoc.org/plugins.tgz in root folder";
fi
# copy in all of the android files.
mkdir -p "${REPO_ROOT}/dist/RenderDoc.app/Contents/plugins/android/"
if ls "${REPO_ROOT}"/build-android*/bin/*.apk; then
cp "${REPO_ROOT}"/build-android*/bin/*.apk "${REPO_ROOT}/dist/RenderDoc.app/Contents/plugins/android/"
else
echo "WARNING: Android build not present. Build arm32 and arm64 apks in build-android-arm{32,64} folders";
fi
# Create dmg background image
convert -size 600x300 xc:white \
-fill '#3BB779' -draw "rectangle 0,0 600,100" \
-fill white -pointsize 24 -gravity north \
-annotate +0+50 "Drag qrenderdoc to your Applications folder." \
/tmp/rdbackground.png
rm -rf "${REPO_ROOT}"/package
mkdir "${REPO_ROOT}"/package
create-dmg --volname "$FILENAME" \
--volicon "${REPO_ROOT}"/dist/RenderDoc.app/Contents/Resources/RenderDoc.icns \
--background /tmp/rdbackground.png \
--window-pos 200 120 --window-size 600 350 --icon-size 100 \
--icon RenderDoc.app 200 190 \
--app-drop-link 400 185 \
"${REPO_ROOT}"/package/"${FILENAME}".dmg "${REPO_ROOT}"/dist/
|