Commit 1e295bbf authored by eric pellegrini's avatar eric pellegrini

Fixing the MacOS failing ci

parent a6584395
...@@ -2,7 +2,7 @@ stages: ...@@ -2,7 +2,7 @@ stages:
- docker_login - docker_login
- ci - ci
- deploy - deploy
- clean - docker_logout
docker_login: docker_login:
stage: docker_login stage: docker_login
...@@ -133,8 +133,8 @@ deploy:ubuntu_bionic: ...@@ -133,8 +133,8 @@ deploy:ubuntu_bionic:
ci:osx: ci:osx:
stage: ci stage: ci
script: script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/version.sh - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/version.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/build.sh - ${CI_PROJECT_DIR}/BuildServer/Unix/build.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/tests.sh - ${CI_PROJECT_DIR}/BuildServer/Unix/tests.sh
allow_failure: false allow_failure: false
...@@ -149,9 +149,9 @@ ci:osx: ...@@ -149,9 +149,9 @@ ci:osx:
deploy:osx: deploy:osx:
stage: deploy stage: deploy
script: script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/version.sh - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/version.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/deploy_macos.sh - ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/deploy.sh
dependencies: dependencies:
- ci:osx - ci:osx
allow_failure: false allow_failure: false
...@@ -214,35 +214,13 @@ deploy:windows: ...@@ -214,35 +214,13 @@ deploy:windows:
- sci - sci
- windows-10 - windows-10
clean:docker: docker_logout:
stage: clean stage: clean
when: always when: always
script: script:
- chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
- ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
after_script:
- docker logout - docker logout
tags: tags:
- docker - docker
- sci - sci
- ubuntu - ubuntu
clean:osx:
stage: clean
when: always
script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/clean.sh
tags:
- sci
- osx-10.13
clean:windows:
stage: clean
when: always
script:
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\clean.bat"
tags:
- sci
- windows-10
export ARCH=amd64
export DISTRO=$(lsb_release -c | cut -f2)
export PYTHONEXE=/usr/bin/python
export SED_I_COMMAND='sed -i'
...@@ -9,8 +9,11 @@ export DISTUTILS_DEBUG=0 ...@@ -9,8 +9,11 @@ export DISTUTILS_DEBUG=0
############################# #############################
# PREPARATION # PREPARATION
############################# #############################
cd ${MDANSE_SOURCE_DIR}
DEBIAN_ROOT_DIR=${MDANSE_SOURCE_DIR}/dist/debian SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DEBIAN_ROOT_DIR=${CI_TEMP_DIR}/dist
rm -rf ${DEBIAN_ROOT_DIR} rm -rf ${DEBIAN_ROOT_DIR}
mkdir -p ${DEBIAN_ROOT_DIR} mkdir -p ${DEBIAN_ROOT_DIR}
...@@ -20,7 +23,7 @@ mkdir -p ${DEBIAN_ROOT_DIR} ...@@ -20,7 +23,7 @@ mkdir -p ${DEBIAN_ROOT_DIR}
echo -e "${BLUE}""Build debian tree""${NORMAL}" echo -e "${BLUE}""Build debian tree""${NORMAL}"
# Copy all the debian files (e.g. control, copyright, md5sum ...) into DEBIAN directory # Copy all the debian files (e.g. control, copyright, md5sum ...) into DEBIAN directory
cp -r BuildServer/Unix/Debian_resources/DEBIAN ${DEBIAN_ROOT_DIR}/ cp -r ${SCRIPT_DIR}/DEBIAN ${DEBIAN_ROOT_DIR}/
# Set automatically the good version number for the Debian control file # Set automatically the good version number for the Debian control file
sed -i "s/Version:.*/Version: ${VERSION_NAME}/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control sed -i "s/Version:.*/Version: ${VERSION_NAME}/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control
chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN
...@@ -28,24 +31,27 @@ chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN ...@@ -28,24 +31,27 @@ chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN
# Build the /usr/share/applications directory inside the debian root directory and copy the mdanse desktop file inside # Build the /usr/share/applications directory inside the debian root directory and copy the mdanse desktop file inside
DEBIAN_APP_DIR=${DEBIAN_ROOT_DIR}/usr/share/applications DEBIAN_APP_DIR=${DEBIAN_ROOT_DIR}/usr/share/applications
mkdir -p ${DEBIAN_APP_DIR} mkdir -p ${DEBIAN_APP_DIR}
cp BuildServer/Unix/Debian_resources/MDANSE.desktop ${DEBIAN_APP_DIR}/ cp ${SCRIPT_DIR}/MDANSE.desktop ${DEBIAN_APP_DIR}/
# Build the /usr/share/pixmaps directory inside the debian root directory and copy the mdanse icon file inside # Build the /usr/share/pixmaps directory inside the debian root directory and copy the mdanse icon file inside
DEBIAN_PIXMAPS_DIR=${DEBIAN_ROOT_DIR}/usr/share/pixmaps DEBIAN_PIXMAPS_DIR=${DEBIAN_ROOT_DIR}/usr/share/pixmaps
mkdir -p ${DEBIAN_PIXMAPS_DIR} mkdir -p ${DEBIAN_PIXMAPS_DIR}
cp MDANSE/GUI/Icons/mdanse.png ${DEBIAN_PIXMAPS_DIR}/ cp ${CI_PROJECT_DIR}/MDANSE/GUI/Icons/mdanse.png ${DEBIAN_PIXMAPS_DIR}/
# Build the /usr/local/bin directory inside the debian root directory and copy the mdanse scripts inside # Build the /usr/local/bin directory inside the debian root directory and copy the mdanse scripts inside
DEBIAN_BIN_DIR=${DEBIAN_ROOT_DIR}/usr/local/bin DEBIAN_BIN_DIR=${DEBIAN_ROOT_DIR}/usr/local/bin
mkdir -p ${DEBIAN_BIN_DIR} mkdir -p ${DEBIAN_BIN_DIR}
cp Scripts/* ${DEBIAN_BIN_DIR}/ cp ${CI_PROJECT_DIR}/Scripts/* ${DEBIAN_BIN_DIR}/
dos2unix ${DEBIAN_BIN_DIR}/mdanse_* dos2unix ${DEBIAN_BIN_DIR}/mdanse_*
# Build the usr/local/lib/python2.7/dist-packages directory inside the debian root directory and copy the MDANSE package inside # Build the usr/local/lib/python2.7/dist-packages directory inside the debian root directory and copy the MDANSE package inside
DEBIAN_DIST_DIR=${DEBIAN_ROOT_DIR}/usr/local/lib/python2.7/dist-packages DEBIAN_DIST_DIR=${DEBIAN_ROOT_DIR}/usr/local/lib/python2.7/dist-packages
mkdir -p ${DEBIAN_DIST_DIR} mkdir -p ${DEBIAN_DIST_DIR}
${PYTHONEXE} setup.py build --build-platlib build/lib --build-scripts build/scripts build_api cd ${CI_PROJECT_DIR}
# Buid API
${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR} build_api
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
...@@ -53,7 +59,8 @@ if [ $status -ne 0 ]; then ...@@ -53,7 +59,8 @@ if [ $status -ne 0 ]; then
exit $status exit $status
fi fi
${PYTHONEXE} setup.py build --build-platlib build/lib --build-scripts build/scripts build_help # Buid embedded doc
${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR} build_help
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
...@@ -62,26 +69,18 @@ if [ $status -ne 0 ]; then ...@@ -62,26 +69,18 @@ if [ $status -ne 0 ]; then
fi fi
echo -e "${BLUE}""Installing MDANSE""${NORMAL}" echo -e "${BLUE}""Installing MDANSE""${NORMAL}"
cd $MDANSE_SOURCE_DIR
${PYTHONEXE} setup.py build --build-platlib build/lib --build-scripts build/scripts install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install MDANSE""${NORMAL}"
exit $status
fi
# Copy the localy installed ScientificPython, MMTK and MDANSE # Copy the localy installed ScientificPython, MMTK and MDANSE
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/Scientific ${DEBIAN_DIST_DIR} cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/Scientific ${DEBIAN_DIST_DIR}
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/MMTK ${DEBIAN_DIST_DIR} cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MMTK ${DEBIAN_DIST_DIR}
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/MDANSE ${DEBIAN_DIST_DIR} cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MDANSE ${DEBIAN_DIST_DIR}
# Compute the Installed-Size field for the debian package # Compute the Installed-Size field for the debian package
instSize=$(du ${DEBIAN_ROOT_DIR} -b -s | cut -f1) instSize=$(du ${DEBIAN_ROOT_DIR} -b -s | cut -f1)
sed -i "s/Installed-Size:.*/Installed-Size: $((1+(instSize/1024)))/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control sed -i "s/Installed-Size:.*/Installed-Size: $((1+(instSize/1024)))/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control
export TMPDIR=. export TMPDIR=.
fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${MDANSE_SOURCE_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${CI_PROJECT_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Cannot build app.""${NORMAL}" echo -e "${RED}" "Cannot build app.""${NORMAL}"
......
...@@ -6,8 +6,9 @@ if sys.platform.startswith('darwin'): ...@@ -6,8 +6,9 @@ if sys.platform.startswith('darwin'):
from setuptools import setup from setuptools import setup
version = os.environ['VERSION_NAME'] version = os.environ['VERSION_NAME']
project_dir = os.environ['CI_PROJECT_DIR']
APP = ['../../../Scripts/mdanse_gui'] APP = [os.path.join(project_dir,'Scripts','mdanse_gui')]
PLIST = { PLIST = {
u'CFBundleName': u'MDANSE', u'CFBundleName': u'MDANSE',
...@@ -18,13 +19,13 @@ if sys.platform.startswith('darwin'): ...@@ -18,13 +19,13 @@ if sys.platform.startswith('darwin'):
} }
OPTIONS = { OPTIONS = {
'argv_emulation': False,# has to be False otherwise triggers problems with wxPython which lose some events that are captured by OS 'argv_emulation': False,# has to be False otherwise triggers problems with wxPython which lose some events that are captured by OS
'iconfile': u'../../../MDANSE/GUI/Icons/mdanse.icns', 'iconfile': os.path.join(project_dir,'MDANSE','GUI','Icons','mdanse.icns'),
'excludes': 'PyQt4', 'excludes': 'PyQt4',
'matplotlib_backends': '-', 'matplotlib_backends': '-',
'optimize': '1', 'optimize': '1',
'plist': PLIST, 'plist': PLIST,
'bdist_base': '../../../build', 'bdist_base': os.environ['CI_TEMP_BUILD_DIR'],
'dist_dir': '../../../dist', 'dist_dir': os.path.join(os.environ['CI_TEMP_DIR'],'dist'),
'graph': False, 'graph': False,
'xref': False, 'xref': False,
'packages' : ["MDANSE","MMTK","Scientific"] 'packages' : ["MDANSE","MMTK","Scientific"]
......
export ARCH=amd64 export ARCH=amd64
export DISTRO=macOS export DISTRO=macOS
export PYTHONEXE=/usr/bin/python export PYTHONEXE=/usr/bin/python
# The sed -i"" is compulsory other crashes on macos # The sed -i"" is compulsory other crashes on macos
export SED_I_COMMAND='sed -i ""' export SED_I_COMMAND='sed -i ""'
export MDANSE_SOURCE_DIR=$(pwd)
export MDANSE_TEMPORARY_INSTALLATION_DIR=${MDANSE_SOURCE_DIR}/build
export PYTHONPATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}:${PYTHONPATH}
export MDANSE_DEPENDENCIES_DIR=/Users/ci/Projects/mdanse/dependencies export MDANSE_DEPENDENCIES_DIR=/Users/ci/Projects/mdanse/dependencies
export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
# Get revision number from Git
export MDANSE_GIT_CURRENT_COMMIT=$(git rev-parse --short HEAD)
# Get commit branch from Gitlab
export MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME}
...@@ -9,7 +9,9 @@ export DISTUTILS_DEBUG=0 ...@@ -9,7 +9,9 @@ export DISTUTILS_DEBUG=0
############################# #############################
# PREPARATION # PREPARATION
############################# #############################
cd ${MDANSE_SOURCE_DIR} cd ${CI_PROJECT_DIR}
MDANSE_APP_DIR=${CI_TEMP_DIR}/dist/MDANSE.app
############################# #############################
# PACKAGING # PACKAGING
...@@ -17,7 +19,7 @@ cd ${MDANSE_SOURCE_DIR} ...@@ -17,7 +19,7 @@ cd ${MDANSE_SOURCE_DIR}
echo -e "${BLUE}""Packaging MDANSE""${NORMAL}" echo -e "${BLUE}""Packaging MDANSE""${NORMAL}"
MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg
cd BuildServer/Unix/MacOS_resources cd ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS
${PYTHONEXE} build.py py2app ${PYTHONEXE} build.py py2app
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
...@@ -26,58 +28,59 @@ if [ $status -ne 0 ]; then ...@@ -26,58 +28,59 @@ if [ $status -ne 0 ]; then
fi fi
# 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 "${VERSION_NAME}" > ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/version echo "${VERSION_NAME}" > ${MDANSE_APP_DIR}/Contents/Resources/version
############################# #############################
# Copying Python # 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 ...) ### 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 ### 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 ### 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 ### why we have to modify the python executable appropriately with the following commands
rm ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/MacOS/python rm ${MDANSE_APP_DIR}/Contents/MacOS/python
mkdir ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/bin mkdir ${MDANSE_APP_DIR}/Contents/Resources/bin
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/bin/python cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_APP_DIR}/Contents/Resources/bin/python
cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/* ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/ cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/* ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
chmod 777 ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib chmod 777 ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../lib/libpython2.7.dylib ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/bin/python install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../lib/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/bin/python
install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
ln -s ../Resources/bin/python ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/MacOS/python ln -s ../Resources/bin/python ${MDANSE_APP_DIR}/Contents/MacOS/python
# Do some manual cleanup, e.g. # Do some manual cleanup, e.g.
rm ${MDANSE_SOURCE_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/MDANSE/__pkginfo__.py\"\" rm ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/MDANSE/__pkginfo__.py\"\"
# matplotlib/tests ==> 45.2 Mb # matplotlib/tests ==> 45.2 Mb
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/tests
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/mpl-data/sample_data #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/mpl-data/sample_data
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/scipy #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/scipy
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/zmq #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/zmq
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7 #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib #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_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7 #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_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/* #rm -rf ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/*
#rm ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python #rm ${MDANSE_APP_DIR}/Contents/MacOS/python
#cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/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_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib #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_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python #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_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib #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_TEMPORARY_INSTALLATION_DIR}/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 ${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 ## 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 ## update the sys.path accordingly
#cp ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/site.py ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/. #cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/.
chmod 777 ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/change_dylib_path.sh chmod 777 ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/change_dylib_path.sh ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
############################# #############################
# Create DMG # Create DMG
...@@ -85,6 +88,4 @@ ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/change_dylib_path.sh ...@@ -85,6 +88,4 @@ ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/change_dylib_path.sh
hdiutil unmount /Volumes/MDANSE -force -quiet hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5 sleep 5
${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/dmg/create-dmg --background "${MDANSE_SOURCE_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}" ${MDANSE_SOURCE_DIR}/dist ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/dmg/create-dmg --background "${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/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_PROJECT_DIR}
mv ${MDANSE_SOURCE_DIR}/dist/${MDANSE_DMG} ${MDANSE_SOURCE_DIR}
#!/bin/bash #!/bin/bash
############################# cd ${CI_TEMP_DIR}
# PREPARATION
#############################
rm -rf build
############################# #############################
# BUILDING DEPENDENCIES # BUILDING DEPENDENCIES
############################# #############################
# Build ILL version of ScientificPython # Build ILL version of ScientificPython
echo -e "${BLUE}""Building ScientificPython""${NORMAL}" echo -e "${BLUE}""Building ScientificPython""${NORMAL}"
cd /tmp
rm -rf scientific-python rm -rf scientific-python
git clone https://code.ill.fr/scientific-software/scientific-python.git git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python cd scientific-python
git checkout master git checkout master
${PYTHONEXE} setup.py build
status=$? ${PYTHONEXE} setup.py build --build-base=${CI_TEMP_BUILD_DIR} install --prefix=${CI_TEMP_INSTALL_DIR}
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build Scientific""${NORMAL}"
exit $status
fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install Scientific""${NORMAL}" echo -e "${RED}" "Failed to build/install Scientific""${NORMAL}"
exit $status exit $status
fi fi
export NETCDF_HEADER_FILE_PATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}/include/python2.7/
cp ${NETCDF_HEADER_FILE_PATH}/Scientific/netcdf.h ${NETCDF_HEADER_FILE_PATH} cp ${CI_TEMP_DIR}/include/python2.7/Scientific/netcdf.h ${CI_TEMP_DIR}/include/python2.7/
cd ${CI_TEMP_DIR}
# Build ILL version of MMTK # Build ILL version of MMTK
echo -e "${BLUE}""Building MMTK""${NORMAL}" echo -e "${BLUE}""Building MMTK""${NORMAL}"
cd /tmp
rm -rf mmtk rm -rf mmtk
git clone https://code.ill.fr/scientific-software/mmtk.git git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk cd mmtk
git checkout master git checkout master
${PYTHONEXE} setup.py build
status=$? ${PYTHONEXE} setup.py build --build-base=${CI_TEMP_BUILD_DIR} install --prefix=${CI_TEMP_INSTALL_DIR}
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MMTK""${NORMAL}"
exit $status
fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install MMTK""${NORMAL}" echo -e "${RED}" "Failed to build/install MMTK""${NORMAL}"
exit $status exit $status
fi fi
...@@ -54,14 +41,15 @@ fi ...@@ -54,14 +41,15 @@ fi
# MDANSE Building # MDANSE Building
############################# #############################
echo -e "${BLUE}""Building MDANSE""${NORMAL}" echo -e "${BLUE}""Building MDANSE""${NORMAL}"
cd $MDANSE_SOURCE_DIR
cd ${CI_PROJECT_DIR}
# Now build last version and install it # Now build last version and install it
${PYTHONEXE} setup.py build --build-platlib build/lib --build-scripts build/scripts ${PYTHONEXE} setup.py build --build-base=${CI_TEMP_BUILD_DIR} install --prefix=${CI_TEMP_INSTALL_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MDANSE""${NORMAL}" echo -e "${RED}" "Failed to build/install MDANSE""${NORMAL}"
exit $status exit $status
fi fi
#!/bin/bash
#############################
# PREPARATION
#############################
cd ${MDANSE_SOURCE_DIR}
#############################
# UNITARY TESTS
#############################
echo -e "${BLUE}""Cleaning repository""${NORMAL}"
rm -rf /tmp/mmtk
rm -rf /tmp/scientific-python
rm -rf MDANSE_TEMPORARY_INSTALLATION_DIR
rm -rf build
rm -rf BuildServer/Build_Debian
rm -rf BuildServer/Build_macOS
rm -rf BuildServer/Unix/Build_Debian
rm -rf BuildServer/Unix/Build_macOS
rm -rf *.deb
rm -rf *.dmg
\ No newline at end of file
export ARCH=amd64
export DISTRO=$(lsb_release -c | cut -f2)
export PYTHONEXE=/usr/bin/python
# The sed -i"" is compulsory other crashes on macos
export SED_I_COMMAND='sed -i'
export MDANSE_SOURCE_DIR=$(pwd)
export MDANSE_TEMPORARY_INSTALLATION_DIR=${MDANSE_SOURCE_DIR}/build/mdanse
export PYTHONPATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/:${PYTHONPATH}
export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
# Get revision number from Git
export MDANSE_GIT_CURRENT_COMMIT=$(git rev-parse --short HEAD)
# Get commit branch from Gitlab
export MDANSE_GIT_BRANCH_NAME="$1"
#!/bin/bash
if [ -z ${CI_PROJECT_DIR} ]; then
export CI_PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
fi
export CI_TEMP_DIR=${CI_PROJECT_DIR}/temp
export CI_TEMP_BUILD_DIR=${CI_PROJECT_DIR}/temp/build
export CI_TEMP_INSTALL_DIR=${CI_PROJECT_DIR}/temp/install
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages:${PYTHONPATH}