diff options
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-x | FUNCTIONS | 124 |
1 files changed, 47 insertions, 77 deletions
@@ -2,6 +2,18 @@ . $GRIMOIRE/libgcc . $GRIMOIRE/config_query_multi.function +if is_depends_enabled $SPELL python;then + VV=`installed_version python | cut -c-3` && + PYTHON2=/usr/bin/python${VV} + export PYTHON=$PYTHON2 +fi + +if is_depends_enabled $SPELL python3;then + VV=`installed_version python3 | cut -c-3` && + PYTHON3=/usr/bin/python${VV}m + export PYTHON=$PYTHON3 +fi + QT5DIR=$INSTALL_ROOT/opt/qt5 qt5_build() { export PKG_CONFIG_PATH="$QT5DIR/lib/pkgconfig" @@ -441,28 +453,28 @@ function unpack_file() { ## Default build for Python2 spell. #------------------------------------------------------------------------- function default_build_python() { - python2 setup.py build "$@" + $PYTHON2 setup.py build "$@" } #------------------------------------------------------------------------- ## Default build for Python 3 spell. #------------------------------------------------------------------------- function default_build_python3() { - python3 setup.py build "$@" + $PYTHON3 setup.py build "$@" } #------------------------------------------------------------------------- ## Default install for Python spell. #------------------------------------------------------------------------- function default_install_python() { - python2 setup.py install --root "$INSTALL_ROOT/" "$@" + $PYTHON2 setup.py install --root "$INSTALL_ROOT/" "$@" } #------------------------------------------------------------------------- ## Default install for Python 3 spell. #------------------------------------------------------------------------- function default_install_python3() { - python3 setup.py install --root "$INSTALL_ROOT/" "$@" + $PYTHON3 setup.py install --root "$INSTALL_ROOT/" "$@" } #------------------------------------------------------------------------- @@ -509,25 +521,33 @@ function note_config_files() { # Disabled caching as this has GREAT potential for borkage # and waf is fast without it as well -function waf_build(){ - ./waf configure \ - --nocache \ - --prefix=${INSTALL_ROOT}/usr \ - $OPTS && +function waf_build() { + ./waf configure --prefix=${INSTALL_ROOT}/usr \ + --mandir=${INSTALL_ROOT}/usr/share/man \ + -j $MAKE_NJOBS \ + --nocache $OPTS && ./waf build } -function waf_install(){ +function waf_install() { ./waf install } # spells in several sections now need cmake or qt4 cmake_build() { - cd $SOURCE_DIRECTORY && + cd "$SOURCE_DIRECTORY" && mkdir -p build && cd build && prepare_cmake_flags && - cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT/usr -DSYSCONFDIR=$INSTALL_ROOT/etc $OPTS ../ && + cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT"/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_MANDIR=share/man \ + -DCMAKE_PREFIX_PATH=share/apps/cmake/modules \ + -DSYSCONFDIR="$INSTALL_ROOT"/etc \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" \ + -DCMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \ + $OPTS ../ && make } @@ -544,33 +564,6 @@ qt4_build() { make } -# check whether the QT provider is qt4 -function check_if_qt4_provider() -{ - if [[ "$(get_spell_provider ${1:-$SPELL} QT)" == "qt4" ]] - then - return 0 - fi - return 1 -} - - -# build using qt3 or qt4 -# some spells an adapt the build process to either qt3 or qt4 -function build_qt3_or_4() -{ - if check_if_qt4_provider - then - QTDIR="${QTDIR:-$INSTALL_ROOT/usr}" - PATH="$QTDIR/bin/qt4:$PATH" - else - [[ -z $QTDIR ]] && source /etc/profile.d/qt.sh - QTDIR="${QTDIR:-$INSTALL_ROOT/usr}" - fi && - qmake && - make -} - # cmake flags use : which is an internal sorcery delimiter. # In order to facilitate the passing of depends flags, use % instead and call # this function at the start of BUILD. Don't use it anywhere else. @@ -639,43 +632,6 @@ function get_kernel_config() fi } -# this is mostly copied from sorcery real_default_sorcery_build, -# and kde-apps/KDE_BUILD - -# we need a different --includedir value for KDE3 spells, -# so as to avoid conflicts with KDE4 - -function default_kde3_build() { - - if [[ -f /etc/profile.d/qt.sh ]]; then - . /etc/profile.d/qt.sh - fi && - OPTS="$KDE_DEBUG_OPTION \ - $KDE_FINAL_OPTION \ - $KDE_LDFLAGS \ - --enable-dnotify \ - --with-distribution \ - --disable-dependency-tracking \ - $OPTS" && - - OPTS="$OPTS --build=${BUILD}" - #If these switches are used, they _may_ stop distcc and ccache from working - # for some spells (bug 3798) - # We could write wrappers for all of the possible binaries - [[ $CROSS_INSTALL == on ]] && OPTS="$OPTS --host=${HOST}" - - ./configure --prefix=${INSTALL_ROOT}/usr \ - --sysconfdir=${INSTALL_ROOT}/etc \ - --localstatedir=${INSTALL_ROOT}/var \ - --mandir=${INSTALL_ROOT}/usr/share/man \ - --infodir=${INSTALL_ROOT}/usr/share/info \ - --includedir=${INSTALL_ROOT}/usr/include/kde3 \ - $OPTS && - make - -} - - #--- ## Select SCM branch. If no parameter is given, it assumes a single scm branch. ## @@ -705,7 +661,21 @@ function prepare_select_branch() { ## Get uppercase spell name with _ instead of - #--- function get_up_spell_name() { - echo ${1:-$SPELL} | tr "a-z-" "A-Z_" + echo ${1:-$SPELL} | tr '.+a-z-' '_XA-Z_' +} + +#--- +## Get branch-based/autoupdate-aware version number +#--- +function get_scm_version() { + local spell=$(get_up_spell_name) && + local spell_branch="${spell}_BRANCH" && + local spell_autoupdate="${spell}_AUTOUPDATE" && + if [ "${!spell_autoupdate}" = "y" ]; then + echo $(date "+%Y%m%d") + else + echo ${!spell_branch:-scm} + fi } # Move SPELL_OPTS to OPTS |