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

Cleaned up packaging. added background image to macos dmg

parent f800eb3f
...@@ -6,4 +6,3 @@ ...@@ -6,4 +6,3 @@
.eggs .eggs
dist/ dist/
.DS_Store .DS_Store
./MDANSE/__pkginfo__.py
...@@ -11,7 +11,7 @@ if sys.platform.startswith('darwin'): ...@@ -11,7 +11,7 @@ if sys.platform.startswith('darwin'):
version = 1 version = 1
build_name = "MDANSE" build_name = "MDANSE"
APP = ['../../Scripts/mdanse_gui'] APP = ['../../../Scripts/mdanse_gui']
PLIST = { PLIST = {
u'CFBundleName': u'MDANSE', u'CFBundleName': u'MDANSE',
u'CFBundleShortVersionString': build_name, u'CFBundleShortVersionString': build_name,
...@@ -29,7 +29,7 @@ if sys.platform.startswith('darwin'): ...@@ -29,7 +29,7 @@ if sys.platform.startswith('darwin'):
} }
OPTIONS = { OPTIONS = {
'argv_emulation': True, 'argv_emulation': True,
'iconfile': u'../../MDANSE/GUI/Icons/mdanse.icns', 'iconfile': u'../../../MDANSE/GUI/Icons/mdanse.icns',
'excludes': 'PyQt4', 'excludes': 'PyQt4',
'matplotlib_backends': '-', 'matplotlib_backends': '-',
'optimize': '1', 'optimize': '1',
......
...@@ -31,8 +31,6 @@ TARGET_DIR=MDANSE-${BUILD_NAME}-${BUILD_TARGET} ...@@ -31,8 +31,6 @@ TARGET_DIR=MDANSE-${BUILD_NAME}-${BUILD_TARGET}
############################# #############################
if [ "$BUILD_TARGET" = "darwin" ]; then if [ "$BUILD_TARGET" = "darwin" ]; then
cd ../../../ cd ../../../
# take the latest version of nmoldyn available on the forge # take the latest version of nmoldyn available on the forge
...@@ -48,62 +46,45 @@ if [ "$BUILD_TARGET" = "darwin" ]; then ...@@ -48,62 +46,45 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
# Now build last version and install it in our homebrewed python # Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL" echo -e "$BLEU""Building MDANSE" "$NORMAL"
/usr/local/bin/python setup.py build /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 TARGET_DIR=MDANSE-${BUILD_NAME}-b${REV_NUMBER}-MacOS
echo -e "$BLEU""Packaging MDANSE" "$NORMAL" echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf build_darwin/build rm -rf BuildServer/Darwin/Build/dist
rm -rf build_darwin/dist rm -rf BuildServer/Darwin/Build/build
# debug option for py2app, if needed # debug option for py2app, if needed
export DISTUTILS_DEBUG=0 export DISTUTILS_DEBUG=0
cd BuildServer/Darwin/Scripts cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app /usr/local/bin/python build.py py2app
rc=$? rc=$?
if [[ $rc != 0 ]]; then if [[ $rc != 0 ]]; then
echo -e "$ROUGE""Cannot build app." "$NORMAL" echo -e "$ROUGE""Cannot build app." "$NORMAL"
exit 1 exit 1
fi fi
cd ../.. cd ../Build
# Do some manual cleanup, e.g. # Do some manual cleanup, e.g.
# matplotlib/tests ==> 45.2 Mb # matplotlib/tests ==> 45.2 Mb
rm -rf build_darwin/dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests rm -rf dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests
rm -rf build_darwin/dist/MDANSE.app/Contents/Resources/mpl-data/sample_data rm -rf 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) #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"> build_darwin/dist/MDANSE.app/Contents/Resources/version echo "$BUILD_NAME b$REV_NUMBER"> dist/MDANSE.app/Contents/Resources/version
cd build_darwin rm -f ./MDANSE.dmg
rm -f ./rw.MDANSE.dmg
hdiutil unmount /Volumes/MDANSE -force -quiet
# Archive app ../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 MDANSE.dmg ./dist
echo -e "$BLEU" "Archiving ${TARGET_DIR}.tar.gz ..." "$NORMAL"
cd dist
gnutar cfp - MDANSE.app | gzip --best -c > ../../../${TARGET_DIR}.tar.gz
cd ..
exit;
TODAY=$(date +"%m-%d-%y-%Hh%Mm%S")
# Create sparse image for distribution
echo -e "$BLEU" "Creating new MDANSE.dmg.sparseimage ..." "$NORMAL"
hdiutil detach /Volumes/MDANSE/ -quiet
# Keep previous build, in case of
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 MDANSE.dmg.sparseimage
echo -e "$BLEU" "Copying MDANSE.app on dmg ..." "$NORMAL"
cp -a dist/MDANSE.app /Volumes/MDANSE/MDANSE/
# Reset Custom icon on MDANSE folder
SetFile -a C /Volumes/MDANSE/MDANSE/
hdiutil detach /Volumes/MDANSE
hdiutil convert MDANSE.dmg.sparseimage -format UDZO -imagekey zlib-level=9 -ov -o ../../${TARGET_DIR}.dmg
echo -e "$VERT" "Done." "$NORMAL"
exit exit
fi fi
......
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