gstreamer/docs/faq/gst-uninstalled
Tim-Philipp Müller a1549d67de gst-uninstalled: add gst-rtsp-server bits and break up overly long lines
Add some of the bits needed for an uninstalled gst-rtsp-server (so gdb works
on the examples etc.). Python bits are still missing, and we might need an
-uninstalled.pc file as well in the future. Break up very long lines to make
them easier to read and maintain. Also remove gst-plugins paths from the
old days.
2009-03-19 10:49:30 +00:00

150 lines
4.9 KiB
Bash
Executable file

#!/bin/bash -i
#
# this script is in git as gstreamer/docs/faq/gst-uninstalled
#
# It will set up the environment to use and develop gstreamer and projects
# that use gstreamer with an uninstalled git checkout of gstreamer and the
# plugin modules.
#
# It will set up LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PKG_CONFIG_PATH,
# GST_PLUGIN_PATH, GST_PLUGIN_SYSTEM_PATH, GST_REGISTRY, MANPATH, PYTHONPATH
# to prefer the uninstalled versions but also contain the installed ones.
# The only exception to this is, that no system installed plugins will be
# used but only the uninstalled ones.
#
# This script assumes that the relevant modules are checked out one by one
# under a given tree specified below in MYGST.
#
# Symlink this script in a directory in your path (for example $HOME/bin). You
# must name the symlink gst-something, where something is the subdirectory
# of MYGST that contains your gstreamer module checkouts.
#
# e.g.:
# - mkdir $HOME/gst/head
# - ln -sf gst-uninstalled $HOME/bin/gst-head
# - checkout copies of gstreamer modules in $HOME/gst/head
# - gst-head
# This script is run -i so that PS1 doesn't get cleared
# Change this variable to the location of your gstreamer git checkouts
MYGST=$HOME/gst
#
# Everything below this line shouldn't be edited!
#
# extract version from $0
# if this script is called "gst-head" then version will be "head"
VERSION=`echo $0 | sed s/.*gst-//g`
# base path under which dirs are installed
GST=$MYGST/$VERSION
if test ! -e $GST; then
echo "$GST does not exist !"
exit
fi
# set up a bunch of paths
PATH="\
$GST/gstreamer/tools:\
$GST/gst-plugins-base/tools:\
$GST/gst-player/src:\
$GST/gst-editor/src:\
$GST/prefix/bin:\
$PATH"
# /some/path: makes the dynamic linker look in . too, so avoid this
LD_LIBRARY_PATH=$GST/prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
DYLD_LIBRARY_PATH=$GST/prefix/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
# GStreamer rtsp server library
LD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$DYLD_LIBRARY_PATH
# GStreamer ffmpeg libraries
for path in libavformat libavutil libavcodec libpostproc libavdevice
do
LD_LIBRARY_PATH=$GST/gst-ffmpeg/gst-libs/ext/ffmpeg/$path:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gst-ffmpeg/gst-libs/ext/ffmpeg/$path:$DYLD_LIBRARY_PATH
done
# GStreamer plugins base libraries
for path in app audio cdda fft interfaces pbutils netbuffer riff rtp rtsp sdp tag utils video
do
LD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
done
# GStreamer core libraries
for path in base net check controller dataprotocol
do
LD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
done
LD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
export PKG_CONFIG_PATH="\
$GST/prefix/lib/pkgconfig\
:$GST/gstreamer/pkgconfig\
:$GST/gst-plugins-base/pkgconfig\
:$GST/gst-plugins-good/pkgconfig\
:$GST/gst-python/pkgconfig\
:$GST/gst-rtsp-server/pkgconfig\
${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export GST_PLUGIN_PATH="\
$GST/gstreamer\
:$GST/gst-plugins-base\
:$GST/gst-plugins-good\
:$GST/gst-plugins-ugly\
:$GST/gst-plugins-bad\
:$GST/gst-ffmpeg\
:$GST/gnonlin\
:$GST/gst-openmax\
:$GST/gst-plugins-gl\
:$GST/plugins\
${GST_PLUGIN_PATH:+:$GST_PLUGIN_PATH}"
# don't use any system-installed plug-ins at all
export GST_PLUGIN_SYSTEM_PATH=
# set our registry somewhere else so we don't mess up the registry generated
# by an installed copy
export GST_REGISTRY=$GST/gstreamer/registry.xml
# once MANPATH is set, it needs at least an "empty"component to keep pulling
# in the system-configured man paths from man.config
# this still doesn't make it work for the uninstalled case, since man goes
# look for a man directory "nearby" instead of the directory I'm telling it to
export MANPATH=$GST/gstreamer/tools:$GST/prefix/share/man:$MANPATH
pythonver=`python -c "import sys; print sys.version[:3]"`
export PYTHONPATH=$GST/gst-python:$GST/prefix/lib/python$pythonver/site-packages${PYTHONPATH:+:$PYTHONPATH}
# totem-pl-parser
export PKG_CONFIG_PATH=$GST/totem-pl-parser:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$DYLD_LIBRARY_PATH
# totem
export PATH=$GST/totem/src:$PATH
# if we got a command, run it, else start a shell
if test ! -z "$1";
then
$@
exit $?
fi
# set up prompt to help us remember we're in a subshell, cd to
# the gstreamer base dir and start $SHELL
cd $GST
shell=$SHELL
if test "x$SHELL" == "x/bin/bash"
then
# debian/ubuntu resets our PS1. bastards.
shell="$SHELL --noprofile"
fi
PS1="[gst-$VERSION] $PS1" $shell