summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-11-30 19:42:09 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-11-30 19:42:09 (GMT)
commit6f6a8dff7669322a35ddc33ad195f2cb3de45de8 (patch)
treece810b301fefff5e4fcdaa4187f12621a6d1984e /scripts
parentb204aba444bd838bd3fe27675323dce6d4123b19 (diff)
MXE c/o 'stable' instd of 'master' from github b/c master has gcc 4.8.2 which
is causing crashes. also allow 'build only' builder.sh script command
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/builder.sh90
-rwxr-xr-xscripts/mingw-x-build-dependencies.sh21
2 files changed, 84 insertions, 27 deletions
diff --git a/scripts/builder.sh b/scripts/builder.sh
index 552d559..ca7e5b2 100755
--- a/scripts/builder.sh
+++ b/scripts/builder.sh
@@ -1,11 +1,41 @@
#!/usr/bin/env bash
# build&upload script for linux & windows snapshot binaries
-# tested under linux
+#
+# Usage:
+#
+# Start with a clean directory. For example:
+#
+# mkdir builder
+# cd builder
+#
+# Then run this script, or optionally the 'build only' or 'upload only' version
+#
+# /some/path/openscad/builder.sh # standard build & upload
+# /some/path/openscad/builder.sh buildonly # only do build, dont upload
+# /some/path/openscad/builder.sh uploadonly # only upload, dont build
+# Notes:
+#
+# This script is designed to build a 'clean' version of openscad directly
+# from the openscad github master source code. It will then optionally
+# upload the build to the OpenSCAD official file repository, and modify
+# the OpenSCAD website with links to the most recently built files.
+#
+#
+# For the mingw- cross build for Windows(TM) this script does a massive
+# 'from nothing' build, including downloading and building an MXE cross
+# environment, and dependencies, into $HOME/openscad_deps. This can take
+# many many many hours and use several gigabytes of disk space.
+#
+# This script itself is designed to call other scripts that do the heavy
+# lifting. This script itself should be kept relatively simple.
+#
+
+#
# requirements -
# see http://mxe.cc for required tools (scons, perl, yasm, etc etc etc)
-
+#
# todo - can we build 32 bit linux from within 64 bit linux?
#
# todo - make linux work
@@ -19,18 +49,24 @@ init_variables()
{
STARTPATH=$PWD
export STARTPATH
+ DOBUILD=1
+ DOUPLOAD=1
+ DRYRUN=
if [ "`echo $* | grep uploadonly`" ]; then
- UPLOADONLY=1
+ DOUPLOAD=1
+ DOBUILD=
+ DATECODE=`date +"%Y.%m.%d"`
+ fi
+ if [ "`echo $* | grep buildonly`" ]; then
+ DOUPLOAD=
+ DOBUILD=1
DATECODE=`date +"%Y.%m.%d"`
- else
- UPLOADONLY=
fi
if [ "`echo $* | grep dry`" ]; then
DRYRUN=1
- else
- DRYRUN=
fi
- export UPLOADONLY
+ export DOBUILD
+ export DOUPLOAD
export DRYRUN
export DATECODE
}
@@ -43,9 +79,15 @@ check_starting_path()
fi
}
-get_source_code()
+get_openscad_source_code()
{
git clone http://github.com/openscad/openscad.git
+ if [ "`echo $? | grep 0`" ]; then
+ echo clone of source code is ok
+ else
+ echo clone of openscad source code failed. exiting
+ exit 1
+ fi
cd openscad
git submodule update --init # MCAD
#git checkout branch ##debugging
@@ -80,7 +122,7 @@ build_lin32()
export DATECODE
}
-upload_win_generic()
+upload_win_common()
{
summary="$1"
username=$2
@@ -110,8 +152,8 @@ upload_win32()
BASEDIR=./mingw32/
WIN32_PACKAGEFILE1=OpenSCAD-$DATECODE-x86-32-Installer.exe
WIN32_PACKAGEFILE2=OpenSCAD-$DATECODE-x86-32.zip
- upload_win_generic "$SUMMARY1" $USERNAME $BASEDIR/$WIN32_PACKAGEFILE1
- upload_win_generic "$SUMMARY2" $USERNAME $BASEDIR/$WIN32_PACKAGEFILE2
+ upload_win_common "$SUMMARY1" $USERNAME $BASEDIR/$WIN32_PACKAGEFILE1
+ upload_win_common "$SUMMARY2" $USERNAME $BASEDIR/$WIN32_PACKAGEFILE2
export WIN32_PACKAGEFILE1
export WIN32_PACKAGEFILE2
WIN32_PACKAGEFILE1_SIZE=`ls -sh $BASEDIR/$WIN32_PACKAGEFILE1 | awk ' {print $1} ';`
@@ -129,8 +171,8 @@ upload_win64()
BASEDIR=./mingw64/
WIN64_PACKAGEFILE1=OpenSCAD-$DATECODE-x86-64-Installer.exe
WIN64_PACKAGEFILE2=OpenSCAD-$DATECODE-x86-64.zip
- upload_win_generic "$SUMMARY1" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE1
- upload_win_generic "$SUMMARY2" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE2
+ upload_win_common "$SUMMARY1" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE1
+ upload_win_common "$SUMMARY2" $USERNAME $BASEDIR/$WIN64_PACKAGEFILE2
export WIN64_PACKAGEFILE1
export WIN64_PACKAGEFILE2
WIN64_PACKAGEFILE1_SIZE=`ls -sh $BASEDIR/$WIN64_PACKAGEFILE1 | awk ' {print $1} ';`
@@ -188,6 +230,7 @@ update_win_www_download_links()
BASEURL='http://files.openscad.org/'
DATECODE=`date +"%Y.%m.%d"`
+ mv win_snapshot_links.js win_snapshot_links.js.backup
rm win_snapshot_links.js
echo "fileinfo['WIN64_SNAPSHOT1_URL'] = '$BASEURL$WIN64_PACKAGEFILE1'" >> win_snapshot_links.js
echo "fileinfo['WIN64_SNAPSHOT2_URL'] = '$BASEURL$WIN64_PACKAGEFILE2'" >> win_snapshot_links.js
@@ -229,19 +272,20 @@ check_ssh_agent()
}
init_variables $*
-check_ssh_agent
+if [ $DOUPLOAD ]; then
+ check_ssh_agent
+fi
check_starting_path
read_username_from_user
read_password_from_user
-get_source_code
-
-if [ ! $UPLOADONLY ]; then
+get_openscad_source_code
+if [ $DOBUILD ]; then
build_win32
build_win64
fi
-upload_win32
-upload_win64
-update_win_www_download_links
-
-
+if [ $DOUPLOAD ]; then
+ upload_win32
+ upload_win64
+ update_win_www_download_links
+fi
diff --git a/scripts/mingw-x-build-dependencies.sh b/scripts/mingw-x-build-dependencies.sh
index df8572f..c0f658d 100755
--- a/scripts/mingw-x-build-dependencies.sh
+++ b/scripts/mingw-x-build-dependencies.sh
@@ -6,8 +6,13 @@
# This script must be run from the OpenSCAD source root directory
#
# Usage:
-# ./scripts/mingw-x-build-dependencies.sh # 32 bit
-# ./scripts/mingw-x-build-dependencies.sh 64 # 64 bit
+# ./scripts/mingw-x-build-dependencies.sh # 32 bit
+# ./scripts/mingw-x-build-dependencies.sh 64 # 64 bit
+#
+# If you just want to download, and build later:
+#
+# ./scripts/mingw-x-build-dependencies.sh download # 32 bit download
+# ./scripts/mingw-x-build-dependencies.sh 64 download # 64 bit download
#
# Prerequisites:
#
@@ -54,11 +59,19 @@ fi
echo "entering" $MXEDIR
cd $MXEDIR
if [ "`echo $* | grep 64`" ]; then
- MXE_TARGETS='x86_64-w64-mingw32'
+ MXE_TARGETS='x86_64-w64-mingw32'
+ if [ "`echo $* | grep download`" ]; then
+ PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qt'
+ else
PACKAGES='mpfr eigen opencsg cgal qt'
+ fi
else
- MXE_TARGETS=
+ MXE_TARGETS='i686-pc-mingw32' # fixme - does this work? test it.
+ if [ "`echo $* | grep download`" ]; then
+ PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qt download-nsis'
+ else
PACKAGES='mpfr eigen opencsg cgal qt nsis'
+ fi
fi
echo make $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS
make $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS
contact: Jan Huwald // Impressum