summaryrefslogtreecommitdiff
path: root/scripts/release-common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/release-common.sh')
-rwxr-xr-xscripts/release-common.sh86
1 files changed, 53 insertions, 33 deletions
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 10a1c18..7d36907 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -7,11 +7,12 @@
# The script will create a file called openscad-<versionstring>.<extension> in
# the current directory (or under ./mingw32)
#
-# Usage: release-common.sh [-v <versionstring>] [-c] [-x32]
+# Usage: release-common.sh [-v <versionstring>] [-c] [-mingw[32|64]]
# -v Version string (e.g. -v 2010.01)
# -d Version date (e.g. -d 2010.01.23)
# -c Build with commit info
# -mingw32 Cross-compile for win32 using MXE
+# -mingw64 Cross-compile for win64 using Tony Theodore's MXE fork
#
# If no version string or version date is given, todays date will be used (YYYY-MM-DD)
# If only verion date is given, it will be used also as version string.
@@ -20,7 +21,7 @@
# The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT
# to identify a build in the about box.
#
-# The mingw32 cross compile depends on the MXE cross-build tools. Please
+# The mingw cross compile depends on the MXE cross-build tools. Please
# see the README.md file on how to install these dependencies.
printUsage()
@@ -47,11 +48,19 @@ elif [[ $OSTYPE == "linux-gnu" ]]; then
else
ARCH=32
fi
- echo "Detected ARCH: $ARCH"
+ echo "Detected build-machine ARCH: $ARCH"
fi
if [ "`echo $* | grep mingw32`" ]; then
OS=LINXWIN
+ ARCH=32
+ echo Mingw-cross build using ARCH=32
+fi
+
+if [ "`echo $* | grep mingw64`" ]; then
+ OS=LINXWIN
+ ARCH=64
+ echo Mingw-cross build using ARCH=64
fi
if [ $OS ]; then
@@ -83,7 +92,6 @@ echo "Checking pre-requisites..."
case $OS in
LINXWIN)
MAKENSIS=
-
if [ "`command -v makensis`" ]; then
MAKENSIS=makensis
elif [ "`command -v i686-pc-mingw32-makensis`" ]; then
@@ -110,6 +118,13 @@ fi
echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..."
+if [ ! $NUMCPU ]; then
+ echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)";
+ NUMCPU=2
+else
+ echo "NUMCPU: " $NUMCPU
+fi
+
CONFIG=deploy
case $OS in
LINUX|MACOSX)
@@ -124,17 +139,17 @@ case $OS in
TARGET=release
;;
LINXWIN)
- . ./scripts/setenv-mingw-xbuild.sh
+ . ./scripts/setenv-mingw-xbuild.sh $ARCH
TARGET=release
ZIP="zip"
- ZIPARGS="-r"
+ ZIPARGS="-r -q"
;;
esac
case $OS in
LINXWIN)
- cd $DEPLOYDIR && i686-pc-mingw32-qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
+ cd $DEPLOYDIR && qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
cd $OPENSCADDIR
;;
*)
@@ -144,7 +159,8 @@ esac
case $OS in
LINXWIN)
- cd $DEPLOYDIR && make -s clean
+ cd $DEPLOYDIR
+ make clean ## comment out for test-run
cd $OPENSCADDIR
;;
*)
@@ -162,21 +178,22 @@ case $OS in
;;
esac
-if [ ! $NUMCPU ]; then
- echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)";
- NUMCPU=2
-fi
-
case $OS in
LINXWIN)
- # dont use paralell builds, it can error-out on parser_yacc.
-
# make main openscad.exe
- cd $DEPLOYDIR && make $TARGET
-
+ cd $DEPLOYDIR
+ make $TARGET -j$NUMCPU ## comment 4 test
+ if [ ! -e $TARGET/openscad.exe ]; then
+ echo "cant find $TARGET/openscad.exe. build failed. stopping."
+ exit
+ fi
# make console pipe-able openscad.com - see winconsole.pri for info
- i686-pc-mingw32-qmake CONFIG+=winconsole ../openscad.pro
+ qmake CONFIG+=winconsole ../openscad.pro
make
+ if [ ! -e $TARGET/openscad.com ]; then
+ echo "cant find $TARGET/openscad.com. build failed. stopping."
+ exit
+ fi
cd $OPENSCADDIR
;;
@@ -245,36 +262,40 @@ case $OS in
cp win32deps/* openscad-$VERSION
cp $TARGET/openscad.exe openscad-$VERSION
cp $TARGET/openscad.com openscad-$VERSION
- rm -f openscad-$VERSION.zip
- "$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
+ rm -f openscad-$VERSION.x86-$ARCH.zip
+ "$ZIP" $ZIPARGS openscad-$VERSION.x86-$ARCH.zip openscad-$VERSION
rm -rf openscad-$VERSION
echo "Binary created: openscad-$VERSION.zip"
;;
LINXWIN)
+ BINFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH.zip
+ INSTFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH-Installer.exe
+
#package
- echo "Creating binary package"
+ echo "Creating binary zip package"
cd $DEPLOYDIR
cp $TARGET/openscad.exe openscad-$VERSION
cp $TARGET/openscad.com openscad-$VERSION
- rm -f OpenSCAD-$VERSION.zip
- "$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION
+ rm -f OpenSCAD-$VERSION.x86-$ARCH.zip
+ "$ZIP" $ZIPARGS $BINFILE openscad-$VERSION
cd $OPENSCADDIR
- echo "Binary package created"
+ echo "Binary zip package created"
echo "Creating installer"
echo "Copying NSIS files to $DEPLOYDIR/openscad-$VERSION"
- cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION
- cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION
+ cp ./scripts/installer$ARCH.nsi $DEPLOYDIR/openscad-$VERSION/installer_arch.nsi
+ cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION/
+ cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION/
+ cp ./scripts/x64.nsh $DEPLOYDIR/openscad-$VERSION/
+ cp ./scripts/LogicLib.nsh $DEPLOYDIR/openscad-$VERSION/
cd $DEPLOYDIR/openscad-$VERSION
NSISDEBUG=-V2
# NSISDEBUG= # leave blank for full log
echo $MAKENSIS $NSISDEBUG installer.nsi
$MAKENSIS $NSISDEBUG installer.nsi
- cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
+ cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $INSTFILE
cd $OPENSCADDIR
- BINFILE=$DEPLOYDIR/OpenSCAD-$VERSION.zip
- INSTFILE=$DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
if [ -e $BINFILE ]; then
if [ -e $INSTFILE ]; then
echo
@@ -282,12 +303,11 @@ case $OS in
echo "Installer created:" $INSTFILE
echo
else
- echo "Build failed. Cannot find" $INSTFILE
- exit 1
+ echo "Build failed. Cannot find" $INSTFILE
fi
else
- echo "Build failed. Cannot find" $BINFILE
- exit 1
+ echo "Build failed. Cannot find" $BINFILE
+ exit 1
fi
;;
LINUX)
contact: Jan Huwald // Impressum