: # build scribus15 with python3 set -x version=3 # parse command line while [ ! -z "$1" ] do case "$1" in -2|-p2) version=2 ;; -3|-p3) version=3 ;; -*) echo "$0: Unknown option $1" ; exit ;; *) echo "$0: Unknown parameter $1" ; exit ;; esac shift done scribusbin="scribus15p${version}bin" build_dir="build$version" dir="/u/gnu/scribus15p3" # shared source cmake_opt= make_opt= echo "$0: Starting build for $scribusbin at `date`" mkdir -p "$dir" cd "$dir" if [ ! -d "$dir" ] ; then echo "$0: Could not create $dir"; exit ; fi if [ ! -d Scribus ] ; then svn co svn://scribus.net/trunk/Scribus ; echo "$0: Apply the patches to $dir and restart" ; exit ; fi # First time # apply python3 patches cd "$dir/Scribus" # svn update # following times if you want to rebuild with updated source cd "$dir" # rm -rf "$build_dir" # exit mkdir -p "$build_dir" cd "$build_dir" export QT_SELECT=qt5 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/lib64/qt5/lib/pkgconfig case ":${PATH}:" in *:/usr/lib64/qt5/bin:*) echo qt5 on path ;; *) export PATH="/usr/lib64/qt5/bin:$PATH" ;; esac case ":${PATH}:" in *:/usr/local/bin:*) echo local bin on path ;; *) export PATH="/usr/local/bin:$PATH" ;; esac if [ -f Makefile ] then echo "$0: Makefile found." else if [ "$version" = 3 ] ; then cmake_opt="$cmake_opt -DWANT_PYTHON3=1" ; fi echo "$0: Running cmake $cmake_opt at `date`" if cmake -DCMAKE_INSTALL_PREFIX:PATH=/u/gnu/${scribusbin} -DQT_PREFIX=/usr/lib64/qt5 $cmake_opt -DWANT_DEBUG=1 -DWANT_GRAPHICSMAGICK=1 -DWANT_VERSIONING=1 -DCMAKE_BUILD_TYPE=Debug ../Scribus then echo "$0: cmake finished" else echo "$0: cmake failed" exit fi fi num="`grep processor /proc/cpuinfo | tail -1 | awk '{ print $3 }'`" case "$num" in 0) ;; [1-9]*) make_opt="$make_opt -j2" ;; *) echo "$0: Unknown cpu count $num" ;; esac echo "$0: Starting make $make_opt in $build_dir at `date`" if nice nice nohup make $make_opt then if make install then echo "$0: Install finished" else echo "$0: Install failed" fi else echo "$0: Build failed" fi echo "$0: Finished at `date`"