Skip to content

Instantly share code, notes, and snippets.

@Zverik
Created November 16, 2016 15:22
Show Gist options
  • Save Zverik/da71b75aae413bf9ce8bfc1abd3b55aa to your computer and use it in GitHub Desktop.
Save Zverik/da71b75aae413bf9ce8bfc1abd3b55aa to your computer and use it in GitHub Desktop.
Build script for a DMG file of MAPS.ME desktop
#!/bin/bash
set -e -u
OMIM_PATH="$(cd "${OMIM_PATH:-$(dirname "$0")/../..}"; pwd)"
DATA_PATH="$OMIM_PATH/data"
BUILD_PATH="$OMIM_PATH/out"
RELEASE_PATH="$BUILD_PATH/release"
source "$OMIM_PATH/tools/autobuild/detect_qmake.sh"
#rm -rf "$RELEASE_PATH"
(
cd "$OMIM_PATH"
${QMAKE-qmake} omim.pro -r -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=no-tests
make -j8
)
"$(dirname "$QMAKE")/macdeployqt" "$RELEASE_PATH/MAPS.ME.app"
MAC_RESOURCES="$RELEASE_PATH/MAPS.ME.app/Contents/Resources"
rm -rf $MAC_RESOURCES/*
cp $OMIM_PATH/data/{*.txt,*.ttf,*.bin,World*.mwm,*.html,editor.config} $MAC_RESOURCES/
cp -r $OMIM_PATH/data/resources-* $MAC_RESOURCES/
rm -rf "$BUILD_PATH/deploy"
mkdir "$BUILD_PATH/deploy"
mv "$RELEASE_PATH/MAPS.ME.app" "$BUILD_PATH/deploy/"
DMG_NAME=MAPS.ME.${1-$(date +%y%m%d)}
hdiutil create -size 200m -volname $DMG_NAME -srcfolder "$BUILD_PATH/deploy" -ov -format UDZO "$BUILD_PATH/$DMG_NAME.dmg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment