summaryrefslogtreecommitdiff
path: root/compiz-fusion-git-build
diff options
context:
space:
mode:
Diffstat (limited to 'compiz-fusion-git-build')
-rwxr-xr-xcompiz-fusion-git-build110
1 files changed, 110 insertions, 0 deletions
diff --git a/compiz-fusion-git-build b/compiz-fusion-git-build
new file mode 100755
index 0000000..ce1347a
--- /dev/null
+++ b/compiz-fusion-git-build
@@ -0,0 +1,110 @@
+#!/bin/bash
+# Compiz Fusion Git Build Script
+
+### DO NOT EDIT BELOW THIS LINE ###
+
+source $(dirname ${0})/compiz-fusion-git-functions
+source $(dirname ${0})/compiz-fusion-git-config
+
+# Calculate the packages we will be building
+
+COMPIZ=$(remove_unwanted_packages ${COMPIZ[*]})
+FUSION=$(remove_unwanted_packages ${FUSION[*]})
+MISC=$(remove_unwanted_packages ${MISC[*]})
+LIBS=$(remove_unwanted_packages ${LIBS[*]})
+CONFIG=$(remove_unwanted_packages ${CONFIG[*]})
+DECORATORS=$(remove_unwanted_packages ${DECORATORS[*]})
+PLUGIN_CONTAINERS=$(remove_unwanted_packages ${PLUGIN_CONTAINERS[*]})
+PLUGINS=$(remove_unwanted_packages ${PLUGINS[*]})
+
+ALL="${COMPIZ} ${FUSION} ${MISC} ${LIBS} ${CONFIG} ${DECORATORS} ${PLUGIN_CONTAINERS} ${PLUGINS}"
+
+## Build Process
+
+# We need a dir so that we can track the files installed
+if [[ ! -d $GIT_LOCATION/.file_list ]]; then
+ mkdir -p $GIT_LOCATION/.file_list
+fi
+
+cd $GIT_LOCATION
+
+function build() {
+ for x in "$@"
+ do
+ # We're in $ALL, we're building this package
+ if [[ $(echo $ALL | grep -o $x) == $x ]]; then
+ ALL=$(echo $ALL | sed "s/$x//") # Remove $x from $ALL
+ if [[ ! -e $x ]]; then
+ die '*** ERROR: Package has not been checked out: '${x}''
+ fi
+
+ echo "==> Building: '$x'"
+
+ # Cleanup
+ $BUILD_SUDO rm -rf .${x}_install .${x}_build
+
+ # Create a tmp dir, so we don't screw up the checkout
+ cp -a $x .${x}_build
+ cd .${x}_build
+
+ BUILD_ARGS=""
+ if [[ $x == "compiz" ]]; then
+ BUILD_ARGS=${BUILD_COMPIZ_ARGS}
+ fi
+
+ if [[ -e autogen.sh ]]; then
+ # Run autogen.sh and make
+ echo "./autogen.sh --prefix=${BUILD_PREFIX}"
+ ./autogen.sh --prefix=${BUILD_PREFIX} ${BUILD_ARGS} || die '*** ERROR: Package failed to run autogen.sh: '${x}''
+
+ # We don't have autogen.sh, if we don't have a makefile, we can't build, this is a psuedo else
+ elif [[ ! -e Makefile ]]; then
+ die '*** ERROR: Package does not have a proper build system: '${x}''
+ fi
+
+ # Run make
+ make || die '*** ERROR: Package failed to run make: '$x''
+
+ # Run make install, and install to a tmp location
+ # Not working, real DESTDIR should be DESTDIR="${GIT_LOCATION}/.${x}_install"
+ $BUILD_SUDO make install || die '*** ERROR: Package failed to run make install: '${x}''
+
+ cd ../
+
+# # Remove old installation
+# if [[ -e .file_list/$x ]]; then
+# $BUILD_SUDO rm -rf $(<.file_list/$x)
+# fi
+#
+# # Create list of new files
+# rm -f .file_list/$x
+#
+# cd .${x}_install
+# find -depth -type d -empty -delete
+# tar cvf /dev/null * | sort | sed 's/^/\//' > ../.file_list/$x
+#
+# # Install
+# for y in *
+# do
+# # We are copying from the tmp install to /
+# $BUILD_SUDO cp -a ${y} /${y}
+# doneDESTDIR="${GIT_LOCATION}/.${x}_install
+# cd ../
+#
+ # Cleanup
+ $BUILD_SUDO rm -rf .${x}_install .${x}_build
+ else
+ echo '* Warning: Package is not supposed to be built, but build was called for it '${x}''
+ fi
+ done
+}
+
+# Build some packages in order, or else it will fail to build
+build "compiz" "bcop" "libcompizconfig" "compizconfig-python" "ccsm"
+
+# Build the rest - The previous packages were removed from $ALL
+build ${ALL}
+
+echo "Compiz Fusion has been built"
+exit 0
+