summaryrefslogtreecommitdiff
path: root/scripts/gst-uninstalled
blob: ad59dd11ad34c4a41d9ead98738a5e13466aec18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#!/bin/bash -i
#
# this script is in git as gstreamer/scripts/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

if [ -z $GST_UNINSTALLED_ROOT ];
then
    # 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
else
    # Alternatively, you can set the GST_UNINSTALLED_ROOT environment variable to the
    # location of your checkout and call this script directly.
    #
    # Ex: GST_UNINSTALLED_ROOT=$HOME/checkout/location gst-uninstalled

    GST=$GST_UNINSTALLED_ROOT
fi

GST_PREFIX=$GST/prefix
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/gstreamer-sharp/tools:\
$GST/orc/tools:\
$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}
GI_TYPELIB_PATH=$GST_PREFIX/share/gir-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}

# ORC
LD_LIBRARY_PATH=$GST/orc/orc/.libs:$GST/orc/orc-test/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/orc/orc/.libs:$GST/orc/orc-test/.libs:$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
GI_TYPELIB_PATH=$GST/gst-rtsp-server/gst/rtsp-server:$GI_TYPELIB_PATH

# GStreamer Editing Services library
LD_LIBRARY_PATH=$GST/gst-editing-services/ges/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gst-editing-services/ges/.libs:$DYLD_LIBRARY_PATH
GI_TYPELIB_PATH=$GST/gst-editing-services/ges:$GI_TYPELIB_PATH
PATH=$GST/gst-editing-services/tools:$PATH

# GStreamer plugins vaapi libraries
LD_LIBRARY_PATH=$GST/gstreamer-vaapi/gst-libs/gst/vaapi/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gstreamer-vaapi/gst-libs/gst/vaapi/.libs:$DYLD_LIBRARY_PATH

# GStreamer plugins base libraries
for path in allocators app audio fft pbutils 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
  GI_TYPELIB_PATH=$GST/gst-plugins-base/gst-libs/gst/$path:$GI_TYPELIB_PATH
done

# GStreamer plugins bad libraries
for path in basecamerabinsrc codecparsers uridownloader egl gl insertbin interfaces mpegts video base
do
  LD_LIBRARY_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path/.libs:$LD_LIBRARY_PATH
  DYLD_LIBRARY_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path/.libs:$DYLD_LIBRARY_PATH
  GI_TYPELIB_PATH=$GST/gst-plugins-bad/gst-libs/gst/$path:$GI_TYPELIB_PATH
done

# GStreamer core libraries
for path in base check controller net
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
  GI_TYPELIB_PATH=$GST/gstreamer/libs/gst/$path:$GI_TYPELIB_PATH
done
LD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$GST/gstreamer/gst/.libs:$DYLD_LIBRARY_PATH
GI_TYPELIB_PATH=$GST/gstreamer/gst:$GI_TYPELIB_PATH
export LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
export GI_TYPELIB_PATH
  
export PKG_CONFIG_PATH="\
$GST_PREFIX/lib/pkgconfig\
:$GST/gstreamer/pkgconfig\
:$GST/gst-plugins-base/pkgconfig\
:$GST/gst-plugins-good/pkgconfig\
:$GST/gst-plugins-ugly/pkgconfig\
:$GST/gst-plugins-bad/pkgconfig\
:$GST/gst-libav/pkgconfig\
:$GST/gst-ffmpeg/pkgconfig\
:$GST/gst-python/pkgconfig\
:$GST/gst-rtsp-server/pkgconfig\
:$GST/gst-editing-services/pkgconfig\
:$GST/gstreamer-sharp/pkgconfig\
:$GST/gstreamer-vaapi/pkgconfig\
:$GST/orc\
:$GST/farsight2\
:$GST/libnice/nice\
${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

export GST_PLUGIN_PATH="\
$GST/gstreamer/plugins\
:$GST/gst-plugins-base/ext\
:$GST/gst-plugins-base/gst\
:$GST/gst-plugins-base/sys\
:$GST/gst-plugins-good/ext\
:$GST/gst-plugins-good/gst\
:$GST/gst-plugins-good/sys\
:$GST/gst-plugins-ugly/ext\
:$GST/gst-plugins-ugly/gst\
:$GST/gst-plugins-ugly/sys\
:$GST/gst-plugins-bad/ext\
:$GST/gst-plugins-bad/gst\
:$GST/gst-plugins-bad/sys\
:$GST/gst-libav/ext/\
:$GST/gst-ffmpeg/ext/\
:$GST/gnonlin/gnl/.libs\
:$GST/gst-omx/omx/.libs\
:$GST/clutter-gst/clutter-gst/.libs\
:$GST/gstreamer-vaapi/gst/vaapi/.libs\
:$GST/plugins\
:$GST/farsight2/gst\
:$GST/farsight2/transmitters\
:$GST/libnice/gst\
:$GST/gst-rpicamsrc/src/.libs\
${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
rm -f $GST/gstreamer/registry.xml 2>/dev/null
export GST_REGISTRY=$GST/gstreamer/registry.dat
# Point at the uninstalled plugin scanner
export GST_PLUGIN_SCANNER=$GST/gstreamer/libs/gst/helpers/gst-plugin-scanner

# 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
if [ -z "$PYTHON" ]; then PYTHON="python"; fi
pythonver=`$PYTHON -c "import sys; print (sys.version[:3])"`
pythonsites=`$PYTHON -c "import site; print(':'.join(site.getsitepackages()))"`
export PYTHONPATH="${PYTHONPATH}:${pythonsites}:${GST}/gst-python"

# clutter-gst
export PKG_CONFIG_PATH=$GST/clutter-gst:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$GST/clutter-gst/clutter-gst/.libs:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$GST/clutter-gst/clutter-gst/.libs:$DYLD_LIBRARY_PATH

# 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

# gstreamer-sharp
export MONO_PATH=$GST/gstreamer-sharp/gstreamer-sharp:$MONO_PATH
export LD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$GST/gstreamer-sharp/gstreamer-sharp/glue/.libs:$DYLD_LIBRARY_PATH

# gst-devtools/validate
export PATH=$GST/gst-devtools/validate/tools:$PATH
export PKG_CONFIG_PATH=$GST/gst-devtools/validate/pkgconfig:$PKG_CONFIG_PATH
export GST_VALIDATE_SCENARIOS_PATH=$GST/gst-devtools/validate/data:$GST_VALIDATE_SCENARIOS_PATH

if [ -d "$GST/gst-libav" -a -d "$GST/gst-ffmpeg" ]; then
  echo
  echo "====================================================================="
  echo " You have both an uninstalled gst-ffmpeg checkout and a gst-libav"
  echo " checkout. You need to remove one of those. You should remove"
  echo
  echo "   $GST/gst-ffmpeg"
  echo
  echo " since gst-libav replaces gst-ffmpeg."
  echo "====================================================================="
  echo
fi

# 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