summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/builder.sh50
-rwxr-xr-xscripts/mingw-x-build-dependencies.sh14
-rwxr-xr-xscripts/release-common.sh14
-rw-r--r--scripts/setenv-mingw-xbuild.sh72
4 files changed, 112 insertions, 38 deletions
diff --git a/scripts/builder.sh b/scripts/builder.sh
index 75b80f8..e8876e8 100755
--- a/scripts/builder.sh
+++ b/scripts/builder.sh
@@ -6,10 +6,6 @@
# requirements -
# see http://mxe.cc for required tools (scons, perl, yasm, etc etc etc)
-# todo - auto update webpage to link to proper snapshot
-#
-# todo - 64 bit windows (needs mxe 64 bit stable)
-#
# todo - can we build 32 bit linux from within 64 bit linux?
#
# todo - make linux work
@@ -36,14 +32,23 @@ get_source_code()
build_win32()
{
+ . ./scripts/setenv-mingw-xbuild.sh clean
. ./scripts/setenv-mingw-xbuild.sh
./scripts/mingw-x-build-dependencies.sh
./scripts/release-common.sh mingw32
}
+build_win64()
+{
+ . ./scripts/setenv-mingw-xbuild.sh clean
+ . ./scripts/setenv-mingw-xbuild.sh 64
+ ./scripts/mingw-x-build-dependencies.sh 64
+ ./scripts/release-common.sh mingw64
+}
+
build_lin32()
{
- . ./scripts/setenv-unibuild.sh clang
+ . ./scripts/setenv-unibuild.sh
./scripts/uni-build-dependencies.sh
./scripts/release-common.sh
}
@@ -87,6 +92,26 @@ upload_win32()
export WIN32_PACKAGEFILE2_SIZE
}
+upload_win64()
+{
+ SUMMARY1="Windows x86-64 Snapshot Zipfile"
+ SUMMARY2="Windows x86-64 Snapshot Installer"
+ DATECODE=`date +"%Y.%m.%d"`
+ BASEDIR=./mingw64/
+ WIN64_PACKAGEFILE1=OpenSCAD-$DATECODE-x86-64.zip
+ WIN64_PACKAGEFILE2=OpenSCAD-$DATECODE-x86-64-Installer.exe
+ upload_win_generic "$SUMMARY1" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE1
+ upload_win_generic "$SUMMARY2" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE2
+ export WIN64_PACKAGEFILE1
+ export WIN64_PACKAGEFILE2
+ WIN64_PACKAGEFILE1_SIZE=`ls -sh $BASEDIR/$WIN64_PACKAGEFILE1 | awk ' {print $1} ';`
+ WIN64_PACKAGEFILE2_SIZE=`ls -sh $BASEDIR/$WIN64_PACKAGEFILE2 | awk ' {print $1} ';`
+ WIN64_PACKAGEFILE1_SIZE=`echo "$WIN64_PACKAGEFILE1_SIZE""B"`
+ WIN64_PACKAGEFILE2_SIZE=`echo "$WIN64_PACKAGEFILE2_SIZE""B"`
+ export WIN64_PACKAGEFILE1_SIZE
+ export WIN64_PACKAGEFILE2_SIZE
+}
+
read_username_from_user()
{
echo 'Please enter your username for https://code.google.com/hosting/settings'
@@ -112,7 +137,7 @@ read_password_from_user()
export OSUPL_PASSWORD
}
-update_www_download_links()
+update_win_www_download_links()
{
cd $STARTPATH
git clone git@github.com:openscad/openscad.github.com.git
@@ -123,6 +148,13 @@ update_www_download_links()
DATECODE=`date +"%Y.%m.%d"`
rm win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT1_URL'] = '$BASEURL$WIN64_PACKAGEFILE1'" >> win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT2_URL'] = '$BASEURL$WIN64_PACKAGEFILE2'" >> win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT1_NAME'] = 'OpenSCAD $DATECODE'" >> win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT2_NAME'] = 'OpenSCAD $DATECODE'" >> win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT1_SIZE'] = '$WIN64_PACKAGEFILE1_SIZE'" >> win_snapshot_links.js
+ echo "snapinfo['WIN64_SNAPSHOT2_SIZE'] = '$WIN64_PACKAGEFILE2_SIZE'" >> win_snapshot_links.js
+
echo "snapinfo['WIN32_SNAPSHOT1_URL'] = '$BASEURL$WIN32_PACKAGEFILE1'" >> win_snapshot_links.js
echo "snapinfo['WIN32_SNAPSHOT2_URL'] = '$BASEURL$WIN32_PACKAGEFILE2'" >> win_snapshot_links.js
echo "snapinfo['WIN32_SNAPSHOT1_NAME'] = 'OpenSCAD $DATECODE'" >> win_snapshot_links.js
@@ -130,7 +162,6 @@ update_www_download_links()
echo "snapinfo['WIN32_SNAPSHOT1_SIZE'] = '$WIN32_PACKAGEFILE1_SIZE'" >> win_snapshot_links.js
echo "snapinfo['WIN32_SNAPSHOT2_SIZE'] = '$WIN32_PACKAGEFILE2_SIZE'" >> win_snapshot_links.js
echo 'modified win_snapshot_links.js'
- cat win_snapshot_links.js
PAGER=cat git diff
if [ ! $DRYRUN ]; then
@@ -157,9 +188,12 @@ check_starting_path
read_username_from_user
read_password_from_user
get_source_code
+
build_win32
+build_win64
upload_win32
-update_www_download_links
+upload_win64
+update_win_www_download_links
diff --git a/scripts/mingw-x-build-dependencies.sh b/scripts/mingw-x-build-dependencies.sh
index 03adc22..168b847 100755
--- a/scripts/mingw-x-build-dependencies.sh
+++ b/scripts/mingw-x-build-dependencies.sh
@@ -48,7 +48,7 @@ if [ ! -e $MXEDIR ]; then
mkdir -p $MXEDIR
cd $MXEDIR/..
echo "Downloading MXE into " $PWD
- if [ `echo $* | grep 64` ]; then
+ if [ "`echo $* | grep 64`" ]; then
git clone -b multi-rebase git://github.com/tonytheodore/mxe.git ./mxe-w64
else
git clone git://github.com/mxe/mxe.git
@@ -57,9 +57,15 @@ fi
echo "entering" $MXEDIR
cd $MXEDIR
-echo "make mpfr eigen opencsg cgal qt nsis -j $NUMCPU JOBS=$NUMJOBS"
-make mpfr eigen opencsg cgal qt nsis -j $NUMCPU JOBS=$NUMJOBS
-#make mpfr -j $NUMCPU JOBS=$NUMJOBS # for testing
+if [ "`echo $* | grep 64`" ]; then
+ MXE_TARGETS='x86_64-w64-mingw32'
+ PACKAGES='mpfr eigen opencsg cgal qt'
+else
+ MXE_TARGETS=
+ PACKAGES='mpfr eigen opencsg cgal qt nsis'
+fi
+echo make $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS
+make $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS
echo "leaving" $MXEDIR
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 035fa3f..85b719c 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -116,6 +116,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)
@@ -169,17 +176,12 @@ 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)
# make || make enables paralell builds, thanks Tony Theodore
# make main openscad.exe
cd $DEPLOYDIR
- make $TARGET -j$NUMCPU || make $TARGET -j $NUMCPU ## comment 4 test
+ make $TARGET -j$NUMCPU || make $TARGET -j$NUMCPU ## comment 4 test
if [ ! -e $TARGET/openscad.exe ]; then
echo "cant find $TARGET/openscad.exe. build failed. stopping."
exit
diff --git a/scripts/setenv-mingw-xbuild.sh b/scripts/setenv-mingw-xbuild.sh
index b6fa156..15449ce 100644
--- a/scripts/setenv-mingw-xbuild.sh
+++ b/scripts/setenv-mingw-xbuild.sh
@@ -14,50 +14,82 @@
# Also see http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Cross-compiling_for_Windows_on_Linux_or_Mac_OS_X
#
-export OPENSCADDIR=$PWD
+OPENSCADDIR=$PWD
if [ ! $BASEDIR ]; then
- export BASEDIR=$HOME/openscad_deps
+ BASEDIR=$HOME/openscad_deps
fi
+DEPLOYDIR64=$OPENSCADDIR/mingw64
+DEPLOYDIR32=$OPENSCADDIR/mingw32
+
if [ ! $DEPLOYDIR ]; then
- if [ `echo $* | grep 64 ` ]; then
- DEPLOYDIR=$OPENSCADDIR/mingw64
+ if [ "`echo $* | grep 64 `" ]; then
+ DEPLOYDIR=$DEPLOYDIR64
else
- DEPLOYDIR=$OPENSCADDIR/mingw32
+ DEPLOYDIR=$DEPLOYDIR32
fi
- export DEPLOYDIR
fi
if [ ! $MXEDIR ]; then
- if [ `echo $* | grep 64 ` ]; then
- export MXEDIR=$BASEDIR/mxe-w64
+ if [ "`echo $* | grep 64 `" ]; then
+ MXEDIR=$BASEDIR/mxe-w64
else
- export MXEDIR=$BASEDIR/mxe
+ MXEDIR=$BASEDIR/mxe
fi
fi
-export PATH=$MXEDIR/usr/bin:$PATH
-
if [ ! -e $DEPLOYDIR ]; then
mkdir -p $DEPLOYDIR
fi
-if [ `echo $* | grep 64 ` ]; then
+if [ "`echo $* | grep 64 `" ]; then
MXETARGETDIR=$MXEDIR/usr/x86_64-w64-mingw32
else
MXETARGETDIR=$MXEDIR/usr/i686-pc-mingw32
fi
-echo linking $MXETARGETDIR to $DEPLOYDIR/mingw-cross-env
-rm -f $DEPLOYDIR/mingw-cross-env
-ln -s $MXETARGETDIR $DEPLOYDIR/mingw-cross-env
-export PATH=$MXETARGETDIR/qt/bin:$PATH
+
+if [ ! $MINGWX_SAVED_ORIGINAL_PATH ]; then
+ MINGWX_SAVED_ORIGINAL_PATH=$PATH
+ echo current path saved
+fi
+
+PATH=$MXEDIR/usr/bin:$PATH
+PATH=$MXETARGETDIR/qt/bin:$PATH
+
+
+
+
+
+if [ "`echo $* | grep clean`" ]; then
+ BASEDIR=
+ MXEDIR=
+ MXETARGETDIR=
+ DEPLOYDIR=
+ PATH=$MINGWX_SAVED_ORIGINAL_PATH
+ MINGWX_SAVED_ORIGINAL_PATH=
+else
+ echo 'linking' $MXETARGETDIR
+ echo ' to' $DEPLOYDIR/mingw-cross-env
+ rm -f $DEPLOYDIR/mingw-cross-env
+ ln -s $MXETARGETDIR $DEPLOYDIR/mingw-cross-env
+fi
+
+export BASEDIR
+export MXEDIR
+export MXETARGETDIR
+export DEPLOYDIR
+export PATH
+export MINGWX_SAVED_ORIGINAL_PATH
echo BASEDIR: $BASEDIR
echo MXEDIR: $MXEDIR
+echo MXETARGETDIR: $MXETARGETDIR
echo DEPLOYDIR: $DEPLOYDIR
-echo PATH modified: $MXEDIR/usr/bin
-echo PATH modified: $MXETARGETDIR/qt/bin
-
-
+if [ "`echo $* | grep clean`" ]; then
+ echo PATH restored to pre-setenv-mingw-x state
+else
+ echo PATH modified: $MXEDIR/usr/bin
+ echo PATH modified: $MXETARGETDIR/qt/bin
+fi
contact: Jan Huwald // Impressum