summaryrefslogtreecommitdiff
path: root/git-compiz
diff options
context:
space:
mode:
authoromega <omega@omg.(none)>2009-03-20 09:40:21 +0100
committeromega <omega@omg.(none)>2009-03-20 09:40:21 +0100
commit5706f354fcb245e633df467e027311947382bc05 (patch)
tree8d71fc911737c847ef77974a1587ecb8d30a73fd /git-compiz
parent1ce2db9339071c4b376ca32d7b2ebeeb85a36e35 (diff)
downloadscripts-5706f354fcb245e633df467e027311947382bc05.tar.gz
scripts-5706f354fcb245e633df467e027311947382bc05.tar.bz2
Fixed bugs + updated lang + opencv uses build_wrapper
Diffstat (limited to 'git-compiz')
-rwxr-xr-xgit-compiz90
1 files changed, 29 insertions, 61 deletions
diff --git a/git-compiz b/git-compiz
index 0718672..4aecfc5 100755
--- a/git-compiz
+++ b/git-compiz
@@ -469,10 +469,18 @@ build_clean()
{
# CPWD is taken from build_wrapper
cd $1
-if [ -d build -a -d cmake ]; then
+printinfo info $INFO_CLEAN;
+logcmd echo
+if [ -d build -a -f CMakeLists.txt ]; then
rm -rf build &> /dev/null
fi
logcmd make clean
+if [ $? -ne 0 ]; then
+ printinfo error $ERROR_CLEAN;
+ printinfo space
+ cd $CPWD
+ return 1
+fi
cd $CPWD
}
## End prebuild functions
@@ -497,21 +505,23 @@ fi
cd $CPWD
}
-# cmake build function
+# cmake buiINFO_CLEANld function
# $1 == Git object currently being handled
+# $2 == cmake arguments
build_cmake()
{
# CPWD is taken from build_wrapper
printinfo info $INFO_CONFIGURE;
logcmd echo
+cd $1
mkdir build
cd build
if [ $LIBDIR == "lib64" ]; then
logcmd env PKG_CONFIG_PATH=$DESTDIR$PREFIX/$LIBDIR/pkgconfig:$DESTDIR$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH \
- cmake -D CMAKE_INSTALL_PREFIX=$PREFIX -D LIB_SUFFIX=64 $CPWD/$1
+ cmake -D CMAKE_INSTALL_PREFIX=$PREFIX -D LIB_SUFFIX=64 $2 $CPWD/$1
else
logcmd env PKG_CONFIG_PATH=$DESTDIR$PREFIX/$LIBDIR/pkgconfig:$DESTDIR$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH \
- cmake -D CMAKE_INSTALL_PREFIX=$PREFIX $CPWD/$1
+ cmake -D CMAKE_INSTALL_PREFIX=$PREFIX $2 $CPWD/$1
fi
cd $CPWD/$1
if [ $? -ne 0 ]; then
@@ -526,7 +536,6 @@ cd $CPWD
# make build function
# $1 == Git object currently being handled
-# $2 == cmake/automake
build_make()
{
# CPWD is taken from build_wrapper
@@ -534,7 +543,7 @@ cd $1
printinfo info $INFO_COMPILE
logcmd echo
# If this is cmake, move to and STAY in build/
-if [ x$2 == x"cmake" ]; then
+if [ -f CMakeLists.txt ]; then
cd build
fi
logcmd env PKG_CONFIG_PATH=$DESTDIR$PREFIX/$LIBDIR/pkgconfig:$DESTDIR$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH make -j$JOBS
@@ -547,7 +556,7 @@ fi
printinfo info $INFO_INSTALL;
logcmd echo
-if [ -f autogen.sh ] || [ -d cmake ]; then
+if [ -f autogen.sh ] || [ -f CMakeLists.txt ]; then
root env BUILD_GLOBAL=true \
PKG_CONFIG_PATH=$DESTDIR$PREFIX/$LIBDIR/pkgconfig:$DESTDIR$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH \
make ${DESTDIR:+ DESTDIR=\"$DESTDIR\"} install
@@ -579,7 +588,7 @@ printinfo space
# Build wrapper function
# $1 == Git object currently being handled
-# $2 == autogen arguments
+# $2 == autogen/cmake arguments
# $3 == Custom command to build
build_wrapper()
{
@@ -600,17 +609,17 @@ if [ ! -d $1 ]; then
fi
# Export pkgconfig variables
export PKG_CONFIG_PATH=$DESTDIR$PREFIX/$LIBDIR/pkgconfig:$DESTDIR$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH
-if [ -d $1/cmake ] && ! (cat $1/Makefile 2>/dev/null | grep -q 'Compiz plugin Makefile'); then
- build_clean $1
- build_cmake $1
- build_make $1 $2
+if [ -f $1/CMakeLists.txt ] && ! (cat $1/Makefile 2>/dev/null | grep -q 'Compiz plugin Makefile'); then
+ build_clean "$1"
+ build_cmake "$1" "$2"
+ build_make "$1"
elif [ -f $1/autogen.sh ]; then
- build_clean $1
- build_autoconf $1 $2
- build_make $1
+ build_clean "$1"
+ build_autoconf "$1" "$2"
+ build_make "$1"
elif [ -f $1/Makefile ]; then
- build_clean $1
- build_make $1
+ build_clean "$1"
+ build_make "$1"
elif [ -f $1/setup.py ]; then
cd $1
printinfo info $INFO_INSTALL;
@@ -622,7 +631,7 @@ elif [ "$3" != "" ]; then
printinfo info $INFO_INSTALL;
logcmd echo
cd $1
- $3
+ $3 $2
cd $CPWD
printinfo space
else
@@ -654,7 +663,7 @@ else
fi
fi
-build_wrapper $b none "root ./install.sh --prefix=$DESTDIR$PREFIX --$UNOFFICIAL_ICONS_THEME"
+build_wrapper $b "--prefix=$DESTDIR$PREFIX --$UNOFFICIAL_ICONS_THEME" "root ./install.sh"
}
opencv()
@@ -678,48 +687,7 @@ else
fi
fi
-
-cd $b
-printinfo info $INFO_CLEAN;
-logcmd echo
-logcmd make clean
-rm -rf release &> /dev/null
-
-printinfo info $INFO_CONFIGURE;
-logcmd echo
-mkdir release
-cd release
-logcmd cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$PREFIX -D CMAKE_LIB_DIRS_CONFIGCMAKE=$PREFIX/$LIBDIR -D BUILD_PYTHON_SUPPORT=ON ..
-if [ $? -ne 0 ]; then
- printinfo error $ERROR_CONFIGURE;
- printinfo space
- cd $CPWD
- return 1
-fi
-
-printinfo info $INFO_COMPILE;
-logcmd echo
-logcmd make -j$JOBS
-if [ $? -ne 0 ]; then
- printinfo error $ERROR_MAKE;
- printinfo space
- cd $CPWD
- return 1
-fi
-
-if [ "$SKIP_INSTALL" == "true" -o $test -ne 1 ] && [ $FORCE_REBUILT != "true" \
- -a -z "`(for dir in $FORCE_REBUILT; do [ $dir != $1 ] || echo "yes"; done) | grep yes`" ]; then
- printinfo info "${INFO_SKIP//%s/$b}";
- logcmd echo
- printinfo space
- return;
-fi
-
-printinfo info $INFO_INSTALL;
-logcmd echo
-root bash -c "make ${DESTDIR:+ DESTDIR=\"$DESTDIR\"} install; ldconfig"
-cd $CPWD
-printinfo space
+build_wrapper $b "-D CMAKE_BUILD_TYPE=RELEASE -D BUILD_PYTHON_SUPPORT=ON"
}
## Support for Suse/Fedora x64