Commit fc9a6399 authored by Jamie Hall's avatar Jamie Hall
Browse files

MacOs build changes.

parent 98b36526
......@@ -33,8 +33,8 @@ if sys.platform.startswith('darwin'):
'matplotlib_backends': '-',
'optimize': '1',
'plist': PLIST,
'bdist_base': 'scripts/darwin/build',
'dist_dir': 'scripts/darwin/dist',
'bdist_base': 'build_darwin/build',
'dist_dir': 'build_darwin/dist',
'graph': False,
'xref': False
}
......
......@@ -39,7 +39,7 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
# Get revision number from git (without trailing newline)
REV_NUMBER=$(git rev-list --count HEAD)
export REV_NUMBER=$(git rev-list --count HEAD)
echo "$BLEU""Revision number is -->${REV_NUMBER}<--" "$NORMAL"
# Add current revision number to python source code (will appear in "About..." dialog)
......@@ -49,18 +49,18 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
# Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL"
/usr/local/bin/python setup.py build
/usr/local/bin/python setup.py install
#/usr/local/bin/python setup.py install
TARGET_DIR=MDANSE-${BUILD_NAME}-b${REV_NUMBER}-MacOS
echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf scripts/darwin/build
rm -rf scripts/darwin/dist
rm -rf build_darwin/build
rm -rf build_darwin/dist
# debug option for py2app, if needed
export DISTUTILS_DEBUG=0
/usr/local/bin/python build_mdanse.py py2app
/usr/local/bin/python ./BuildServer/Darwin/build_mdanse.py py2app
rc=$?
if [[ $rc != 0 ]]; then
echo -e "$ROUGE""Cannot build app." "$NORMAL"
......@@ -69,14 +69,14 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
# Do some manual cleanup, e.g.
# matplotlib/tests ==> 45.2 Mb
rm -rf scripts/darwin/dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests
rm -rf scripts/darwin/dist/MDANSE.app/Contents/Resources/mpl-data/sample_data
rm -rf build_darwin/dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests
rm -rf build_darwin/dist/MDANSE.app/Contents/Resources/mpl-data/sample_data
#Add MDANSE version file (should read the version from the bundle with pyobjc, but will figure that out later)
echo "$BUILD_NAME b$REV_NUMBER"> scripts/darwin/dist/MDANSE.app/Contents/Resources/version
echo "$BUILD_NAME b$REV_NUMBER"> build_darwin/dist/MDANSE.app/Contents/Resources/version
cd scripts/darwin
cd build_darwin
# Archive app
echo -e "$BLEU" "Archiving ${TARGET_DIR}.tar.gz ..." "$NORMAL"
......@@ -84,10 +84,6 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
gnutar cfp - MDANSE.app | gzip --best -c > ../../../${TARGET_DIR}.tar.gz
cd ..
# Reminder on pre-configured DmgTemplate
#>hdiutil convert DmgTemplateCompressed.dmg -format UDRW -o DmgTemplateCompressedRW.dmg
#>hdiutil convert DmgTemplateCompressedRW.dmg -format UDZO -o DmgTemplateCompressed.dmg
TODAY=$(date +"%m-%d-%y-%Hh%Mm%S")
# Create sparse image for distribution
echo -e "$BLEU" "Creating new MDANSE.dmg.sparseimage ..." "$NORMAL"
......@@ -96,7 +92,7 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
mv -f MDANSE.dmg.sparseimage MDANSE.dmg.sparseimage.${TODAY}.old
hdiutil convert DmgTemplateCompressed.dmg -format UDSP -o MDANSE.dmg.sparseimage
hdiutil resize -size 1024m MDANSE.dmg.sparseimage
hdiutil attach nMolDyn.dmg.sparseimage
hdiutil attach MDANSE.dmg.sparseimage
echo -e "$BLEU" "Copying MDANSE.app on dmg ..." "$NORMAL"
cp -a dist/MDANSE.app /Volumes/MDANSE/MDANSE/
echo -e "$BLEU" "Copying UserData/ on dmg ..." "$NORMAL"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment