support mingw win32 builds

stl_dim
Brad Pitcher 2011-10-16 00:39:17 -07:00
parent 45060878b5
commit 6acf0b5019
2 changed files with 48 additions and 6 deletions

View File

@ -1,7 +1,9 @@
#!/bin/sh
#
# This script creates a binary release of OpenSCAD.
# This should work under Mac OS X and Windows (msys). Linux support pending.
# This should work under Mac OS X, Windows (msys), and Linux cross-compiling
# for windows using mingw-cross-env (use like: OS=LINXWIN release-common.sh).
# Linux support pending.
# The script will create a file called openscad-<versionstring>.zip
# in the current directory.
#
@ -54,9 +56,23 @@ case $OS in
ZIPARGS="a -tzip"
TARGET=release
;;
LINXWIN)
unset CONFIG
TARGET=release
ZIP="zip"
ZIPARGS="-r"
;;
esac
case $OS in
LINXWIN)
i686-pc-mingw32-qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug openscad.pro
;;
*)
qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro
;;
esac
qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro
make -s clean
case $OS in
MACOSX)
@ -122,4 +138,16 @@ case $OS in
rm -rf openscad-$VERSION
echo "Binary created: openscad-$VERSION.zip"
;;
LINXWIN)
#package
cp $TARGET/openscad.exe openscad-$VERSION
rm -f OpenSCAD-$VERSION.zip
"$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION
cp scripts/installer.nsi openscad-$VERSION/
cd openscad-$VERSION && makensis installer.nsi && cd ..
cp openscad-$VERSION/openscad_setup.exe OpenSCAD-$VERSION-Installer.exe
rm -rf openscad-$VERSION
echo "Binary created: OpenSCAD-$VERSION.zip"
echo "Installer created: OpenSCAD-$VERSION-Installer.exe"
;;
esac

View File

@ -1,13 +1,27 @@
#!/bin/bash
dmgfile=$1
if [ -z "$dmgfile" ]; then
echo "Usage: $0 <dmgfile>"
# Works with Mac OS X and Linux cross-compiling for windows using
# mingw-cross-env (use like: OS=LINXWIN update-web.sh file1.zip file2.exe).
file1=$1
if [ -z "$file1" ]; then
echo "Usage: $0 <file1> [<file2>]"
exit 1
fi
if [[ $OSTYPE =~ "darwin" ]]; then
OS=MACOSX
fi
indexfile=../openscad.github.com/index.html
if [ -f $indexfile ]; then
sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$dmgfile\\3$dmgfile\\5/" $indexfile
if [ $OS == MACOSX ]; then
sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
elif [ $OS == LINXWIN ]; then
file2=$2
sed -i .backup -e "s/^\(.*win-snapshot-zip.*\)\(OpenSCAD-.*\.zip\)\(.*\)\(OpenSCAD-.*zip\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
sed -i .backup -e "s/^\(.*win-snapshot-exe.*\)\(OpenSCAD-.*-Installer\.exe\)\(.*\)\(OpenSCAD-.*-Installer.exe\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile
fi
echo "Web page updated. Remember to commit and push openscad.github.com"
else
echo "Web page not found at $indexfile"