gst-uninstalled: add gst-libav to pkg-config path
[platform/upstream/gstreamer.git] / scripts / create-uninstalled-setup.sh
1 #!/bin/sh
2 # ----------------------------------------------------------------------------
3 #
4 # create-uninstalled-setup.sh
5 #
6 # Little shell script that creates a fresh GStreamer uninstalled setup in
7 # your home directory.
8 #
9 # ----------------------------------------------------------------------------
10 #
11 # Copyright (C) 2011-2012 Tim-Philipp Muller <tim centricular net>
12 #
13 # This script is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Library General Public
15 # License as published by the Free Software Foundation; either
16 # version 2 of the License, or (at your option) any later version.
17 #
18 # This library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # Library General Public License for more details.
22 #
23 # You should have received a copy of the GNU Library General Public
24 # License along with this library; if not, write to the
25 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
26 # Boston, MA 02110-1301, USA.
27 #
28 # ----------------------------------------------------------------------------
29
30 set -e
31
32 # set BRANCH to "0.10" for a GStreamer 0.10.x checkout
33 BRANCH="master"
34
35 # set to "ssh" if you have a developer account and ssh access
36 GIT_ACCESS="anongit"
37
38 # git modules to clone
39 MODULES="gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad"
40
41 if test "$BRANCH" != "0.10"; then
42   MODULES="$MODULES gst-libav"
43 else
44   MODULES="$MODULES gst-ffmpeg"
45 fi
46
47 # note: we use ~/gst because that's what the gst-uninstalled script
48 # uses by default, so don't just change that to something else
49 UNINSTALLED_ROOT=~/gst
50
51 echo "==========================================================================================="
52 echo "Creating new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT ... "
53 echo "==========================================================================================="
54
55 mkdir -p $UNINSTALLED_ROOT
56 mkdir -p $UNINSTALLED_ROOT/$BRANCH
57
58 mkdir -p $UNINSTALLED_ROOT/$BRANCH/prefix
59
60
61 echo ""
62 echo "Checking basic build tools and dependencies are installed..."
63 echo ""
64
65 if ! pkg-config --version 2>/dev/null >/dev/null; then
66   DEPS_OK="no"
67 elif ! pkg-config --exists glib-2.0 orc-0.4 2>/dev/null >/dev/null; then
68   DEPS_OK="no"
69 elif ! bison --version 2>/dev/null >/dev/null; then
70   DEPS_OK="no"
71 elif ! flex --version 2>/dev/null >/dev/null; then
72   DEPS_OK="no"
73 else
74   DEPS_OK="yes"
75 fi
76
77 if test "$DEPS_OK" != "yes"; then
78 echo "==========================================================================================="
79 echo ""
80 echo "  Some very basic build tools or dependencies are missing."
81 echo ""
82 echo "  Please visit"
83 echo ""
84 echo "      http://gstreamer.freedesktop.org/wiki/BuildDependenciesDebianUbuntu"
85 echo ""
86 echo "         or"
87 echo ""
88 echo "      http://gstreamer.freedesktop.org/wiki/Fedora"
89 echo ""
90 echo "  for instructions how to install them."
91 echo ""
92 echo "==========================================================================================="
93 fi
94
95
96 cd $UNINSTALLED_ROOT/$BRANCH
97
98 for m in $MODULES
99 do
100   if test "$GIT_ACCESS" = "ssh"; then
101     git clone ssh://git.freedesktop.org/git/gstreamer/$m
102   else
103     git clone git://anongit.freedesktop.org/gstreamer/$m
104   fi
105
106   cd $m
107   if test "$BRANCH" != "master"; then
108     git checkout -b $BRANCH origin/$BRANCH
109   fi
110   cd ..
111 done
112
113 cd $UNINSTALLED_ROOT
114 ln -s $BRANCH/gstreamer/scripts/gst-uninstalled gst-$BRANCH
115 chmod +x gst-$BRANCH
116
117 cd ~
118
119 echo "==========================================================================================="
120 echo
121 echo "Done. Created new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT"
122 echo
123 echo "To enter the uninstalled environment do: cd $UNINSTALLED_ROOT; ./gst-$BRANCH"
124 echo
125 echo "To leave the uninstalled environment do: exit"
126 echo
127 echo "To check the uninstalled environment do: printenv | grep GST"
128 echo "    (loads of output = you're in the uninstalled environment)"
129 echo
130 echo "==========================================================================================="
131 echo
132 echo "Now compile all GStreamer modules one by one by first switching into"
133 echo "the uninstalled environment and then doing:"
134 echo
135 echo "    cd <MODULE>; ./autogen.sh; make"
136 echo
137 echo "First gstreamer, then gst-plugins-base, then the other modules."
138 echo "You do not need to do 'make install'"
139 echo
140 echo "==========================================================================================="
141 echo
142 echo "If your system GLib is too old, you can install a newer version"
143 echo "into --prefix=$UNINSTALLED_ROOT/$BRANCH/prefix and it should be picked up"
144 echo "by autogen.sh/configure"
145 echo
146 echo "==========================================================================================="
147 echo
148 echo "Also see http://gstreamer.freedesktop.org/wiki/UninstalledSetup"
149 echo
150 echo "==========================================================================================="
151