Commit 4252e4de authored by eric pellegrini's avatar eric pellegrini
Browse files

updated the Darwin ci scripts

parent 34e592db
Pipeline #3055 canceled with stages
in 1 minute and 8 seconds
......@@ -17,7 +17,7 @@ if sys.platform.startswith('darwin'):
u'LSApplicationCategoryType': u'public.app-category.science'
}
OPTIONS = {
'argv_emulation': True,
'argv_emulation': False,# has to be False otherwise triggers problems zith wxPython which lose some events that are captured by OS
'iconfile': u'../../../MDANSE/GUI/Icons/mdanse.icns',
'excludes': 'PyQt4',
'matplotlib_backends': '-',
......@@ -26,11 +26,12 @@ if sys.platform.startswith('darwin'):
'bdist_base': '../Build/build',
'dist_dir': '../Build/dist',
'graph': False,
'xref': False
'xref': False,
'packages' : ["MDANSE","MMTK","Scientific"]
}
setup(
name="MDANSE",
name='MDANSE',
app=APP,
options={'py2app': OPTIONS},
setup_requires=['py2app']
......
#!/bin/bash
files=`ls ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/*.so`
files=`ls ./dist/MDANSE.app/Contents/Frameworks/libwx*.dylib`
libs="osx_cocoau_xrc osx_cocoau_webview osx_cocoau_html osx_cocoau_qa osx_cocoau_adv osx_cocoau_core baseu_xml baseu_net baseu"
......@@ -9,7 +9,7 @@ do
chmod 777 $f
for l in $libs
do
install_name_tool -change /usr/local/opt/wxmac/lib/libwx_$l-3.0.dylib @executable_path/../Frameworks/libwx_$l-3.0.dylib $f
install_name_tool -change /usr/local/lib/libwx_$l-3.0.dylib @executable_path/../Frameworks/libwx_$l-3.0.dylib $f
done
done
......@@ -11,7 +11,7 @@ ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
##Select the build target
BUILD_TARGET=darwin
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
......@@ -31,10 +31,10 @@ rm -rf build
rm -rf dist
# Remove previous install of MDANSE
rm /usr/local/bin/mdanse*
rm /usr/local/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /usr/local/lib/python2.7/site-packages/MDANSE
rm /Library/Frameworks/Python.framework/Versions/2.7/bin/mdanse*
rm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE
# Build and install MDANSE to the homebrewed python
/usr/local/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/usr/local/bin/python setup.py install >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
......@@ -36,7 +36,7 @@ export DISTUTILS_DEBUG=0
cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app >> build_log.txt 2>&1
/usr/local/bin/python build.py py2app
rc=$?
if [[ $rc != 0 ]]; then
......@@ -63,15 +63,22 @@ hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
# recipe to make the dmg free from the building machine dependency adapted from
# http://joaoventura.net/blog/2016/embeddable-python-osx/
cp -r /usr/local/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
cp /usr/local/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./dist/MDANSE.app/Contents/MacOS/python
cp /usr/local/Frameworks/Python.framework/Versions/2.7/Python ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
install_name_tool -change /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ./dist/MDANSE.app/Contents/MacOS/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
# why we have to modify the python executable appropriately with the following commands
cp -r /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
rm -rf ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/*
cp /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./dist/MDANSE.app/Contents/MacOS/python
cp /Library/Frameworks/Python.framework/Versions/2.7/Python ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
install_name_tool -change /Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ./dist/MDANSE.app/Contents/MacOS/python
chmod 777 ./dist/MDANSE.app/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 ./dist/MDANSE.app/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 ../Scripts/site.py ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/.
chmod 777 ../Scripts/change_dylib_path.sh
../Scripts/change_dylib_path.sh
......
......@@ -14,7 +14,7 @@ fi
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
/Library/Frameworks/Python.framework/Versions/2.7/bin/python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
if [ $? -ne 0 ]; then
status=$?
......
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