summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-16 01:00:00 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-16 01:00:00 (GMT)
commit32e98a0766a357ccf4e6b915760b419e6410f1f0 (patch)
treeffcb68728476c00727f2e3b624d3db36b47ca850
parentf2926d6630c06c3d35114ca78bb564ee6723c62f (diff)
Merged Mac and Windows scripts, not tested under Windows
git-svn-id: http://svn.clifford.at/openscad/trunk@322 b57f626f-c46c-0410-a088-ec61d464b74c
-rwxr-xr-xrelease-common.sh112
1 files changed, 112 insertions, 0 deletions
diff --git a/release-common.sh b/release-common.sh
new file mode 100755
index 0000000..7f00d04
--- /dev/null
+++ b/release-common.sh
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# This script creates a binary release of OpenSCAD.
+# This should work under Mac OS X and Windows (msys). Linux support pending.
+# The script will create a file called openscad-<versionstring>.zip
+# in the current directory.
+#
+# Usage: release-common.sh [-v <versionstring>]
+# -v Version string (e.g. -v 2010.01)
+#
+# If no version string is given, todays date will be used (YYYY-MM-DD)
+# If no make target is given, release will be used on Windows, none one Mac OS X
+#
+
+printUsage()
+{
+ echo "Usage: $0 -v <versionstring>
+ echo
+ echo " Example: $0 -v 2010.01
+}
+
+if [[ $OSTYPE =~ "darwin" ]]; then
+ OS=MACOSX
+elif [[ $OSTYPE == "Msys" ]]; then
+ OS=WIN
+fi
+
+echo "Detected OS: $OS"
+
+while getopts 'v:' c
+do
+ case $c in
+ v) VERSION=$OPTARG;;
+ esac
+done
+
+if test -z "$VERSION"; then
+ VERSION=`date "+%Y.%m.%d"`
+fi
+
+echo "Building openscad-$VERSION $CONFIGURATION..."
+
+case $OS in
+ MACOSX)
+ CONFIG=mdi
+ ZIP=zip
+ ZIPARGS=-qr
+ TARGET=
+ ;;
+ WIN)
+ unset CONFIG
+ export QTDIR=/c/devmingw/qt2009.03
+ export QTMAKESPEC=win32-g++
+ export PATH=$PATH:/c/devmingw/qt2009.03/bin:/c/devmingw/qt2009.03/qt/bin
+ ZIP="/c/Program Files/7-Zip/7z.exe"
+ ZIPARGS="a -tzip"
+ TARGET=release
+ ;;
+esac
+
+qmake VERSION=$VERSION CONFIG+=$CONFIG
+make -s clean
+if [[ $OS == WIN ]]; then
+ #if the following files are missing their tried removal stops the build process on msys
+ touch -t 200012121010 parser_yacc.h parser_yacc.cpp lexer_lex.cpp
+fi
+
+make -j2 $TARGET
+
+echo "Preparing executable..."
+
+echo "Creating directory structure..."
+rm -rf openscad-$VERSION
+rm -f openscad-$VERSION.zip
+mkdir -p openscad-$VERSION/examples
+cp examples/* openscad-$VERSION/examples/
+
+case $OS in
+ MACOSX)
+ mkdir OpenSCAD.app/Contents/Frameworks
+ cp $OPENCSGDIR/lib/libopencsg.dylib OpenSCAD.app/Contents/Frameworks
+ cp /opt/local/lib/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks
+ cp /Library/Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL OpenSCAD.app/Contents/Frameworks
+ cp /Library/Frameworks/QtGui.framework/Versions/4/QtGui OpenSCAD.app/Contents/Frameworks
+ cp /Library/Frameworks/QtCore.framework/Versions/4/QtCore OpenSCAD.app/Contents/Frameworks
+ install_name_tool -change libopencsg.1.dylib @executable_path/../Frameworks/libopencsg.dylib OpenSCAD.app/Contents/MacOS/openscad
+ install_name_tool -change QtOpenGL.framework/Versions/4/QtOpenGL @executable_path/../Frameworks/QtOpenGL OpenSCAD.app/Contents/MacOS/openscad
+ install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/MacOS/openscad
+ install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/MacOS/openscad
+ install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/QtOpenGL
+ install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtOpenGL
+ install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtGui
+ install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/MacOS/openscad
+ install_name_tool -id libopencsg.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
+ install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
+ install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
+ install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
+ install_name_tool -id libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libGLEW.1.5.1.dylib
+ ;;
+ WIN)
+ #package
+ cp win32deps/* openscad-$VERSION
+ cp $TARGET/openscad.exe openscad-$VERSION
+ ;;
+esac
+
+echo "Creating directory structure..."
+"$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
+
+rm -rf openscad-$VERSION
+
+echo "Binary created: openscad-$VERSION.zip"
contact: Jan Huwald // Impressum