Commit 70cfe9ed authored by Jamie Hall's avatar Jamie Hall
Browse files

Updated macos package script

parent f8f6e2ee
Pipeline #251 skipped
......@@ -20,97 +20,89 @@ CYAN="\\033[1;36m"
##Select the build target
BUILD_TARGET=darwin
##Do we need to create the final archive
ARCHIVE_FOR_DISTRIBUTION=1
cd ../../../
#############################
# Darwin
#############################
declare -x MDANSE_VERSION=$(grep -Po '(?<=__version__ = \")\d.\d.\d' MDANSE/__pkginfo__.py)
# Which version name are we appending to the final archive
TARGET_DIR=MDANSE-${MDANSE_VERSION}-${BUILD_TARGET}
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
# Get revision number from git (without trailing newline)
# 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)
# see http://stackoverflow.com/questions/7648328/getting-sed-error
# sed -i "" "s/__revision__ = \"undefined\"/__revision__ = \"${REV_NUMBER}\"/" MDANSE/__pkginfo__.py
# Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL"
# Clean up temporary build directories
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
# Build and install MDANSE to the homebrewed python
/usr/local/bin/python setup.py build
/usr/local/bin/python setup.py install
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
cd ../../..
echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf BuildServer/Darwin/Build
mkdir BuildServer/Darwin/Build
if [ "$BUILD_TARGET" = "darwin" ]; then
cd ../../../
declare -x VERSION=$(grep -Po '(?<=__version__ = \")\d.\d.\d' MDANSE/__pkginfo__.py)
# Which version name are we appending to the final archive
TARGET_DIR=MDANSE-${VERSION}-${BUILD_TARGET}
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
# Get revision number from git (without trailing newline)
# 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)
# see http://stackoverflow.com/questions/7648328/getting-sed-error
# sed -i "" "s/__revision__ = \"undefined\"/__revision__ = \"${REV_NUMBER}\"/" MDANSE/__pkginfo__.py
# Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL"
# Clean up temporary build directories
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
# Build and install MDANSE to the homebrewed python
/usr/local/bin/python setup.py build
/usr/local/bin/python setup.py install
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
cd ../../..
echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf BuildServer/Darwin/Build
mkdir BuildServer/Darwin/Build
# debug option for py2app, if needed
export DISTUTILS_DEBUG=0
cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app
rc=$?
if [[ $rc != 0 ]]; then
echo -e "$ROUGE""Cannot build app." "$NORMAL"
exit 1
fi
cd ../Build
# Do some manual cleanup, e.g.
# matplotlib/tests ==> 45.2 Mb
rm -rf dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests
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)
echo "${VERSION}"> dist/MDANSE.app/Contents/Resources/version
rm -f ./MDANSE.dmg
rm -f ./rw.MDANSE.dmg
hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
../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
curl -T MDANSE-${VERSION}-${BUILD_TARGET}.dmg ftp://$CI_FTP_USER_USERNAME:$CI_FTP_USER_PASSWORD@ftp.ill.fr/mdanse/
exit
# debug option for py2app, if needed
export DISTUTILS_DEBUG=0
cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app
rc=$?
if [[ $rc != 0 ]]; then
echo -e "$ROUGE""Cannot build app." "$NORMAL"
exit 1
fi
cd ../Build
# Do some manual cleanup, e.g.
# matplotlib/tests ==> 45.2 Mb
rm -rf dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests
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)
echo "${MDANSE_VERSION}"> dist/MDANSE.app/Contents/Resources/version
MDANSE_DMG=MDANSE-${VERSION}-${BUILD_TARGET}.dmg
rm -f ./${MDANSE_DMG}
rm -f ./rw.${MDANSE_DMG}
hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
../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
curl -T ${MDANSE_DMG} ftp://$CI_FTP_USER_USERNAME:$CI_FTP_USER_PASSWORD@ftp.ill.fr/mdanse/
exit
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