summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-05-13 16:52:07 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-13 16:52:07 (GMT)
commit7f1c6b57c6149da054be70fca2a1526114e5c5a1 (patch)
treeb60d40d61dc398f512a0321aee82fd42b739ceee
parent8c532d525203d6cd0fc8ab200a4dea1dccd03dd6 (diff)
parent0cc3bb3890fc144143bd3c11d605ca64f3c29266 (diff)
Merge pull request #361 from openscad/builder
Builder
-rw-r--r--README.md2
-rwxr-xr-xscripts/builder.sh105
-rwxr-xr-xscripts/googlecode_upload.py16
-rwxr-xr-xscripts/mingw-x-build-dependencies.sh2
-rwxr-xr-xscripts/release-common.sh34
-rw-r--r--scripts/setenv-mingw-xbuild.sh13
6 files changed, 148 insertions, 24 deletions
diff --git a/README.md b/README.md
index 0f4d8d7..5bbe8b6 100644
--- a/README.md
+++ b/README.md
@@ -206,7 +206,7 @@ complete, build OpenSCAD and package it to an installer:
If you wish you can only build the openscad.exe binary:
cd mingw32
- i686-pc-mingw32-qmake .. CONFIG+=mingw-cross-env
+ qmake .. CONFIG+=mingw-cross-env
make
### Compilation
diff --git a/scripts/builder.sh b/scripts/builder.sh
new file mode 100755
index 0000000..c2f81e8
--- /dev/null
+++ b/scripts/builder.sh
@@ -0,0 +1,105 @@
+#!/usr/bin/env bash
+
+# build&upload script for linux & windows snapshot binaries
+# tested under linux
+
+# 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
+
+check_starting_path()
+{
+ if [ -e openscad.pro ]; then
+ echo 'please start from a clean directory outside of openscad'
+ exit
+ fi
+}
+
+get_source_code()
+{
+ git clone http://github.com/openscad/openscad.git
+ cd openscad
+ git submodule update --init # MCAD
+}
+
+build_win32()
+{
+ . ./scripts/setenv-mingw-xbuild.sh
+ ./scripts/mingw-x-build-dependencies.sh
+ ./scripts/release-common.sh mingw32
+}
+
+build_lin32()
+{
+ . ./scripts/setenv-unibuild.sh clang
+ ./scripts/uni-build-dependencies.sh
+ ./scripts/release-common.sh
+}
+
+upload_win_generic()
+{
+ if [ -e $3 ]; then
+ echo $3 found
+ else
+ echo $3 not found
+ fi
+ opts=
+ opts="$opts -p openscad"
+ opts="$opts -u $2"
+ opts="$opts $3"
+ echo python ./scripts/googlecode_upload.py -s "$1" $opts
+ python ./scripts/googlecode_upload.py -s "$1" $opts
+}
+
+upload_win32()
+{
+ SUMMARY1="Windows x86-32 Snapshot Zipfile"
+ SUMMARY2="Windows x86-32 Snapshot Installer"
+ DATECODE=`date +"%Y.%m.%d"`
+ PACKAGEFILE1=./mingw32/OpenSCAD-$DATECODE-x86-32.zip
+ PACKAGEFILE2=./mingw32/OpenSCAD-$DATECODE-x86-32-Installer.exe
+ upload_win_generic "$SUMMARY1" $USERNAME $PACKAGEFILE1
+ upload_win_generic "$SUMMARY2" $USERNAME $PACKAGEFILE2
+}
+
+read_username_from_user()
+{
+ echo 'Please enter your username for https://code.google.com/hosting/settings'
+ echo -n 'Username:'
+ read USERNAME
+ echo 'username is ' $USERNAME
+}
+
+read_password_from_user()
+{
+ echo 'Please enter your password for https://code.google.com/hosting/settings'
+ echo -n 'Password:'
+ read -s PASSWORD1
+ echo
+ echo -n 'Verify :'
+ read -s PASSWORD2
+ echo
+ if [ ! $PASSWORD1 = $PASSWORD2 ]; then
+ echo 'error - passwords dont match'
+ exit
+ fi
+ OSUPL_PASSWORD=$PASSWORD1
+ export OSUPL_PASSWORD
+}
+
+check_starting_path
+read_username_from_user
+read_password_from_user
+get_source_code
+build_win32
+upload_win32
+
+
+
diff --git a/scripts/googlecode_upload.py b/scripts/googlecode_upload.py
index 188dd6c..c0fe4c9 100755
--- a/scripts/googlecode_upload.py
+++ b/scripts/googlecode_upload.py
@@ -189,7 +189,7 @@ def encode_upload_request(fields, file_path):
def upload_find_auth(file_path, project_name, summary, labels=None,
- user_name=None, password=None, tries=3):
+ user_name=None, password=None, tries=1):
"""Find credentials and upload a file to a Google Code project's file server.
file_path, project_name, summary, and labels are passed as-is to upload.
@@ -203,6 +203,8 @@ def upload_find_auth(file_path, project_name, summary, labels=None,
user_name: Your Google account name.
tries: How many attempts to make.
"""
+ print 'uploading. username: ', user_name
+ print 'password detected:', password!=None
if user_name is None or password is None:
from netrc import netrc
authenticators = None
@@ -255,14 +257,20 @@ def main():
help='Google Code project name')
parser.add_option('-u', '--user', dest='user',
help='Your Google Code username')
- parser.add_option('-w', '--password', dest='password',
- help='Your Google Code password')
+ #this is a massive security hole. anyone using 'ps' could steal p/w
+ #parser.add_option('-w', '--password', dest='password',
+ # help='Your Google Code password')
parser.add_option('-l', '--labels', dest='labels',
help='An optional list of comma-separated labels to attach '
'to the file')
options, args = parser.parse_args()
+ if os.environ.has_key('OSUPL_PASSWORD'):
+ options.password=os.environ['OSUPL_PASSWORD']
+ else:
+ options.password=None
+
if not options.summary:
parser.error('File summary is missing.')
elif not options.project:
@@ -279,6 +287,7 @@ def main():
else:
labels = None
+ print 'read arguments'
status, reason, url = upload_find_auth(file_path, options.project,
options.summary, labels,
options.user, options.password)
@@ -293,4 +302,5 @@ def main():
if __name__ == '__main__':
+ print sys.argv
sys.exit(main())
diff --git a/scripts/mingw-x-build-dependencies.sh b/scripts/mingw-x-build-dependencies.sh
index ee51848..7a16530 100755
--- a/scripts/mingw-x-build-dependencies.sh
+++ b/scripts/mingw-x-build-dependencies.sh
@@ -49,7 +49,7 @@ fi
echo "entering" $MXEDIR
cd $MXEDIR
-echo "make mpfr eigen opencsg cgal qt -j $NUMCPU JOBS=$NUMJOBS"
+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
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 10a1c18..02b276b 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -134,7 +134,7 @@ esac
case $OS in
LINXWIN)
- cd $DEPLOYDIR && i686-pc-mingw32-qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
+ cd $DEPLOYDIR && qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
cd $OPENSCADDIR
;;
*)
@@ -144,7 +144,8 @@ esac
case $OS in
LINXWIN)
- cd $DEPLOYDIR && make -s clean
+ cd $DEPLOYDIR
+ make -s clean ## comment out for test-run
cd $OPENSCADDIR
;;
*)
@@ -172,10 +173,14 @@ case $OS in
# dont use paralell builds, it can error-out on parser_yacc.
# make main openscad.exe
- cd $DEPLOYDIR && make $TARGET
-
+ cd $DEPLOYDIR
+ make $TARGET ## comment out for test-run
+ if [ ! -e $TARGET/openscad.exe ]; then
+ echo 'build failed. stopping.'
+ exit
+ fi
# make console pipe-able openscad.com - see winconsole.pri for info
- i686-pc-mingw32-qmake CONFIG+=winconsole ../openscad.pro
+ qmake CONFIG+=winconsole ../openscad.pro
make
cd $OPENSCADDIR
@@ -245,21 +250,24 @@ case $OS in
cp win32deps/* openscad-$VERSION
cp $TARGET/openscad.exe openscad-$VERSION
cp $TARGET/openscad.com openscad-$VERSION
- rm -f openscad-$VERSION.zip
- "$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
+ rm -f openscad-$VERSION.x86-$ARCH.zip
+ "$ZIP" $ZIPARGS openscad-$VERSION.x86-$ARCH.zip openscad-$VERSION
rm -rf openscad-$VERSION
echo "Binary created: openscad-$VERSION.zip"
;;
LINXWIN)
+ BINFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH.zip
+ INSTFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH-Installer.exe
+
#package
- echo "Creating binary package"
+ echo "Creating binary zip package"
cd $DEPLOYDIR
cp $TARGET/openscad.exe openscad-$VERSION
cp $TARGET/openscad.com openscad-$VERSION
- rm -f OpenSCAD-$VERSION.zip
- "$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION
+ rm -f OpenSCAD-$VERSION.x86-$ARCH.zip
+ "$ZIP" $ZIPARGS $BINFILE openscad-$VERSION
cd $OPENSCADDIR
- echo "Binary package created"
+ echo "Binary zip package created"
echo "Creating installer"
echo "Copying NSIS files to $DEPLOYDIR/openscad-$VERSION"
@@ -270,11 +278,9 @@ case $OS in
# NSISDEBUG= # leave blank for full log
echo $MAKENSIS $NSISDEBUG installer.nsi
$MAKENSIS $NSISDEBUG installer.nsi
- cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
+ cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $INSTFILE
cd $OPENSCADDIR
- BINFILE=$DEPLOYDIR/OpenSCAD-$VERSION.zip
- INSTFILE=$DEPLOYDIR/OpenSCAD-$VERSION-Installer.exe
if [ -e $BINFILE ]; then
if [ -e $INSTFILE ]; then
echo
diff --git a/scripts/setenv-mingw-xbuild.sh b/scripts/setenv-mingw-xbuild.sh
index e8976b7..e31534e 100644
--- a/scripts/setenv-mingw-xbuild.sh
+++ b/scripts/setenv-mingw-xbuild.sh
@@ -27,11 +27,6 @@ fi
export PATH=$MXEDIR/usr/bin:$PATH
-echo BASEDIR: $BASEDIR
-echo MXEDIR: $MXEDIR
-echo DEPLOYDIR: $DEPLOYDIR
-echo PATH modified with $MXEDIR/usr/bin
-
if [ ! -e $DEPLOYDIR ]; then
mkdir -p $DEPLOYDIR
fi
@@ -39,5 +34,13 @@ fi
echo linking $MXEDIR/usr/i686-pc-mingw32/ to $DEPLOYDIR/mingw-cross-env
rm -f $DEPLOYDIR/mingw-cross-env
ln -s $MXEDIR/usr/i686-pc-mingw32/ $DEPLOYDIR/mingw-cross-env
+export PATH=$MXEDIR/usr/i686-pc-mingw32/qt/bin:$PATH
+
+echo BASEDIR: $BASEDIR
+echo MXEDIR: $MXEDIR
+echo DEPLOYDIR: $DEPLOYDIR
+echo PATH modified: $MXEDIR/usr/bin
+echo PATH modified: $MXEDIR/usr/i686-pc-mingw32/qt/bin
+
contact: Jan Huwald // Impressum