summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2012-08-05 00:47:36 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2012-08-05 00:47:36 (GMT)
commit58db7a9d19f707c72a3f16bdf6275c0e4671f362 (patch)
treea6721c7c719daf6a756936bb5d8c30a3a6e91a69
parent06d48a47f8a2e7899b4edb3fae75a34479453e19 (diff)
move functionality from build-installer script to release-common.
mostly this means 1. detect NSIS and fail with error message if its not there 2. remove mingw-build-installer and mingw-build-openscad as they are nowredundant. running publish-mingw-x does exactly the same thing, only better because it builds from a clean source tree.
-rwxr-xr-xscripts/mingw-x-build-installer.sh97
-rwxr-xr-xscripts/mingw-x-build-openscad.sh45
-rwxr-xr-xscripts/release-common.sh51
-rw-r--r--scripts/setenv-mingw-xbuild.sh10
4 files changed, 48 insertions, 155 deletions
diff --git a/scripts/mingw-x-build-installer.sh b/scripts/mingw-x-build-installer.sh
deleted file mode 100755
index e740182..0000000
--- a/scripts/mingw-x-build-installer.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh -e
-#
-# This script builds a binary install package of OpenSCAD for Windows
-# using a cross-built mingw OpenSCAD and the NSIS installer system
-#
-# This script must be run from the OpenSCAD source root directory
-#
-# Usage: ./scripts/mingw-x-build-installer.sh
-#
-# Result: binary installer in $DEPLOYDIR directory
-#
-#
-# Prerequisites:
-#
-# source ./scripts/setenv-mingw-xbuild.sh
-# ./scripts/mingw-x-build-dependencues.sh
-#
-# and then build openscad before running this script.
-#
-# You need MCAD. run 'git submodule init && git submodule update'
-#
-# You need the Nullsoft installer system, on ubuntu 'sudo apt-get install nsis'
-#
-# Also see http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Cross-compiling_for_Windows_on_Linux_or_Mac_OS_X
-#
-
-OPENSCADDIR=$PWD
-if [ ! -f $OPENSCADDIR/openscad.pro ]; then
- echo "Must be run from the OpenSCAD source root directory"
- exit 1
-fi
-
-. ./scripts/setenv-mingw-xbuild.sh
-
-if [ ! -e $OPENSCADDIR/libraries/MCAD/__init__.py ]; then
- echo "Downloading MCAD"
- git submodule init
- git submodule update
-fi
-
-if [ ! -e $DEPLOYDIR ]; then
- echo $DEPLOYDIR "empty. Please build OpenSCAD for mingw32 first."
- exit 1
-fi
-
-OPENSCAD_EXE=$DEPLOYDIR/release/openscad.exe
-
-if [ ! -e $OPESCAD_EXE ]; then
- echo "Can't find" $OPENSCAD_EXE "Please build OpenSCAD for mingw32 first."
- exit 1
-fi
-
-MAKENSIS=
-
-if [ ! "`command -v makensis`" ]; then
- MAKENSIS=makensis
-fi
-
-if [ ! "`command -v i686-pc-mingw32-makensis`" ]; then
- MAKENSIS=i686-pc-mingw32-makensis
-fi
-
-if [ ! $MAKENSIS ]; then
- echo "makensis not found. please install nsis"
- exit 1
-fi
-
-
-echo "Copying files to" $DEPLOYDIR
-
-copy_files()
-{
- echo "copying" $1
- cp -a $1 $2
-}
-
-copy_files $OPENSCADDIR/libraries $DEPLOYDIR
-copy_files $OPENSCADDIR/examples $DEPLOYDIR
-copy_files $OPENSCADDIR/scripts/installer.nsi $DEPLOYDIR
-copy_files $OPENSCADDIR/scripts/mingw-file-association.nsh $DEPLOYDIR
-
-echo "running makensis in" $DEPLOYDIR
-
-cd $DEPLOYDIR && makensis -V2 installer.nsi
-# cd $DEPLOYDIR && makensis installer.nsi # debug nsis
-
-cd $OPENSCADDIR
-
-INSTALLFILE=$DEPLOYDIR/openscad_setup.exe
-
-if [ -e $INSTALLFILE ]; then
- echo "Build complete. Install file ready:"
- echo " " $INSTALLFILE
-else
- echo "Build failed. Sorry."
-fi
-
diff --git a/scripts/mingw-x-build-openscad.sh b/scripts/mingw-x-build-openscad.sh
deleted file mode 100755
index d0d5b9c..0000000
--- a/scripts/mingw-x-build-openscad.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh -e
-#
-# This script builds Openscad.exe for windows using the MXE cross build system.
-#
-# This script must be run from the OpenSCAD source root directory
-#
-# You must have already run the mingw-x-build-dependencies.sh script
-#
-# Usage:
-#
-# ./scripts/mingw-x-build-openscad.sh
-#
-
-OPENSCADDIR=$PWD
-if [ ! -f $OPENSCADDIR/openscad.pro ]; then
- echo "Must be run from the OpenSCAD source root directory"
- exit 0
-fi
-echo OPENSCADDIR: $OPENSCADDIR
-
-. ./scripts/setenv-mingw-xbuild.sh
-
-if [ ! -e $BASEDIR/lib ]; then
- echo "please run the mingw-x-build-dependencies.sh script first"
-fi
-
-echo "entering $DEPLOYDIR"
-cd $DEPLOYDIR
-i686-pc-mingw32-qmake CONFIG+=mingw-cross-env ../openscad.pro
-#"make -j$NUMCPU" # causes parser_yacc.hpp errors
-make
-echo "leaving $DEPLOYDIR"
-
-echo "entering $OPENSCADDIR"
-cd $OPENSCADDIR
-
-OPENSCAD_EXE=$DEPLOYDIR/release/openscad.exe
-
-if [ -e $OPENSCAD_EXE ] ; then
- echo Build finished. Executable file ready:
- echo " " $OPENSCAD_EXE
-else
- echo Cannot find $OPENSCAD_EXE. The build appears to have had an error.
-fi
-
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index dfd057a..dfebe13 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -60,6 +60,31 @@ if test -z "$VERSION"; then
VERSION=`date "+%Y.%m.%d"`
fi
+
+echo "Checking pre-requisitie..."
+
+case $OS in
+ LINXWIN)
+ MAKENSIS=
+
+ if [ ! "`command -v makensis`" ]; then
+ MAKENSIS=makensis
+ elif [ ! "`command -v i686-pc-mingw32-makensis`" ]; then
+ MAKENSIS=i686-pc-mingw32-makensis
+ else
+ echo "makensis not found. please install nsis"
+ exit 1
+ fi
+ ;;
+esac
+
+if [ ! -e $OPENSCADDIR/libraries/MCAD/__init__.py ]; then
+ echo "Downloading MCAD"
+ git submodule init
+ git submodule update
+fi
+
+
echo "Building openscad-$VERSION $CONFIGURATION..."
case $OS in
@@ -134,12 +159,6 @@ fi
echo "Creating directory structure..."
-if [ ! -e $OPENSCADDIR/libraries/MCAD/__init__.py ]; then
- echo "Downloading MCAD"
- git submodule init
- git submodule update
-fi
-
case $OS in
MACOSX)
EXAMPLESDIR=OpenSCAD.app/Contents/Resources/examples
@@ -168,8 +187,12 @@ fi
if [ -n $LIBRARYDIR ]; then
echo $LIBRARYDIR
mkdir -p $LIBRARYDIR
- tar cf libraries.tar --exclude=.git*
- cd $LIBRARYDIR && tar xf $OPENSCADDIR/libraries.tar && cd $OPENSCADDIR
+ # exclude the .git stuff from MCAD which is a git submodule.
+ # tar is a relatively portable way to do exclusion
+ rm libraries.tar
+ tar cf libraries.tar --exclude=.git* libraries
+ cd $LIBRARYDIR/.. && tar xf $OPENSCADDIR/libraries.tar && cd $OPENSCADDIR
+ rm libraries.tar
chmod -R u=rwx,go=r,+X $LIBRARYDIR/*
fi
@@ -198,13 +221,19 @@ case $OS in
cp $TARGET/openscad.exe openscad-$VERSION
rm -f OpenSCAD-$VERSION.zip
"$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION
- rm -rf ./openscad-$VERSION
cd $OPENSCADDIR
echo "Binary package created"
echo "Creating installer"
- ./scripts/mingw-x-build-installer.sh
- cp $DEPLOYDIR/openscad_setup.exe $DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
+ cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION
+ cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION
+ cd $DEPLOYDIR/openscad-$VERSION
+ NSISDEBUG=-V2
+ # NSISDEBUG= # leave blank for full log
+ $MAKENSIS $NSISDEBUG installer.nsi
+ cd $OPENSCADDIR
+ cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
+
echo
echo "Binary created: $DEPLOYDIR/OpenSCAD-$VERSION.zip"
echo "Installer created: $DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe"
diff --git a/scripts/setenv-mingw-xbuild.sh b/scripts/setenv-mingw-xbuild.sh
index a650f50..e8976b7 100644
--- a/scripts/setenv-mingw-xbuild.sh
+++ b/scripts/setenv-mingw-xbuild.sh
@@ -11,14 +11,20 @@
# Also see http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Cross-compiling_for_Windows_on_Linux_or_Mac_OS_X
#
+export OPENSCADDIR=$PWD
+
if [ ! $BASEDIR ]; then
export BASEDIR=$HOME/openscad_deps
fi
-export OPENSCADDIR=$PWD
-export DEPLOYDIR=$OPENSCADDIR/mingw32
+
+if [ ! $DEPLOYDIR ]; then
+ export DEPLOYDIR=$OPENSCADDIR/mingw32
+fi
+
if [ ! $MXEDIR ]; then
export MXEDIR=$BASEDIR/mxe
fi
+
export PATH=$MXEDIR/usr/bin:$PATH
echo BASEDIR: $BASEDIR
contact: Jan Huwald // Impressum