g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead
[glsdk/gstreamer0-10.git] / scripts / gst-uninstalled
1 #!/bin/bash -i
2 #
3 # this script is in git as gstreamer/scripts/gst-uninstalled
4 #
5 # It will set up the environment to use and develop gstreamer and projects
6 # that use gstreamer with an uninstalled git checkout of gstreamer and the
7 # plugin modules.
8 #
9 # It will set up LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PKG_CONFIG_PATH,
10 # GST_PLUGIN_PATH, GST_PLUGIN_SYSTEM_PATH, GST_REGISTRY, MANPATH, PYTHONPATH
11 # to prefer the uninstalled versions but also contain the installed ones.
12 # The only exception to this is, that no system installed plugins will be
13 # used but only the uninstalled ones.
14 #
15 # This script assumes that the relevant modules are checked out one by one
16 # under a given tree specified below in MYGST.
17 #
18 # Symlink this script in a directory in your path (for example $HOME/bin). You
19 # must name the symlink gst-something, where something is the subdirectory
20 # of MYGST that contains your gstreamer module checkouts.
21 #
22 # e.g.:
23 # - mkdir $HOME/gst/head
24 # - ln -sf gst-uninstalled $HOME/bin/gst-head
25 # - checkout copies of gstreamer modules in $HOME/gst/head
26 # - gst-head
28 # This script is run -i so that PS1 doesn't get cleared
30 # Change this variable to the location of your gstreamer git checkouts
31 MYGST=$HOME/gst
33 #
34 # Everything below this line shouldn't be edited!
35 #
37 # extract version from $0
38 # if this script is called "gst-head" then version will be "head"
39 VERSION=`echo $0 | sed s/.*gst-//g`
41 # base path under which dirs are installed
42 GST=$MYGST/$VERSION
43 GST_PREFIX=$GST/prefix
44 if test ! -e $GST; then
45   echo "$GST does not exist !"
46   exit
47 fi
49 # set up a bunch of paths
50 PATH="\
51 $GST/gstreamer/tools:\
52 $GST/gst-plugins-base/tools:\
53 $GST/gst-player/src:\
54 $GST/gst-editor/src:\
55 $GST/gstreamer-sharp/tools:\
56 $GST_PREFIX/bin:\
57 $PATH"
59 # /some/path: makes the dynamic linker look in . too, so avoid this
60 LD_LIBRARY_PATH=$GST_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
61 DYLD_LIBRARY_PATH=$GST_PREFIX/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
63 # GStreamer rtsp server library
64 LD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$LD_LIBRARY_PATH
65 DYLD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$DYLD_LIBRARY_PATH
67 # GStreamer ffmpeg libraries
68 for path in libavformat libavutil libavcodec libpostproc libavdevice
69 do
70    LD_LIBRARY_PATH=$GST/gst-ffmpeg/gst-libs/ext/ffmpeg/$path:$LD_LIBRARY_PATH
71    DYLD_LIBRARY_PATH=$GST/gst-ffmpeg/gst-libs/ext/ffmpeg/$path:$DYLD_LIBRARY_PATH
72 done
74 # GStreamer plugins base libraries
75 for path in app audio cdda fft interfaces pbutils netbuffer riff rtp rtsp sdp tag utils video 
76 do
77   LD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$LD_LIBRARY_PATH
78   DYLD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
79 done
81 # GStreamer core libraries
82 for path in base net check controller dataprotocol
83 do
84   LD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$LD_LIBRARY_PATH
85   DYLD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
86 done
87 LD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$LD_LIBRARY_PATH
88 DYLD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$DYLD_LIBRARY_PATH
89 export LD_LIBRARY_PATH
90 export DYLD_LIBRARY_PATH
91   
92 export PKG_CONFIG_PATH="\
93 $GST_PREFIX/lib/pkgconfig\
94 :$GST/gstreamer/pkgconfig\
95 :$GST/gst-plugins-base/pkgconfig\
96 :$GST/gst-plugins-good/pkgconfig\
97 :$GST/gst-plugins-ugly/pkgconfig\
98 :$GST/gst-plugins-bad/pkgconfig\
99 :$GST/gst-ffmpeg/pkgconfig\
100 :$GST/gst-python/pkgconfig\
101 :$GST/gst-rtsp-server/pkgconfig\
102 :$GST/gstreamer-sharp/pkgconfig\
103 :$GST/farsight2\
104 :$GST/libnice/nice\
105 ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
107 export GST_PLUGIN_PATH="\
108 $GST/gstreamer/plugins\
109 :$GST/gst-plugins-base/ext\
110 :$GST/gst-plugins-base/gst\
111 :$GST/gst-plugins-base/sys\
112 :$GST/gst-plugins-good/ext\
113 :$GST/gst-plugins-good/gst\
114 :$GST/gst-plugins-good/sys\
115 :$GST/gst-plugins-ugly/ext\
116 :$GST/gst-plugins-ugly/gst\
117 :$GST/gst-plugins-ugly/sys\
118 :$GST/gst-plugins-bad/ext\
119 :$GST/gst-plugins-bad/gst\
120 :$GST/gst-plugins-bad/sys\
121 :$GST/gst-ffmpeg/ext\
122 :$GST/gnonlin/gnl\
123 :$GST/gst-openmax\
124 :$GST/gst-plugins-gl/gst\
125 :$GST/plugins\
126 :$GST/farsight2/gst\
127 :$GST/farsight2/transmitters\
128 :$GST/libnice/gst\
129 ${GST_PLUGIN_PATH:+:$GST_PLUGIN_PATH}"
131 # don't use any system-installed plug-ins at all
132 export GST_PLUGIN_SYSTEM_PATH=
133 # set our registry somewhere else so we don't mess up the registry generated
134 # by an installed copy
135 rm -f $GST/gstreamer/registry.xml 2>/dev/null
136 export GST_REGISTRY=$GST/gstreamer/registry.dat
137 # Point at the uninstalled plugin scanner
138 export GST_PLUGIN_SCANNER=$GST/gstreamer/libs/gst/helpers/gst-plugin-scanner
140 # once MANPATH is set, it needs at least an "empty"component to keep pulling
141 # in the system-configured man paths from man.config
142 # this still doesn't make it work for the uninstalled case, since man goes
143 # look for a man directory "nearby" instead of the directory I'm telling it to
144 export MANPATH=$GST/gstreamer/tools:$GST_PREFIX/share/man:$MANPATH
145 pythonver=`python -c "import sys; print sys.version[:3]"`
146 export PYTHONPATH=$GST/gst-python:$GST_PREFIX/lib/python$pythonver/site-packages${PYTHONPATH:+:$PYTHONPATH}
148 # totem-pl-parser
149 export PKG_CONFIG_PATH=$GST/totem-pl-parser:$PKG_CONFIG_PATH
150 export LD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$LD_LIBRARY_PATH
151 export DYLD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$DYLD_LIBRARY_PATH
153 # totem
154 export PATH=$GST/totem/src:$PATH
156 # gstreamer-sharp
157 export MONO_PATH=$GST/gstreamer-sharp/gstreamer-sharp:$MONO_PATH
158 export LD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$LD_LIBRARY_PATH
159 export DYLD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$DYLD_LIBRARY_PATH
161 # gst-qa-system
162 export PYTHONPATH=$GST/gst-qa-system:$PYTHONPATH
163 export PATH=$GST/gst-qa-system/bin:$PATH
165 # if we got a command, run it, else start a shell
166 if test ! -z "$1";
167 then
168   $@
169   exit $?
170 fi
172 # set up prompt to help us remember we're in a subshell, cd to
173 # the gstreamer base dir and start $SHELL
174 cd $GST
175 shell=$SHELL
176 if test "x$SHELL" = "x/bin/bash"
177 then
178   # debian/ubuntu resets our PS1.  bastards.
179   shell="$SHELL --noprofile"
180 fi
181 PS1="[gst-$VERSION] $PS1" $shell