update to match new mxe. add 'builder' script to automate some stuff

felipesanches-svg
Don Bright 2013-05-12 12:19:04 -05:00
parent 8c532d5252
commit 84eaad1457
6 changed files with 146 additions and 24 deletions

View File

@ -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

103
scripts/builder.sh Executable file
View File

@ -0,0 +1,103 @@
#!/usr/bin/env bash
# build&upload script for linux & windows binaries
# tested under linux
# requirements -
# see http://mxe.cc for required tools (scons, perl, yasm, etc etc etc)
# 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 -s 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

View File

@ -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())

View File

@ -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

View File

@ -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

View File

@ -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