3 # this script is in git as gstreamer/scripts/gst-uninstalled
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
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.
15 # This script assumes that the relevant modules are checked out one by one
16 # under a given tree specified below in MYGST.
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.
23 # - mkdir $HOME/gst/head
24 # - ln -sf gst-uninstalled $HOME/bin/gst-head
25 # - checkout copies of gstreamer modules in $HOME/gst/head
28 # This script is run -i so that PS1 doesn't get cleared
30 if [ -z $GST_UNINSTALLED_ROOT ];
32 # Change this variable to the location of your gstreamer git checkouts
36 # Everything below this line shouldn't be edited!
39 # extract version from $0
40 # if this script is called "gst-head" then version will be "head"
41 VERSION=`echo $0 | sed s/.*gst-//g`
43 # base path under which dirs are installed
46 # Alternatively, you can set the GST_UNINSTALLED_ROOT environment variable to the
47 # location of your checkout and call this script directly.
49 # Ex: GST_UNINSTALLED_ROOT=$HOME/checkout/location gst-uninstalled
51 GST=$GST_UNINSTALLED_ROOT
54 GST_PREFIX=$GST/prefix
55 if test ! -e $GST; then
56 echo "$GST does not exist !"
60 # set up a bunch of paths
62 $GST/gstreamer/tools:\
63 $GST/gst-plugins-base/tools:\
66 $GST/gstreamer-sharp/tools:\
71 # /some/path: makes the dynamic linker look in . too, so avoid this
72 LD_LIBRARY_PATH=$GST_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
73 DYLD_LIBRARY_PATH=$GST_PREFIX/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
74 GI_TYPELIB_PATH=$GST_PREFIX/share/gir-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}
77 LD_LIBRARY_PATH=$GST/orc/orc/.libs:$GST/orc/orc-test/.libs:$LD_LIBRARY_PATH
78 DYLD_LIBRARY_PATH=$GST/orc/orc/.libs:$GST/orc/orc-test/.libs:$DYLD_LIBRARY_PATH
80 # GStreamer rtsp server library
81 LD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$LD_LIBRARY_PATH
82 DYLD_LIBRARY_PATH=$GST/gst-rtsp-server/gst/rtsp-server/.libs:$DYLD_LIBRARY_PATH
83 GI_TYPELIB_PATH=$GST/gst-rtsp-server/gst/rtsp-server:$GI_TYPELIB_PATH
85 # GStreamer Editing Services library
86 LD_LIBRARY_PATH=$GST/gst-editing-services/ges/.libs:$LD_LIBRARY_PATH
87 DYLD_LIBRARY_PATH=$GST/gst-editing-services/ges/.libs:$DYLD_LIBRARY_PATH
88 GI_TYPELIB_PATH=$GST/gst-editing-services/ges:$GI_TYPELIB_PATH
89 PATH=$GST/gst-editing-services/tools:$PATH
91 # GStreamer plugins vaapi libraries
92 LD_LIBRARY_PATH=$GST/gstreamer-vaapi/gst-libs/gst/vaapi/.libs:$LD_LIBRARY_PATH
93 DYLD_LIBRARY_PATH=$GST/gstreamer-vaapi/gst-libs/gst/vaapi/.libs:$DYLD_LIBRARY_PATH
95 # GStreamer plugins base libraries
96 for path in allocators app audio fft gl pbutils riff rtp rtsp sdp tag utils video
98 LD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$LD_LIBRARY_PATH
99 DYLD_LIBRARY_PATH=$GST/gst-plugins-base/gst-libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
100 GI_TYPELIB_PATH=$GST/gst-plugins-base/gst-libs/gst/$path:$GI_TYPELIB_PATH
103 # GStreamer plugins bad libraries
104 for path in adaptivedemux audio basecamerabinsrc codecparsers insertbin interfaces mpegts opencv player uridownloader video wayland
106 LD_LIBRARY_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path/.libs:$LD_LIBRARY_PATH
107 DYLD_LIBRARY_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
108 GI_TYPELIB_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path:$GI_TYPELIB_PATH
110 export GST_HAAR_CASCADES_PATH=$GST/gst-plugins-bad/ext/opencv/
112 # GStreamer core libraries
113 for path in base check controller net
115 LD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$LD_LIBRARY_PATH
116 DYLD_LIBRARY_PATH=$GST/gstreamer/libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
117 GI_TYPELIB_PATH=$GST/gstreamer/libs/gst/$path:$GI_TYPELIB_PATH
119 LD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$LD_LIBRARY_PATH
120 DYLD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$DYLD_LIBRARY_PATH
121 GI_TYPELIB_PATH=$GST/gstreamer/gst:$GI_TYPELIB_PATH
122 export LD_LIBRARY_PATH
123 export DYLD_LIBRARY_PATH
124 export GI_TYPELIB_PATH
126 export PKG_CONFIG_PATH="\
127 $GST_PREFIX/lib/pkgconfig\
128 :$GST/gstreamer/pkgconfig\
129 :$GST/gst-plugins-base/pkgconfig\
130 :$GST/gst-plugins-good/pkgconfig\
131 :$GST/gst-plugins-ugly/pkgconfig\
132 :$GST/gst-plugins-bad/pkgconfig\
133 :$GST/gst-libav/pkgconfig\
134 :$GST/gst-ffmpeg/pkgconfig\
135 :$GST/gst-python/pkgconfig\
136 :$GST/gst-rtsp-server/pkgconfig\
137 :$GST/gst-editing-services/pkgconfig\
138 :$GST/gstreamer-sharp/pkgconfig\
139 :$GST/gstreamer-vaapi/pkgconfig\
143 ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
145 export GST_PLUGIN_PATH="\
146 $GST/gstreamer/plugins\
147 :$GST/gst-plugins-base/ext\
148 :$GST/gst-plugins-base/gst\
149 :$GST/gst-plugins-base/sys\
150 :$GST/gst-plugins-good/ext\
151 :$GST/gst-plugins-good/gst\
152 :$GST/gst-plugins-good/sys\
153 :$GST/gst-plugins-ugly/ext\
154 :$GST/gst-plugins-ugly/gst\
155 :$GST/gst-plugins-ugly/sys\
156 :$GST/gst-plugins-bad/ext\
157 :$GST/gst-plugins-bad/gst\
158 :$GST/gst-plugins-bad/sys\
159 :$GST/gst-libav/ext/\
160 :$GST/gst-ffmpeg/ext/\
161 :$GST/gst-omx/omx/.libs\
162 :$GST/clutter-gst/clutter-gst/.libs\
163 :$GST/gstreamer-vaapi/gst/vaapi/.libs\
166 :$GST/farsight2/transmitters\
168 :$GST/gst-rpicamsrc/src/.libs\
169 :$GST/gst-rtsp-server/gst/rtsp-sink/.libs\
170 :$GST/gst-editing-services/plugins/nle/.libs\
171 ${GST_PLUGIN_PATH:+:$GST_PLUGIN_PATH}"
173 export GST_PRESET_PATH="\
174 $GST/gst-plugins-good/gst/equalizer/\
175 :$GST/gst-plugins-good/gst/equalizer\
176 :$GST/gst-plugins-good/ext/vpx/\
177 :$GST/gst-plugins-ugly/ext/x264\
178 :$GST/gst-plugins-ugly/ext/amrnb\
179 :$GST/gst-plugins-bad/gst/freeverb\
180 :$GST/gst-plugins-bad/ext/voamrwbenc\
181 ${GST_PRESET_PATH:+:$GST_PRESET_PATH}"
183 # don't use any system-installed plug-ins at all
184 export GST_PLUGIN_SYSTEM_PATH=
185 # set our registry somewhere else so we don't mess up the registry generated
186 # by an installed copy
187 rm -f $GST/gstreamer/registry.xml 2>/dev/null
188 export GST_REGISTRY=$GST/gstreamer/registry.dat
189 # Point at the uninstalled plugin scanner
190 export GST_PLUGIN_SCANNER=$GST/gstreamer/libs/gst/helpers/gst-plugin-scanner
191 # Point at the uninstalled PTP helper
192 export GST_PTP_HELPER=$GST/gstreamer/libs/gst/helpers/.libs/gst-ptp-helper
194 # once MANPATH is set, it needs at least an "empty"component to keep pulling
195 # in the system-configured man paths from man.config
196 # this still doesn't make it work for the uninstalled case, since man goes
197 # look for a man directory "nearby" instead of the directory I'm telling it to
198 export MANPATH=$GST/gstreamer/tools:$GST_PREFIX/share/man:$GST/gst-editing-services/docs/man/:$MANPATH
199 if [ -z "$PYTHON" ]; then PYTHON="python3"; fi
200 pythonver=`$PYTHON -c "import sys; print (sys.version[:3])"`
201 pythonsites=`$PYTHON -c "import site; print(':'.join(site.getsitepackages()))"`
202 export PYTHONPATH="${PYTHONPATH}:${pythonsites}:${GST}/gst-python"
205 export PKG_CONFIG_PATH=$GST/clutter-gst:$PKG_CONFIG_PATH
206 export LD_LIBRARY_PATH=$GST/clutter-gst/clutter-gst/.libs:$LD_LIBRARY_PATH
207 export DYLD_LIBRARY_PATH=$GST/clutter-gst/clutter-gst/.libs:$DYLD_LIBRARY_PATH
210 export PKG_CONFIG_PATH=$GST/totem-pl-parser:$PKG_CONFIG_PATH
211 export LD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$LD_LIBRARY_PATH
212 export DYLD_LIBRARY_PATH=$GST/totem-pl-parser/plparse/.libs:$DYLD_LIBRARY_PATH
215 export PATH=$GST/totem/src:$PATH
218 export MONO_PATH=$GST/gstreamer-sharp/gstreamer-sharp:$MONO_PATH
219 export LD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$LD_LIBRARY_PATH
220 export DYLD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$DYLD_LIBRARY_PATH
222 # gst-devtools/validate
223 export PATH=$GST/gst-devtools/validate/tools:$PATH
224 export PKG_CONFIG_PATH=$GST/gst-devtools/validate/pkgconfig:$PKG_CONFIG_PATH
225 export GST_VALIDATE_SCENARIOS_PATH=$GST/gst-devtools/validate/data/scenarios:$GST_VALIDATE_SCENARIOS_PATH
226 export GST_VALIDATE_APPS_DIR=$GST_VALIDATE_APPS_DIR:$GST/gst-editing-services/tests/validate/
227 export GST_VALIDATE_PLUGIN_PATH=$GST_VALIDATE_PLUGIN_PATH:$GST/gst-devtools/validate/plugins/
228 export GIO_EXTRA_MODULES=$GST/prefix/lib/gio/modules:$GIO_EXTRA_MODULES
230 if [ -d "$GST/gst-libav" -a -d "$GST/gst-ffmpeg" ]; then
232 echo "====================================================================="
233 echo " You have both an uninstalled gst-ffmpeg checkout and a gst-libav"
234 echo " checkout. You need to remove one of those. You should remove"
236 echo " $GST/gst-ffmpeg"
238 echo " since gst-libav replaces gst-ffmpeg."
239 echo "====================================================================="
243 # if we got a command, run it, else start a shell
250 # set up prompt to help us remember we're in a subshell, cd to
251 # the gstreamer base dir and start $SHELL
254 if test "x$SHELL" = "x/bin/bash"
256 # debian/ubuntu resets our PS1. bastards.
257 shell="$SHELL --noprofile"
259 PS1="[gst-$VERSION] $PS1" $shell