Commit b682942d authored by Remi Perenon's avatar Remi Perenon

Cleaning macOS deploy script to have a lighter dmg file

parent da3d717c
......@@ -44,7 +44,6 @@ echo "${VERSION_NAME}" > ${MDANSE_APP_DIR}/Contents/Resources/version
#############################
# Copying Python
#############################
### When launching the bundle, the executable target (i.e. MDANSE) modify the python that is shipped with the bundle (si.e. package path, dylib dependencies ...)
### see http://joaoventura.net/blog/2016/embeddable-python-osx/ for technical details
### In our case we also want the user to be able to start directly python without launching the bundle executable (e.g. to run scripts in command line) which is the reason
......@@ -62,31 +61,6 @@ install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents
ln -s ../Resources/bin/python ${MDANSE_APP_DIR}/Contents/MacOS/python
# Do some manual cleanup, e.g.
# matplotlib/tests ==> 45.2 Mb
#rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/tests
#rm -rf ${MDANSE_APP_DIR}/Contents/Resources/mpl-data/sample_data
#rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/scipy
#rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/zmq
#mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework
#mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions
#mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7
#mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib
#cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
#rm -rf ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/*
#rm ${MDANSE_APP_DIR}/Contents/MacOS/python
#cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_APP_DIR}/Contents/MacOS/python
#cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
#install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/MacOS/python
#chmod 777 ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
#install_name_tool -id @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
## In order that the modified python in the bundle import the zipped sitepackages located in Contents/Resources we provide a modified site.py that will
## update the sys.path accordingly
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/.
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/.
......@@ -96,6 +70,19 @@ ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
# Comment the 'add_system_python_extras' call that add some System path to the sys.path
"${SED_I_COMMAND[@]}" "s/^add_system_python_extras()$/#add_system_python_extras()/" ${MDANSE_APP_DIR}/Contents/Resources/__boot__.py
#############################
# Cleanup
#############################
# Removing matplotlib/tests ==> 45.2 Mb
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/tests
# Sample data for matplotlib is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/mpl-data/sample_data
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/mpl-data/sample_data
# Scipy package is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/scipy
# ZMQ package is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/zmq
#############################
# Create DMG
#############################
......@@ -104,4 +91,3 @@ sleep 5
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/create-dmg --background "${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/dmg_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}" ${CI_TEMP_DIR}/dist
mv ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/${MDANSE_DMG} ${CI_PROJECT_DIR}
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