diff options
Diffstat (limited to 'academic/bibletime/bibletime.SlackBuild')
-rw-r--r-- | academic/bibletime/bibletime.SlackBuild | 74 |
1 files changed, 64 insertions, 10 deletions
diff --git a/academic/bibletime/bibletime.SlackBuild b/academic/bibletime/bibletime.SlackBuild index 9af701fef1..df21ddf077 100644 --- a/academic/bibletime/bibletime.SlackBuild +++ b/academic/bibletime/bibletime.SlackBuild @@ -26,10 +26,23 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Modified by Robert Delahunt [twinreverb[at]puresimplicity.net -# Modified 2018/9 by Tim Dickson (dickson.tim@googlemail.com) +# Modified 2018/19/20 by Tim Dickson (dickson.tim@googlemail.com) PRGNAM=bibletime -VERSION=${VERSION:-3.0_beta2} +VERSION=${VERSION:-3.0} +CMVERSION=${CMVERSION:-3.17.2} + +#if you have a private cmake v 3.10 or newer, setting CMAKEBINDIR with the +#full directory of the cmake binary will cause this script to try it +#instead of building it's own private version + +CHKCMAKE="no" +if [ "x${CMAKEBINDIR}" != "x" ]&&[ -d "${CMAKEBINDIR}" ]&&[ -x "${CMAKEBINDIR}/cmake" ]; then + #we make sure either main version is >3 or subversion>=10. this should + #cover all possibilities with slack14.2 or higher, although 15.0 should + #have newer version of cmake anyway :-) + CHKCMAKE=`${CMAKEBINDIR}/cmake --version|head -n1|awk '{print $NF}'|awk -F"." '($1>3)||($2>=10) {print "yes"}'` +fi BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -68,6 +81,13 @@ cd $TMP rm -rf $PRGNAM-$VERSION tar -xJvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION + +#we need a private copy of a newer version of cmale (at least 3.10) +if [ "$CHKCMAKE" != "yes" ]; then + tar xvf $CWD/cmake-$CMVERSION.tar.gz +fi + +#sane permissions for everything chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -75,13 +95,45 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -mkdir build -#patch CMakeLists.txt so it works with verson of cmake on slack14.2 -#these patches can be removed once cmake gets to 3.10 or higher -sed -i "s/VERSION 3.10/VERSION 3.5/g" CMakeLists.txt -sed -i "s/^CHECK_IPO_SUPPORTED(RESULT HAVE_IPO)/SET(HAVE_IPO FALSE)/g" CMakeLists.txt -sed -i "s/^INCLUDE(CheckIPO/#INCLUDE(CheckIPO/g" CMakeLists.txt -sed -i "/TARGET_COMPILE_FEATURES/s/.*/SET(CMAKE_CXX_STANDARD 11)/" CMakeLists.txt +#first we do the private cmake stuff. +if [ "$CHKCMAKE" != "yes" ]; then + cd CMake-$CMVERSION + mkdir cmake-build + cd cmake-build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ../configure \ + --prefix=$TMP/$PRGNAM-$VERSION/tmpcmake \ + --docdir=/doc \ + --no-qt-gui \ + --system-curl \ + --system-expat \ + --no-system-jsoncpp \ + --system-zlib \ + --system-bzip2 \ + --system-libarchive + #we don't care about the docs really as this is a temp install. + make + make install + #hopefully that has installed our tmp cmake in the right place + #in $TMP/$PRGNAM-$VERSION/tmpcmake/bin + #lets make it available to the bibletime build + OLDPATH=$PATH + export PATH=$TMP/$PRGNAM-$VERSION/tmpcmake/bin:$PATH + #move back to the right directory + cd ../../ +else + #we passed a viable cmake alternative location, so use that. + OLDPATH=$PATH + export PATH=${CMAKEBINDIR}:$PATH +fi + +#we need to patch the cmake file to skip tests as they fail at the moment +#hopefully they will be fixed in 3.0.1 + +sed -i "/BTTests/s/^/#/" cmake/BTApplication.cmake + +mkdir -p build cd build cmake \ -Wno-dev \ @@ -90,7 +142,9 @@ cd build -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_C_FLAGS="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \ - -DLIB_SUFFIX=$LIBDIRSUFFIX .. + -DLIB_SUFFIX=$LIBDIRSUFFIX .. + #we have done the cmake stuff, so restore the PATH + export PATH=$OLDPATH make make install DESTDIR=$PKG cd .. |