From 6acf0b5019d8b68d81f6c1facd6f889c1f468b53 Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Sun, 16 Oct 2011 00:39:17 -0700 Subject: support mingw win32 builds diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 9261d7a..e12cd9d 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -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-.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 diff --git a/scripts/update-web.sh b/scripts/update-web.sh index 4180d01..9036d9b 100755 --- a/scripts/update-web.sh +++ b/scripts/update-web.sh @@ -1,13 +1,27 @@ #!/bin/bash -dmgfile=$1 -if [ -z "$dmgfile" ]; then - echo "Usage: $0 " +# 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 []" 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" -- cgit v0.10.1