diff options
| author | Marius Kintel <marius@kintel.net> | 2012-07-07 20:02:51 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2012-07-07 20:02:51 (GMT) | 
| commit | 0d619e5ac155e37c432d57062d8224a58c9d59ab (patch) | |
| tree | 10183df17cd4786ee1ef43b95c988fefd13ca990 /scripts | |
| parent | aa8aee623adc74cbfe87f9e92e30be4a9ed3a7c8 (diff) | |
| parent | b028b704e029a5161d3703efda35642a37c28cb6 (diff) | |
Merge branch 'master' into linear_extrude_argument
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/linux-build-dependencies.sh | 239 | ||||
| -rwxr-xr-x | scripts/release-common.sh | 2 | ||||
| -rw-r--r-- | scripts/setenv-linbuild.sh | 23 | ||||
| -rwxr-xr-x | scripts/update-web.sh | 6 | 
4 files changed, 269 insertions, 1 deletions
diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh new file mode 100755 index 0000000..aef58b9 --- /dev/null +++ b/scripts/linux-build-dependencies.sh @@ -0,0 +1,239 @@ +#!/bin/sh -e +# +# This script builds all library dependencies of OpenSCAD for Linux +# +# This script must be run from the OpenSCAD source root directory +# +# Usage: linux-build-dependencies.sh +# +# Prerequisites: +# - wget or curl +# - Qt4 +# - cmake 2.8 ( force build_cmake at bottom if yours is too old ) +# + +BASEDIR=$HOME/openscad_deps +OPENSCADDIR=$PWD +SRCDIR=$BASEDIR/src +DEPLOYDIR=$BASEDIR +NUMCPU=2 # paralell builds for some libraries + +printUsage() +{ +  echo "Usage: $0" +  echo +} + +build_cmake() +{ +  version=$1 +  echo "Building cmake" $version "..." +  cd $BASEDIR/src +  rm -rf cmake-$version +  if [ ! -f cmake-$version.tar.gz ]; then +    curl -O http://www.cmake.org/files/v2.8/cmake-$version.tar.gz +  fi +  tar zxf cmake-$version.tar.gz +  cd cmake-$version +  mkdir build +  cd build +  ../configure --prefix=$DEPLOYDIR +  make -j$NUMCPU +  make install +} + +build_curl() +{ +  version=$1 +  echo "Building curl" $version "..." +  cd $BASEDIR/src +  rm -rf curl-$version +  if [ ! -f curl-$version.tar.bz2 ]; then +    wget http://curl.haxx.se/download/curl-$version.tar.bz2 +  fi +  tar xjf curl-$version.tar.bz2 +  cd curl-$version +  mkdir build +  cd build +  ../configure --prefix=$DEPLOYDIR +  make -j$NUMCPU +  make install +} + +build_gmp() +{ +  version=$1 +  echo "Building gmp" $version "..." +  cd $BASEDIR/src +  rm -rf gmp-$version +  if [ ! -f gmp-$version.tar.bz2 ]; then +    curl -O ftp://ftp.gmplib.org/pub/gmp-$version/gmp-$version.tar.bz2 +  fi +  tar xjf gmp-$version.tar.bz2 +  cd gmp-$version +  mkdir build +  cd build +  ../configure --prefix=$DEPLOYDIR --enable-cxx +  make install +} + +build_mpfr() +{ +  version=$1 +  echo "Building mpfr" $version "..." +  cd $BASEDIR/src +  rm -rf mpfr-$version +  if [ ! -f mpfr-$version.tar.bz2 ]; then +    curl -O http://www.mpfr.org/mpfr-$version/mpfr-$version.tar.bz2 +  fi +  tar xjf mpfr-$version.tar.bz2 +  cd mpfr-$version +  mkdir build +  cd build +  ../configure --prefix=$DEPLOYDIR --with-gmp=$DEPLOYDIR +  make install +  cd .. +} + +build_boost() +{ +  version=$1 +  bversion=`echo $version | tr "." "_"` +  echo "Building boost" $version "..." +  cd $BASEDIR/src +  rm -rf boost_$bversion +  if [ ! -f boost_$bversion.tar.bz2 ]; then +    curl -LO http://downloads.sourceforge.net/project/boost/boost/$version/boost_$bversion.tar.bz2 +  fi +  tar xjf boost_$bversion.tar.bz2 +  cd boost_$bversion +  # We only need certain portions of boost +  ./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,filesystem,system,regex +  ./bjam -j$NUMCPU +  ./bjam install +} + +build_cgal() +{ +  version=$1 +  echo "Building CGAL" $version "..." +  cd $BASEDIR/src +  rm -rf CGAL-$version +  if [ ! -f CGAL-$version.tar.gz ]; then +    #4.0 +    curl -O https://gforge.inria.fr/frs/download.php/30387/CGAL-$version.tar.gz +    # 3.9 curl -O https://gforge.inria.fr/frs/download.php/29125/CGAL-$version.tar.gz +    # 3.8 curl -O https://gforge.inria.fr/frs/download.php/28500/CGAL-$version.tar.gz +    # 3.7 curl -O https://gforge.inria.fr/frs/download.php/27641/CGAL-$version.tar.gz +  fi +  tar xzf CGAL-$version.tar.gz +  cd CGAL-$version +  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=Debug +  make -j$NUMCPU +  make install +} + +build_glew() +{ +  version=$1 +  echo "Building GLEW" $version "..." +  cd $BASEDIR/src +  rm -rf glew-$version +  if [ ! -f glew-$version.tgz ]; then +    curl -LO http://downloads.sourceforge.net/project/glew/glew/$version/glew-$version.tgz +  fi +  tar xzf glew-$version.tgz +  cd glew-$version +  mkdir -p $DEPLOYDIR/lib/pkgconfig + +  # uncomment this kludge for Fedora 64bit +  # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux + +  GLEW_DEST=$DEPLOYDIR make -j$NUMCPU +  GLEW_DEST=$DEPLOYDIR make install +} + +build_opencsg() +{ +  version=$1 +  echo "Building OpenCSG" $version "..." +  cd $BASEDIR/src +  rm -rf OpenCSG-$version +  if [ ! -f OpenCSG-$version.tar.gz ]; then +    curl -O http://www.opencsg.org/OpenCSG-$version.tar.gz +  fi +  tar xzf OpenCSG-$version.tar.gz +  cd OpenCSG-$version +  sed -i s/example// opencsg.pro # examples might be broken without GLUT + +  # uncomment this kludge for Fedora 64bit +  # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile  + +  qmake-qt4 +  make +  install -v lib/* $DEPLOYDIR/lib +  install -v include/* $DEPLOYDIR/include +} + +build_eigen() +{ +  version=$1 +  echo "Building eigen" $version "..." +  cd $BASEDIR/src +  rm -rf eigen-$version +  ## Directory name for v2.0.17 +  rm -rf eigen-eigen-b23437e61a07 +  if [ ! -f eigen-$version.tar.bz2 ]; then +    curl -LO http://bitbucket.org/eigen/eigen/get/$version.tar.bz2 +    mv $version.tar.bz2 eigen-$version.tar.bz2 +  fi +  tar xjf eigen-$version.tar.bz2 +  ## File name for v2.0.17 +  ln -s eigen-eigen-b23437e61a07 eigen-$version +  cd eigen-$version +  cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR +  make -j$NUMCPU +  make install +} + +if [ ! -f $OPENSCADDIR/openscad.pro ]; then +  echo "Must be run from the OpenSCAD source root directory" +  exit 0 +fi + +if [ ! -d $BASEDIR/bin ]; then +  mkdir --parents $BASEDIR/bin +fi + +echo "Using basedir:" $BASEDIR +echo "Using deploydir:" $DEPLOYDIR +echo "Using srcdir:" $SRCDIR +echo "Number of CPUs for parallel builds:" $NUMCPU +mkdir -p $SRCDIR $DEPLOYDIR + +export PATH=$BASEDIR/bin:$PATH +export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_LIBRARY_PATH +export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_RUN_PATH +echo "PATH modified temporarily" +echo "LD_LIBRARY_PATH modified temporarily" +echo "LD_RUN_PATH modified temporarily" + +if [ ! "`command -v curl`" ]; then +	build_curl 7.26.0 +fi + +# NB! For cmake, also update the actual download URL in the function +if [ ! "`command -v cmake`" ]; then +	build_cmake 2.8.8 +fi + +build_eigen 2.0.17 +build_gmp 5.0.5 +build_mpfr 3.1.1 +build_boost 1.47.0 +# NB! For CGAL, also update the actual download URL in the function +build_cgal 4.0 +build_glew 1.7.0 +build_opencsg 1.3.2 + +echo "OpenSCAD dependencies built in " $BASEDIR diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 80c9795..94a8634 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -186,6 +186,6 @@ case $OS in          strip openscad-$VERSION/lib/openscad/*          cp scripts/installer-linux.sh openscad-$VERSION/install.sh          chmod 755 -R openscad-$VERSION/ -        tar cz openscad-$VERSION > openscad-$VERSION.x86-64.tar.gz +        tar cz openscad-$VERSION > openscad-$VERSION.x86-$ARCH.tar.gz          ;;  esac diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh new file mode 100644 index 0000000..9719533 --- /dev/null +++ b/scripts/setenv-linbuild.sh @@ -0,0 +1,23 @@ +# setup env variables for building OpenSCAD against custom built +# dependency libraries from linux-build-dependencies.sh + +# run this file with 'source setenv-linbuild.sh' + +# BASEDIR and DEPLOYDIR must be the same as in linux-build-dependencies.sh +BASEDIR=$HOME/openscad_deps +DEPLOYDIR=$BASEDIR + +export PATH=$BASEDIR/bin:$PATH +export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +export OPENSCAD_LIBRARIES=$DEPLOYDIR +export GLEWDIR=$DEPLOYDIR + +echo BASEDIR: $BASEDIR +echo DEPLOYDIR: $DEPLOYDIR +echo PATH modified +echo LD_LIBRARY_PATH modified +echo LD_RUN_PATH modified +echo OPENSCAD_LIBRARIES modified +echo GLEWDIR modified + diff --git a/scripts/update-web.sh b/scripts/update-web.sh index 9036d9b..c611d28 100755 --- a/scripts/update-web.sh +++ b/scripts/update-web.sh @@ -11,6 +11,8 @@ fi  if [[ $OSTYPE =~ "darwin" ]]; then    OS=MACOSX +elif [[ $OSTYPE == "linux-gnu" ]]; then +  OS=LINUX  fi  indexfile=../openscad.github.com/index.html @@ -21,6 +23,10 @@ if [ -f $indexfile ]; 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 +  elif [ $OS == LINUX ]; then +    file2=$2 +    sed -i .backup -e "s/^\(.*linux-snapshot-32.*\)\(openscad-.*-32\.tar\.gz\)\(.*\)\(openscad-.*-32\.tar\.gz\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile +    sed -i .backup -e "s/^\(.*linux-snapshot-64.*\)\(openscad-.*-64\.tar\.gz\)\(.*\)\(openscad-.*-64\.tar\.gz\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile    fi    echo "Web page updated. Remember to commit and push openscad.github.com"  else  | 
