summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS138
1 files changed, 60 insertions, 78 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index c0fc73cf66..55bef4fbda 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -2,6 +2,30 @@
. $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"
+ cd $SOURCE_DIRECTORY &&
+ QMAKEPATH="$QT5DIR/bin"
+# in some cases, we set a symlink to python in the source directory
+ PATH="$QMAKEPATH:$SOURCE_DIRECTORY:$PATH"
+ qmake PREFIX=$QT5DIR $OPTS *.pro &&
+ make
+}
+
+
#---------------------------------------------------------------------
## This function automatically fixes any known bad paths
#---------------------------------------------------------------------
@@ -426,31 +450,31 @@ function unpack_file() {
}
#-------------------------------------------------------------------------
-## Default build for Python spell.
+## Default build for Python2 spell.
#-------------------------------------------------------------------------
function default_build_python() {
- python 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() {
- python 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/" "$@"
}
#-------------------------------------------------------------------------
@@ -497,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
}
@@ -532,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.
@@ -627,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.
##
@@ -693,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