Commit 4df91104 authored by Brendan Long's avatar Brendan Long

Merge pull request #3 from cablelabs/introspection-and-branch-updates

Adding --introspection argument to build GStreamer with introspection su...
parents 61b8af5b d841074f
......@@ -13,7 +13,7 @@ the `--no-deps` argument.
## Easy Mode
If you don't care how this works and just want a copy of GStreamer from git,
If you don't care how this works and just want a copy of GStreamer from git with ruih/master branches checked out,
run this:
mkdir -p ~/bin ~/gst
......@@ -36,7 +36,7 @@ If you want to update your repos, do:
git pull # In case this repo has changed
./build.sh --reconfigure --no-deps
You will now have the main GStreamer repos checked out in ~/gst/git. The
You will now have the main GStreamer repos ruih/master branches checked out in ~/gst/git. The
script will do rebase merges, and will leave the repos on whatever branch
you set them to, so feel free to switch branches or change the "origin".
......@@ -60,6 +60,7 @@ First, look at the usage information from `./build.sh -h`:
> --no-deps Don't install dependencies before building.
> --reconfigure Force a reconfigure, even if a Makefile already exists.
> --upstream Clone from upstream where possible, instead of our repos (you probably don't want to do this).
> --introspection Enable introspection
In general, you will want to run with the default arguments, but `--no-update`
can be useful if you just want to build everything, but don't want it to switch
......@@ -69,6 +70,8 @@ way to check if dependencies are installed is to attempt to install them).
`--upstream` exists because it's convenient in certain cases, but most likely
you shouldn't use it.
If you don't specify --no-update and also don't specify a --branch argument, your current branches will be switched over to ruih/master.
## Setup
Make sure you check this repo out as ~/gst/$name (~/gst/git for example).
......@@ -106,3 +109,5 @@ commands with gst-git. For example, building and running WebKit:
gst-git Tools/Scripts/build-webkit --qt --video-track
gst-git Tools/Scripts/run-launcher --qt
Also note that when using the gst-uninstalled environment, libraries dependent on gstreamer libraries will include incorrect dependency_libs entries in the installed .la files. Removing the installed .la file or updating the paths in dependency_libs should resolve any link-time issues.
#!/bin/bash -e
unset BRANCH
function setBranch {
local result="${DEFAULT_BRANCH}"
#if no branch was specified
if [ -z "${DEFAULT_BRANCH}" ]; then
#if usestream was specified but there is no upstream module, use ruih
if $USE_UPSTREAM ; then
if [[ "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
result=ruih/master
else
result=master
fi
# if usestream was not specified, use ruih
else
result=ruih/master
fi
fi
echo $result
}
unset DEFAULT_BRANCH
DELIBTOOLIZE=true
INSTALL_DEPS=true
RECONFIGURE=false
UPDATE_MODULES=true
USE_UPSTREAM=false
VERBOSE=false
INSTROSPECTION=false
errors=
while true; do
case "$1" in
-h | --help )
echo "usage: $0 [-h | --help ] [-v | --verbose] [--no-update] [--no-deps] [--upstream]"
echo "usage: $0 [-h | --help ] [-v | --verbose] [--no-update] [--no-deps] [--upstream] [--introspection]"
echo " -h | --help Print this help message."
echo " --branch [branch] The branch to check out."
echo " --no-delibtoolize Don't alter pkg-config files to remove libtool dependency."
......@@ -21,14 +42,16 @@ while true; do
echo " --no-deps Don't install dependencies before building."
echo " --reconfigure Force a reconfigure, even if a Makefile already exists."
echo " --upstream Clone from upstream where possible, instead of our repos (you probably don't want to do this)."
echo " --introspection Enable introspection"
exit;;
-v | --verbose ) VERBOSE=true; shift ;;
--branch ) shift; BRANCH=$1 ; shift ;;
--branch ) shift; DEFAULT_BRANCH=$1 ; shift ;;
--no-delibtoolize ) DELIBTOOLIZE=false ; shift ;;
--no-update ) UPDATE_MODULES=false; shift ;;
--no-deps ) INSTALL_DEPS=false; shift ;;
--reconfigure ) RECONFIGURE=true; shift ;;
--upstream ) USE_UPSTREAM=true; shift ;;
--introspection ) INTROSPECTION=true; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
......@@ -108,6 +131,7 @@ echo Restoring libtoolized pkgconfig files
find . -name '*-uninstalled.pc' -exec sed -i -e 's/\.libs\/\(libgst.\+\).so$/\1\.la/' {} \;
for module in ${GST_MODULES[@]} ; do
unset MODULE_BRANCH
if [ "$module" == "orc" ] ; then
GST_PREFIX=""
else
......@@ -115,19 +139,22 @@ for module in ${GST_MODULES[@]} ; do
fi
# Clone or update the repo
if [ ! -d "$module" ] ; then
echo "Cloning [$module]"
if [[ "${GITHUB_MODULES[@]}" == *"$module"* ]]; then
echo "Cloning [$module] from git@github.com:cablelabs/${module}.git"
if ! git clone "git@github.com:cablelabs/${module}.git" ; then
errors="$errors\nUnable to clone ${module} over SSH, using HTTPS instead."
git clone "https://github.com/cablelabs/${module}.git"
fi
cd $module
else
echo "Cloning [$module] from git://anongit.freedesktop.org/git/gstreamer/$module"
git clone "git://anongit.freedesktop.org/git/gstreamer/$module"
cd $module
fi
MODULE_BRANCH=$(setBranch $module)
echo "Checking out branch $MODULE_BRANCH"
git checkout $MODULE_BRANCH || errors="$errors\nUnable to checkout branch: $MODULE_BRANCH for repo $module"
elif $UPDATE_MODULES ; then
echo "Updating [$module]"
cd $module
# This file is updated automatically by configure, and we don't care about it.
......@@ -135,22 +162,19 @@ for module in ${GST_MODULES[@]} ; do
git update-index --assume-unchanged win32/common/config.h
fi
echo "Fetching origin for [$module]"
git fetch origin || errors="$errors\nUnable to update remote: origin"
if [ -n "BRANCH" ]; then
if [[ "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
BRANCH=master
else
BRANCH=ruih/master
fi
fi
MODULE_BRANCH=$(setBranch $module)
# -p means "don't remove merges"
git rebase -p origin/$BRANCH $BRANCH || errors="$errors\nUnable to rebase local branch $BRANCH onto remote branch origin/$BRANCH for repo $module"
# requires the branch to be previously checked out
echo "Rebasing to origin/$MODULE_BRANCH"
git rebase -p origin/$MODULE_BRANCH $MODULE_BRANCH || errors="$errors\nUnable to rebase local branch $MODULE_BRANCH onto remote branch origin/$MODULE_BRANCH for repo $module"
else
cd $module
if [ -n "$BRANCH" ] ; then
git checkout $BRANCH || errors="$errors\nUnable to checkout branch: $BRANCH for repo $module"
if [ -n "$DEFAULT_BRANCH" ] ; then
echo "Checking out branch $DEFAULT_BRANCH"
git checkout $DEFAULT_BRANCH || errors="$errors\nUnable to checkout branch: $DEFAULT_BRANCH for repo $module"
fi
fi
if [[ ! "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
......@@ -176,7 +200,11 @@ for module in ${GST_MODULES[@]} ; do
if [ -f Makefile ] ; then
make -s clean || true
fi
$GST_PREFIX ./autogen.sh --disable-failing-tests --disable-examples -q
if $INTROSPECTION ; then
$GST_PREFIX ./autogen.sh --disable-failing-tests --disable-examples --enable-introspection -q
else
$GST_PREFIX ./autogen.sh --disable-failing-tests --disable-examples -q
fi
fi
echo "Building [$module]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment