From 8e01668e1d02beb998e0f03e00c4a87679d1242f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 27 Dec 2012 00:05:29 +0100 Subject: [PATCH] Adjusted packing to include new dependencies (flask + friends) in the win32 package and also adjusted some stuff to make packaging even work on my system (will probably revert some of that once I come around to properly analyse the issues I had) --- package.sh | 27 ++++++++++++++++++++++----- scripts/win32/installer.nsi | 3 ++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/package.sh b/package.sh index 12693f17..5e21d443 100755 --- a/package.sh +++ b/package.sh @@ -16,7 +16,7 @@ BUILD_TARGET=${1:-all} ##Do we need to create the final archive ARCHIVE_FOR_DISTRIBUTION=1 ##Which version name are we appending to the final archive -BUILD_NAME=12.12 +BUILD_NAME=12.12_webui TARGET_DIR=Cura-${BUILD_NAME}-${BUILD_TARGET} ##Which versions of external programs to use @@ -41,7 +41,7 @@ function downloadURL echo "Checking for $filename" if [ ! -f "$filename" ]; then echo "Downloading $1" - curl -L -O "$1" + curl --insecure -L -O "$1" if [ $? != 0 ]; then echo "Failed to download $1" exit 1 @@ -155,7 +155,13 @@ if [ $BUILD_TARGET = "win32" ]; then downloadURL https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-win32.zip #Get the power module for python rm -rf Power - git clone https://github.com/GreatFruitOmsk/Power + git clone git://github.com/GreatFruitOmsk/Power.git + #Get modules needed for webui: flask, werkzeug, jinja2, itsdangerous + rm -rf flask werkzeug jinja2 itsdangerous + git clone git://github.com/mitsuhiko/flask.git + git clone git://github.com/mitsuhiko/werkzeug.git + git clone git://github.com/mitsuhiko/jinja2.git + git clone git://github.com/mitsuhiko/itsdangerous.git else downloadURL https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-${BUILD_TARGET}.tar.bz2 fi @@ -190,12 +196,23 @@ if [ $BUILD_TARGET = "win32" ]; then mv PURELIB/comtypes ${TARGET_DIR}/python/Lib mv PLATLIB/numpy ${TARGET_DIR}/python/Lib mv Power/power ${TARGET_DIR}/python/Lib + mv flask/flask ${TARGET_DIR}/python/Lib + mv werkzeug/werkzeug ${TARGET_DIR}/python/Lib + mv jinja2/jinja2 ${TARGET_DIR}/python/Lib + mv itsdangerous/itsdangerous.py ${TARGET_DIR}/python/Lib mv VideoCapture-0.9-5/Python27/DLLs/vidcap.pyd ${TARGET_DIR}/python/DLLs mv ffmpeg-20120927-git-13f0cd6-win32-static/bin/ffmpeg.exe ${TARGET_DIR}/Cura/ mv ffmpeg-20120927-git-13f0cd6-win32-static/licenses ${TARGET_DIR}/Cura/ffmpeg-licenses/ mv Win32/EjectMedia.exe ${TARGET_DIR}/Cura/ + # fix the broken email.mime module of portable python + touch ${TARGET_DIR}/python/Lib/email/mime/__init__.py + rm -rf Power/ + rm -rf flask/ + rm -rf werkzeug/ + rm -rf jinja2/ + rm -rf itsdangerous/ rm -rf \$_OUTDIR rm -rf PURELIB rm -rf PLATLIB @@ -254,10 +271,10 @@ if (( ${ARCHIVE_FOR_DISTRIBUTION} )); then wine ~/.wine/drive_c/Program\ Files/NSIS/makensis.exe /DVERSION=${BUILD_NAME} scripts/win32/installer.nsi mv scripts/win32/Cura_${BUILD_NAME}.exe ./ fi - if [ -f '/c/Program Files (x86)/NSIS/makensis.exe' ]; then + if [ -f '/cygdrive/c/Program Files (x86)/NSIS/makensis.exe' ]; then rm -rf scripts/win32/dist mv `pwd`/${TARGET_DIR} scripts/win32/dist - '/c/Program Files (x86)/NSIS/makensis.exe' -DVERSION=${BUILD_NAME} 'scripts/win32/installer.nsi' >> log.txt + '/cygdrive/c/Program Files (x86)/NSIS/makensis.exe' -DVERSION=${BUILD_NAME} 'scripts/win32/installer.nsi' >> log.txt mv scripts/win32/Cura_${BUILD_NAME}.exe ./ fi else diff --git a/scripts/win32/installer.nsi b/scripts/win32/installer.nsi index a9d639de..6635b4e4 100644 --- a/scripts/win32/installer.nsi +++ b/scripts/win32/installer.nsi @@ -93,7 +93,8 @@ Section "Cura ${VERSION}" CreateDirectory "$SMPROGRAMS\Cura ${VERSION}" CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall Cura ${VERSION}.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk" "$INSTDIR\python\pythonw.exe" '-m "Cura.cura"' "$INSTDIR\Cura\resources\cura.ico" 0 - + CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura WebUI ${VERSION}.lnk" "$INSTDIR\python\python.exe" '-m "Cura.cura" --web' "$INSTDIR\Cura\resources\cura.ico" 0 + ; Give all users write permissions in the install directory, so they can read/write profile and preferences files. AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"