Move dataurisrc element from -bad
[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-2015 Tim-Philipp Müller <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 e.g. "1.2" to track the stable 1.2 branch instead of master
33 BRANCH="master"
34
35 # set to "ssh" if you have a developer account and ssh access
36 GIT_ACCESS="anongit"
37
38 # extra clone options
39 #CLONE_OPTS="--depth=1 --no-single-branch"
40
41 # re-use and reference local master branch checkout if one already exists
42 # (saves network bandwidth)
43 REUSE_EXISTING_MASTER_CHECKOUT="true"
44
45 # git modules to clone
46 MODULES="gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad gst-libav"
47
48 # note: we use ~/gst because that's what the gst-uninstalled script
49 # uses by default, so don't just change that to something else
50 UNINSTALLED_ROOT=~/gst
51
52 echo "==========================================================================================="
53 echo "Creating new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT ... "
54 echo "==========================================================================================="
55
56 mkdir -p $UNINSTALLED_ROOT
57 mkdir -p $UNINSTALLED_ROOT/$BRANCH
58
59 mkdir -p $UNINSTALLED_ROOT/$BRANCH/prefix
60
61
62 echo ""
63 echo "Checking basic build tools and dependencies are installed..."
64 echo ""
65
66 if ! pkg-config --version 2>/dev/null >/dev/null; then
67   DEPS_OK="no"
68 elif ! pkg-config --exists glib-2.0 orc-0.4 2>/dev/null >/dev/null; then
69   DEPS_OK="no"
70 elif ! bison --version 2>/dev/null >/dev/null; then
71   DEPS_OK="no"
72 elif ! flex --version 2>/dev/null >/dev/null; then
73   DEPS_OK="no"
74 elif ! git --version 2>/dev/null >/dev/null; then
75   DEPS_OK="no"
76 else
77   DEPS_OK="yes"
78 fi
79
80 if test "$DEPS_OK" != "yes"; then
81 echo "==========================================================================================="
82 echo ""
83 echo "  Some very basic build tools or dependencies are missing."
84 echo ""
85 echo "  Please install the following tools: pkg-config, bison, flex, git"
86 echo ""
87 echo "  and the following libraries: GLib (libglib2.0-dev or glib2-devel)"
88 echo "                           and Orc  (liborc-0.4-dev or orc-devel)"
89 #echo "  Please visit"
90 #echo ""
91 #echo "      http://gstreamer.freedesktop.org/wiki/BuildDependenciesDebianUbuntu"
92 #echo ""
93 #echo "         or"
94 #echo ""
95 #echo "      http://gstreamer.freedesktop.org/wiki/Fedora"
96 #echo ""
97 #echo "  for instructions how to install them on Debian/Ubuntu-based systems."
98 echo ""
99 echo "==========================================================================================="
100 exit 1
101 fi
102
103
104 cd $UNINSTALLED_ROOT/$BRANCH
105
106 for m in $MODULES
107 do
108   REF=""
109   if test "$BRANCH" != "master" \
110     -a "x$REUSE_EXISTING_MASTER_CHECKOUT" = "xtrue" \
111     -a -d ../master/$m; then
112       REF="--reference=../master/$m"
113   fi
114
115   if test "$GIT_ACCESS" = "ssh"; then
116     git clone $CLONE_OPTS $REF ssh://git.freedesktop.org/git/gstreamer/$m
117   else
118     git clone $CLONE_OPTS $REF https://anongit.freedesktop.org/git/gstreamer/$m
119   fi
120
121   cd $m
122   if test "$BRANCH" != "master"; then
123     git checkout -b $BRANCH origin/$BRANCH
124   fi
125   git submodule init && git submodule update
126   cd ..
127 done
128
129 cd $UNINSTALLED_ROOT
130 ln -s $BRANCH/gstreamer/scripts/gst-uninstalled gst-$BRANCH
131 chmod +x gst-$BRANCH
132
133 cd ~
134
135 echo "==========================================================================================="
136 echo
137 echo "Done. Created new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT"
138 echo
139 echo "To enter the uninstalled environment do: cd $UNINSTALLED_ROOT; ./gst-$BRANCH"
140 echo
141 echo "To leave the uninstalled environment do: exit"
142 echo
143 echo "To check the uninstalled environment do: printenv | grep GST"
144 echo "    (loads of output = you're in the uninstalled environment)"
145 echo
146 echo "==========================================================================================="
147 echo
148 echo "Now compile all GStreamer modules one by one by first switching into"
149 echo "the uninstalled environment and then doing:"
150 echo
151 echo "    cd <MODULE>; ./autogen.sh; make"
152 echo
153 echo "First gstreamer, then gst-plugins-base, then the other modules."
154 echo "You do not need to do 'make install'"
155 echo
156 echo "==========================================================================================="
157 echo
158 echo "If your system GLib is too old, you can install a newer version"
159 echo "into --prefix=$UNINSTALLED_ROOT/$BRANCH/prefix and it should be picked up"
160 echo "by autogen.sh/configure"
161 echo
162 echo "==========================================================================================="
163 #echo
164 #echo "Also see http://gstreamer.freedesktop.org/wiki/UninstalledSetup"
165 #echo
166 #echo "==========================================================================================="
167