summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-dependencies.sh34
-rwxr-xr-xscripts/macosx-build-dependencies.sh46
-rwxr-xr-xscripts/macosx-sanity-check.py3
-rwxr-xr-xscripts/publish-macosx.sh23
-rwxr-xr-xscripts/release-common.sh21
-rw-r--r--scripts/setenv-unibuild.sh5
-rwxr-xr-xscripts/uni-build-dependencies.sh56
-rwxr-xr-xscripts/uni-get-dependencies.sh18
8 files changed, 159 insertions, 47 deletions
diff --git a/scripts/check-dependencies.sh b/scripts/check-dependencies.sh
index 6a3e637..ef8c904 100755
--- a/scripts/check-dependencies.sh
+++ b/scripts/check-dependencies.sh
@@ -418,12 +418,14 @@ find_installed_version()
depname=$1
# try to find/parse headers and/or binary output
+ # break on the first match. (change the order to change precedence)
if [ ! $fsv_tmp ]; then
- for syspath in "/opt" "/usr/pkg" "/usr" "/usr/local" $OPENSCAD_LIBRARIES; do
+ for syspath in "/usr/local" "/opt/local" "/usr/pkg" "/usr" $OPENSCAD_LIBRARIES; do
if [ -e $syspath ]; then
debug $depname"_sysver" $syspath
eval $depname"_sysver" $syspath
fsv_tmp=`eval echo "$"$depname"_sysver_result"`
+ if [ $fsv_tmp ]; then break; fi
fi
done
fi
@@ -449,17 +451,23 @@ check_old_local()
warnon=
if [ "`uname | grep -i linux`" ]; then
header_list="opencsg.h CGAL boost GL/glew.h gmp.h mpfr.h eigen2 eigen3"
- liblist="libboost_system libboost_system-mt libopencsg libCGAL libglew"
- for i in $header_list $liblist; do
+ for i in $header_list; do
if [ -e /usr/local/include/$i ]; then
echo "Warning: you have a copy of "$i" under /usr/local/include"
warnon=1
fi
+ done
+ liblist="libboost_system libboost_system-mt libopencsg libCGAL libglew"
+ for i in $liblist; do
if [ -e /usr/local/lib/$i.so ]; then
echo "Warning: you have a copy of "$i" under /usr/local/lib"
warnon=1
fi
done
+ if [ -e /usr/local/lib/pkgconfig ]; then
+ echo "Warning: you have pkgconfig under /usr/local/lib"
+ warnon=1
+ fi
fi
if [ $warnon ]; then
echo "Please verify these local copies don't conflict with the system"
@@ -471,6 +479,24 @@ check_misc()
if [ "`uname -a|grep -i netbsd`" ]; then
echo "NetBSD: Please manually verify the X Sets have been installed"
fi
+
+ if [ "`uname -a|grep -i darwin`" ]; then
+ sparkle=
+ libs="~/Library /Library"
+ for libhome in $libs; do
+ echo "$libhome/Frameworks/Sparkle.framework..."
+ if [ -d $libhome/Frameworks/Sparkle.framework ]; then
+ echo "Found in $libhome"
+ sparkle=$libhome
+ break
+ fi
+ done
+ if [ -n "$sparkle" ]; then
+ echo "OS X: Make sure Sparkle.framework is installed in your Frameworks path"
+ else
+ echo "OS X: Sparkle.framework found in $libhome"
+ fi
+ fi
}
checkargs()
@@ -494,7 +520,7 @@ main()
dep_minver=$find_min_version_result
compare_version $dep_minver $dep_sysver
dep_compare=$compare_version_result
- pretty_print $depname $dep_minver $dep_sysver $dep_compare
+ pretty_print $depname $dep_minver $dep_sysver $dep_compare
done
check_old_local
check_misc
diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh
index bfe0ede..3687041 100755
--- a/scripts/macosx-build-dependencies.sh
+++ b/scripts/macosx-build-dependencies.sh
@@ -6,10 +6,11 @@
#
# This script must be run from the OpenSCAD source root directory
#
-# Usage: macosx-build-dependencies.sh [-6l]
+# Usage: macosx-build-dependencies.sh [-6lcd]
# -6 Build only 64-bit binaries
# -l Force use of LLVM compiler
# -c Force use of clang compiler
+# -d Build for deployment (if not specified, e.g. Sparkle won't be built)
#
# Prerequisites:
# - MacPorts: curl, cmake
@@ -32,11 +33,12 @@ export QMAKESPEC=macx-g++
printUsage()
{
- echo "Usage: $0 [-6lc]"
+ echo "Usage: $0 [-6lcd]"
echo
echo " -6 Build only 64-bit binaries"
echo " -l Force use of LLVM compiler"
echo " -c Force use of clang compiler"
+ echo " -d Build for deployment"
}
# FIXME: Support gcc/llvm/clang flags. Use -platform <whatever> to make this work? kintel 20130117
@@ -51,6 +53,10 @@ build_qt()
fi
tar xzf qt-everywhere-opensource-src-$version.tar.gz
cd qt-everywhere-opensource-src-$version
+ if $OPTION_CLANG; then
+ # FIX for clang
+ sed -i "" -e "s/::TabletProximityRec/TabletProximityRec/g" src/gui/kernel/qt_cocoa_helpers_mac_p.h
+ fi
if $OPTION_32BIT; then
QT_32BIT="-arch x86"
fi
@@ -188,7 +194,6 @@ build_mpfr()
cp x86_64/include/mpf2mpfr.h include/
}
-
build_boost()
{
version=$1
@@ -325,17 +330,43 @@ build_eigen()
make install
}
+build_sparkle()
+{
+ # Let Sparkle use the default compiler
+ unset CC
+ unset CXX
+ version=$1
+ echo "Building Sparkle" $version "..."
+ cd $BASEDIR/src
+ rm -rf Sparkle-$version
+ if [ ! -f Sparkle-$version.zip ]; then
+ curl -o Sparkle-$version.zip https://nodeload.github.com/andymatuschak/Sparkle/zip/$version
+ fi
+ unzip -q Sparkle-$version.zip
+ cd Sparkle-$version
+ patch -p1 < $OPENSCADDIR/patches/sparkle.patch
+ if $OPTION_32BIT; then
+ SPARKLE_EXTRA_FLAGS="-arch i386"
+ fi
+ xcodebuild clean
+ xcodebuild -arch x86_64 $SPARKLE_EXTRA_FLAGS
+ rm -rf $DEPLOYDIR/lib/Sparkle.framework
+ cp -Rf build/Release/Sparkle.framework $DEPLOYDIR/lib/
+ install_name_tool -id $DEPLOYDIR/lib/Sparkle.framework/Versions/A/Sparkle $DEPLOYDIR/lib/Sparkle.framework/Sparkle
+}
+
if [ ! -f $OPENSCADDIR/openscad.pro ]; then
echo "Must be run from the OpenSCAD source root directory"
exit 0
fi
-while getopts '6lc' c
+while getopts '6lcd' c
do
case $c in
6) OPTION_32BIT=false;;
l) OPTION_LLVM=true;;
c) OPTION_CLANG=true;;
+ d) OPTION_DEPLOY=true;;
esac
done
@@ -384,10 +415,13 @@ echo "Using basedir:" $BASEDIR
mkdir -p $SRCDIR $DEPLOYDIR
build_qt 4.8.4
build_eigen 3.1.2
-build_gmp 5.1.0
+build_gmp 5.1.1
build_mpfr 3.1.1
-build_boost 1.51.0
+build_boost 1.53.0
# NB! For CGAL, also update the actual download URL in the function
build_cgal 4.1
build_glew 1.9.0
build_opencsg 1.3.2
+if $OPTION_DEPLOY; then
+ build_sparkle 0ed83cf9f2eeb425d4fdd141c01a29d843970c20
+fi
diff --git a/scripts/macosx-sanity-check.py b/scripts/macosx-sanity-check.py
index 3938d74..4927de9 100755
--- a/scripts/macosx-sanity-check.py
+++ b/scripts/macosx-sanity-check.py
@@ -108,6 +108,9 @@ if __name__ == '__main__':
assert(deps)
for d in deps:
absfile = lookup_library(d)
+ if not re.match(executable_path, absfile):
+ print "Error: External dependency " + d
+ sys.exit(1)
if absfile == None:
print "Not found: " + d
print " ..required by " + str(processed[dep])
diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh
index e22e5bd..3aeeaf9 100755
--- a/scripts/publish-macosx.sh
+++ b/scripts/publish-macosx.sh
@@ -1,10 +1,13 @@
#!/bin/sh
-# NB! To build a release build, the VERSION environment variable needs to be set.
+# NB! To build a release build, the VERSION and VERSIONDATE environment variables needs to be set.
# See doc/release-checklist.txt
+if test -z "$VERSIONDATE"; then
+ VERSIONDATE=`date "+%Y.%m.%d"`
+fi
if test -z "$VERSION"; then
- VERSION=`date "+%Y.%m.%d"`
+ VERSION=$VERSIONDATE
COMMIT=-c
SNAPSHOT=true
fi
@@ -29,10 +32,24 @@ if [[ $? != 0 ]]; then
exit 1
fi
+SIGNATURE=$(openssl dgst -sha1 -binary < OpenSCAD-$VERSION.dmg | openssl dgst -dss1 -sign dsa_priv.pem | openssl enc -base64)
+
+if [[ $VERSION == $VERSIONDATE ]]; then
+ APPCASTFILE=appcast-snapshots.xml
+else
+ APPCASTFILE=appcast.xml
+fi
+echo "Creating appcast $APPCASTFILE..."
+sed -e "s,@VERSION@,$VERSION,g" -e "s,@VERSIONDATE@,$VERSIONDATE,g" -e "s,@DSASIGNATURE@,$SIGNATURE,g" -e "s,@FILESIZE@,$(stat -f "%z" OpenSCAD-$VERSION.dmg),g" $APPCASTFILE.in > $APPCASTFILE
+cp $APPCASTFILE ../openscad.github.com
+if [[ $VERSION == $VERSIONDATE ]]; then
+ cp $APPCASTFILE ../openscad.github.com/appcast-snapshots.xml
+fi
+
echo "Uploading..."
LABELS=OpSys-OSX,Type-Executable
if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi
`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS
-# Update snapshot filename on wab page
+# Update snapshot filename on web page
`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index de14cb1..10a1c18 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -9,10 +9,12 @@
#
# Usage: release-common.sh [-v <versionstring>] [-c] [-x32]
# -v Version string (e.g. -v 2010.01)
+# -d Version date (e.g. -d 2010.01.23)
# -c Build with commit info
# -mingw32 Cross-compile for win32 using MXE
#
-# If no version string is given, todays date will be used (YYYY-MM-DD)
+# If no version string or version date is given, todays date will be used (YYYY-MM-DD)
+# If only verion date is given, it will be used also as version string.
# If no make target is given, release will be used on Windows, none one Mac OS X
#
# The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT
@@ -23,7 +25,7 @@
printUsage()
{
- echo "Usage: $0 -v <versionstring> -c -mingw32
+ echo "Usage: $0 -v <versionstring> -d <versiondate> -c -mingw32
echo
echo " Example: $0 -v 2010.01
}
@@ -59,16 +61,20 @@ else
exit
fi
-while getopts 'v:c' c
+while getopts 'v:d:c' c
do
case $c in
v) VERSION=$OPTARG;;
+ d) VERSIONDATE=$OPTARG;;
c) OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"`
esac
done
+if test -z "$VERSIONDATE"; then
+ VERSIONDATE=`date "+%Y.%m.%d"`
+fi
if test -z "$VERSION"; then
- VERSION=`date "+%Y.%m.%d"`
+ VERSION=$VERSIONDATE
fi
@@ -102,15 +108,14 @@ if [ -d .git ]; then
git submodule update
fi
-echo "Building openscad-$VERSION $CONFIGURATION..."
+echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..."
+CONFIG=deploy
case $OS in
LINUX|MACOSX)
- CONFIG=deploy
TARGET=
;;
WIN)
- unset CONFIG
export QTDIR=/c/devmingw/qt2009.03
export QTMAKESPEC=win32-g++
export PATH=$PATH:/c/devmingw/qt2009.03/bin:/c/devmingw/qt2009.03/qt/bin
@@ -119,7 +124,6 @@ case $OS in
TARGET=release
;;
LINXWIN)
- unset CONFIG
. ./scripts/setenv-mingw-xbuild.sh
TARGET=release
ZIP="zip"
@@ -230,6 +234,7 @@ echo "Creating archive.."
case $OS in
MACOSX)
+ /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSIONDATE" OpenSCAD.app/Contents/Info.plist
macdeployqt OpenSCAD.app -dmg -no-strip
mv OpenSCAD.dmg OpenSCAD-$VERSION.dmg
hdiutil internet-enable -yes -quiet OpenSCAD-$VERSION.dmg
diff --git a/scripts/setenv-unibuild.sh b/scripts/setenv-unibuild.sh
index 66fb7a9..980fa7b 100644
--- a/scripts/setenv-unibuild.sh
+++ b/scripts/setenv-unibuild.sh
@@ -34,6 +34,11 @@ setenv_common()
echo OPENSCAD_LIBRARIES modified
echo GLEWDIR modified
+ if [ "`uname -m | grep sparc64`" ]; then
+ echo detected sparc64. forcing 32 bit with export ABI=32
+ ABI=32
+ export ABI
+ fi
}
setenv_freebsd()
diff --git a/scripts/uni-build-dependencies.sh b/scripts/uni-build-dependencies.sh
index 09b6b79..dc61f74 100755
--- a/scripts/uni-build-dependencies.sh
+++ b/scripts/uni-build-dependencies.sh
@@ -1,4 +1,4 @@
- #!/bin/sh -e
+#!/bin/sh -e
# uni-build-dependencies by don bright 2012. copyright assigned to
# Marius Kintel and Clifford Wolf, 2012. released under the GPL 2, or
@@ -184,6 +184,7 @@ build_gmp()
mkdir build
cd build
../configure --prefix=$DEPLOYDIR --enable-cxx
+ make -j$NUMCPU
make install
}
@@ -205,6 +206,7 @@ build_mpfr()
mkdir build
cd build
../configure --prefix=$DEPLOYDIR --with-gmp=$DEPLOYDIR
+ make -j$NUMCPU
make install
cd ..
}
@@ -223,6 +225,10 @@ build_boost()
if [ ! -f boost_$bversion.tar.bz2 ]; then
curl --insecure -LO http://downloads.sourceforge.net/project/boost/boost/$version/boost_$bversion.tar.bz2
fi
+ if [ ! $? -eq 0 ]; then
+ echo download failed.
+ exit 1
+ fi
tar xjf boost_$bversion.tar.bz2
cd boost_$bversion
if [ "`gcc --version|grep 4.7`" ]; then
@@ -247,17 +253,16 @@ build_boost()
fi
if [ $CXX ]; then
if [ $CXX = "clang++" ]; then
- $BJAMBIN -j$NUMCPU toolset=clang install
- # ./b2 -j$NUMCPU toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" install
+ $BJAMBIN -j$NUMCPU toolset=clang
fi
else
$BJAMBIN -j$NUMCPU
- if [ $? = 0 ]; then
- $BJAMBIN install
- else
- echo boost build failed
- exit 1
- fi
+ fi
+ if [ $? = 0 ]; then
+ $BJAMBIN install
+ else
+ echo boost build failed
+ exit 1
fi
}
@@ -293,7 +298,7 @@ build_cgal()
if [ "`echo $2 | grep use-sys-libs`" ]; then
cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DCMAKE_BUILD_TYPE=$CGAL_BUILDTYPE ..
else
- cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=$CGAL_BUILD_TYPE ..
+ cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DBoost_USE_MULTITHREADED=false -DCMAKE_BUILD_TYPE=$CGAL_BUILD_TYPE ..
fi
make -j$NUMCPU
make install
@@ -301,7 +306,14 @@ build_cgal()
build_glew()
{
- if [ -e $DEPLOYDIR/include/GL/glew.h ]; then
+ GLEW_INSTALLED=
+ if [ -e $DEPLOYDIR/lib64/libGLEW.so ]; then
+ GLEW_INSTALLED=1
+ fi
+ if [ -e $DEPLOYDIR/lib/libGLEW.so ]; then
+ GLEW_INSTALLED=1
+ fi
+ if [ $GLEW_INSTALLED ]; then
echo "glew already installed. not building"
return
fi
@@ -494,29 +506,29 @@ if [ "`cmake --version | grep 'version 2.[1-6][^0-9]'`" ]; then
build_cmake 2.8.8
fi
-# build_git 1.7.10.3
-
-# Singly build CGAL or OpenCSG
-# (Most systems have all libraries available as packages except CGAL/OpenCSG)
-# (They can be built singly here by passing a command line arg to the script)
+# Singly build certain tools or libraries
if [ $1 ]; then
+ if [ $1 = "git" ]; then
+ build_git 1.7.10.3
+ exit $?
+ fi
if [ $1 = "cgal" ]; then
build_cgal 4.0.2 use-sys-libs
- exit
+ exit $?
fi
if [ $1 = "opencsg" ]; then
build_opencsg 1.3.2
- exit
+ exit $?
fi
- if [ $1 == "qt4" ]; then
+ if [ $1 = "qt4" ]; then
# such a huge build, put here by itself
build_qt4 4.8.4
- exit
+ exit $?
fi
- if [ $1 == "glu" ]; then
+ if [ $1 = "glu" ]; then
# Mesa and GLU split in late 2012, so it's not on some systems
build_glu 9.0.0
- exit
+ exit $?
fi
fi
diff --git a/scripts/uni-get-dependencies.sh b/scripts/uni-get-dependencies.sh
index cf9f136..98170de 100755
--- a/scripts/uni-get-dependencies.sh
+++ b/scripts/uni-get-dependencies.sh
@@ -6,8 +6,13 @@
get_fedora_deps()
{
- sudo yum install qt-devel bison flex eigen2-devel \
- boost-devel mpfr-devel gmp-devel glew-devel CGAL-devel gcc pkgconfig git
+ sudo yum install qt-devel bison flex eigen2-devel python-paramiko \
+ boost-devel mpfr-devel gmp-devel glew-devel CGAL-devel gcc pkgconfig git libXmu-devel
+}
+
+get_qomo_deps()
+{
+ get_fedora_deps
}
get_altlinux_deps()
@@ -28,7 +33,7 @@ get_freebsd_deps()
get_netbsd_deps()
{
sudo pkgin install bison boost cmake git bash eigen flex gmake gmp mpfr \
- qt4 glew cgal opencsg modular-xorg
+ qt4 glew cgal opencsg modular-xorg python27 py27-paramiko
}
get_opensuse_deps()
@@ -50,7 +55,8 @@ get_debian_deps()
for pkg in build-essential libqt4-dev libqt4-opengl-dev \
libxmu-dev cmake bison flex git-core libboost-all-dev \
libXi-dev libmpfr-dev libboost-dev libglew-dev libeigen2-dev \
- libeigen3-dev libcgal-dev libopencsg-dev libgmp3-dev libgmp-dev; do
+ libeigen3-dev libcgal-dev libopencsg-dev libgmp3-dev libgmp-dev \
+ python-paramiko ; do
sudo apt-get -y install $pkg;
done
}
@@ -75,10 +81,14 @@ if [ -e /etc/issue ]; then
get_fedora_deps
elif [ "`grep -i mageia /etc/issue`" ]; then
get_mageia_deps
+ elif [ "`grep -i qomo /etc/issue`" ]; then
+ get_qomo_deps
elif [ "`command -v rpm`" ]; then
if [ "`rpm -qa | grep altlinux`" ]; then
get_altlinux_deps
fi
+ else
+ unknown
fi
elif [ "`uname | grep -i freebsd `" ]; then
get_freebsd_deps
contact: Jan Huwald // Impressum