summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/publish-macosx.sh12
-rwxr-xr-xscripts/release-common.sh129
-rwxr-xr-xscripts/release-linux.sh82
-rwxr-xr-xscripts/release-macosx.sh65
-rw-r--r--scripts/release-win32.sh96
5 files changed, 384 insertions, 0 deletions
diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh
new file mode 100755
index 0000000..b616d64
--- /dev/null
+++ b/scripts/publish-macosx.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+VERSION=`date "+%Y.%m.%d"`
+#VERSION=2010.02
+
+export OPENCSGDIR=$PWD/../OpenCSG-1.2.0
+
+./release-common.sh -v $VERSION
+cp OpenSCAD-$VERSION.dmg ~/Documents/Dropbox/Public
+ln -sf OpenSCAD-$VERSION.dmg ~/Documents/Dropbox/Public/OpenSCAD-latest.dmg
+
+echo "Upload in progress..."
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
new file mode 100755
index 0000000..9624035
--- /dev/null
+++ b/scripts/release-common.sh
@@ -0,0 +1,129 @@
+#!/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
+ 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 CONFIG-=debug openscad.pro
+make -s clean
+case $OS in
+ MACOSX)
+ rm -rf OpenSCAD.app
+ ;;
+ WIN)
+ #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
+ ;;
+esac
+
+make -j2 $TARGET
+
+echo "Creating directory structure..."
+rm -rf openscad-$VERSION
+mkdir openscad-$VERSION
+EXAMPLESDIR=openscad-$VERSION/examples/
+
+case $OS in
+ MACOSX)
+ OPENCSGDIR=`cd "$OPENCSGDIR" && pwd`
+ 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 $OPENCSGDIR/lib/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
+ mv OpenSCAD.app openscad-$VERSION
+ EXAMPLESDIR=openscad-$VERSION/OpenSCAD.app/Contents/Resources/examples
+ ;;
+ WIN)
+ #package
+ cp win32deps/* openscad-$VERSION
+ cp $TARGET/openscad.exe openscad-$VERSION
+ ;;
+esac
+
+mkdir -p $EXAMPLESDIR
+cp examples/* $EXAMPLESDIR
+chmod -R 644 $EXAMPLESDIR/*
+
+echo "Creating archive.."
+case $OS in
+ MACOSX)
+ hdiutil create -quiet -ov -srcfolder openscad-$VERSION/OpenSCAD.app OpenSCAD-$VERSION.dmg
+ hdiutil internet-enable -yes -quiet OpenSCAD-$VERSION.dmg
+ echo "Binary created: OpenSCAD-$VERSION.dmg"
+ ;;
+ *)
+ rm -f openscad-$VERSION.zip
+ "$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
+ echo "Binary created: openscad-$VERSION.zip"
+ ;;
+esac
+
+rm -rf openscad-$VERSION
+
diff --git a/scripts/release-linux.sh b/scripts/release-linux.sh
new file mode 100755
index 0000000..41a7aa3
--- /dev/null
+++ b/scripts/release-linux.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+# WARNING: This script might only work with the authors setup...
+
+VERSION=2010.01
+
+set -ex
+
+# svnclean
+
+qmake-qt4 VERSION=$VERSION
+make
+
+rm -rf release
+mkdir -p release/{bin,lib/openscad,examples}
+
+cat > release/bin/openscad << "EOT"
+#!/bin/bash
+
+cd "$( dirname "$( type -p $0 )" )"
+libdir=$PWD/../lib/openscad/
+cd "$OLDPWD"
+
+export LD_LIBRARY_PATH="$libdir${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+exec $libdir/openscad "$@"
+EOT
+
+cp openscad release/lib/openscad/
+gcc -o chrpath_linux chrpath_linux.c
+./chrpath_linux -d release/lib/openscad/openscad
+
+ldd openscad | sed -re 's,.* => ,,; s,[\t ].*,,;' -e '/Qt|boost/ { p; d; };' \
+ -e '/lib(audio|CGAL|GLEW|opencsg|png)\.so/ { p; d; };' \
+ -e 'd;' | xargs cp -vt release/lib/openscad/
+strip release/lib/openscad/*
+
+cat > release/install.sh << "EOT"
+#!/bin/bash
+
+# change to the install source directory
+cd "$( dirname "$( type -p $0 )" )"
+
+if ! [ -f bin/openscad -a -d lib/openscad -a -d examples ]; then
+ echo "Error: Can't change to install source directory!" >&2
+ exit 1
+fi
+
+echo "This will install openscad. Please enter the install prefix"
+echo "or press Ctrl-C to abort the install process:"
+read -p "[/usr/local]: " prefix
+
+if [ "$prefix" = "" ]; then
+ prefix="/usr/local"
+fi
+
+if [ ! -d "$prefix" ]; then
+ echo; echo "Install prefix \`$prefix' does not exist. Press ENTER to continue"
+ echo "or press Ctrl-C to abort the install process:"
+ read -p "press enter to continue> "
+fi
+
+mkdir -p "$prefix"/{bin,lib/openscad}
+
+if ! [ -w "$prefix"/bin/ -a -w "$prefix"/lib/ ]; then
+ echo "You does not seam to have write permissions for prefix \`$prefix'!" >&2
+ echo "Maybe you should have run this install script using \`sudo'?" >&2
+ exit 1
+fi
+
+echo "Copying application wrappers..."
+cp -rv bin/. "$prefix"/bin/
+
+echo "Copying application and libraries..."
+cp -rv lib/. "$prefix"/lib/
+
+echo "Installation finished. Have a nice day."
+EOT
+
+chmod 755 -R release/
+
+cp examples/* release/examples/
+chmod 644 -R release/examples/*
+
diff --git a/scripts/release-macosx.sh b/scripts/release-macosx.sh
new file mode 100755
index 0000000..8ac5dc0
--- /dev/null
+++ b/scripts/release-macosx.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# This script creates a binary release of OpenSCAD for Mac OS X.
+# The script will create a file called openscad-<versionstring>.zip
+# in the current directory.
+#
+# Usage: makedmg.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)
+#
+printUsage()
+{
+ echo "Usage: $0 -v <versionstring>"
+ echo
+ echo " Example: $0 -v 2010.01"
+}
+
+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..."
+export OPENCSGDIR=$PWD/../OpenCSG-1.2.0
+qmake VERSION=$VERSION CONFIG+=mdi openscad.pro
+make clean
+make -j2
+echo "Preparing executable.."
+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
+
+echo "Creating directory structure.."
+rm -rf openscad-$VERSION
+mkdir -p openscad-$VERSION/examples
+cp examples/* openscad-$VERSION/examples/
+chmod -R 644 openscad-$VERSION/examples/*
+mv OpenSCAD.app openscad-$VERSION
+
+echo "Creating archive.."
+zip -qr openscad-$VERSION.zip openscad-$VERSION
+echo "Mac OS X binary created: openscad-$VERSION.zip"
diff --git a/scripts/release-win32.sh b/scripts/release-win32.sh
new file mode 100644
index 0000000..540eab9
--- /dev/null
+++ b/scripts/release-win32.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# This script creates a binary release of OpenSCAD for Mac OS X.
+# The script will create a file called openscad-<versionstring>.zip
+# in the current directory.
+#
+# Usage: release-win32.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)
+#
+
+#used for windows
+ZIP="/c/Program Files/7-Zip/7z.exe"
+ZIPARGS="a -tzip"
+
+printUsage()
+{
+ echo "Usage: $0 -v <versionstring> -t <buildtarget>"
+ echo
+ echo " Example: $0 -v 2010.01 -t release"
+}
+
+OS=OSX
+if test "`uname -o`" == "Msys"; then
+ OS=WIN
+fi
+
+echo "detected OS= $OS"
+
+while getopts 'v:' c
+do
+ case $c in
+ v) VERSION=$OPTARG;;
+ b) TARGET=$OPTARG;;
+ esac
+done
+
+if test -z "$VERSION"; then
+ VERSION=`date "+%Y.%m.%d"`
+fi
+
+if test -z "$TARGET"; then
+ TARGET=release
+fi
+
+echo "Building openscad-$VERSION $CONFIGURATION..."
+
+case $OS in
+ OSX)
+ CONFIG = mdi;;
+ 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
+ ;;
+esac
+
+qmake VERSION=$VERSION CONFIG+=$CONFIG
+make clean
+if test $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
+ OSX) ;;
+ WIN)
+ #package
+ cp win32deps/* openscad-$VERSION
+ cp $TARGET/openscad.exe openscad-$VERSION
+ ;;
+esac
+
+echo "Creating directory structure..."
+case $OS in
+ OSX) ;;
+ WIN)
+ "$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
+ ;;
+esac
+
+rm -rf openscad-$VERSION
+
+echo "binary created: openscad-$VERSION.zip"
contact: Jan Huwald // Impressum