gst-inspect: fix unused-const-variable error in windows
[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 # This is the legacy uninstalled setup for autotools. There is also the
10 # gst-build module which provides the same using the meson build system.
11 #
12 # ----------------------------------------------------------------------------
13 #
14 # Copyright (C) 2011-2015 Tim-Philipp Müller <tim centricular net>
15 #
16 # This script is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU Library General Public
18 # License as published by the Free Software Foundation; either
19 # version 2 of the License, or (at your option) any later version.
20 #
21 # This library is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24 # Library General Public License for more details.
25 #
26 # You should have received a copy of the GNU Library General Public
27 # License along with this library; if not, write to the
28 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
29 # Boston, MA 02110-1301, USA.
30 #
31 # ----------------------------------------------------------------------------
32
33 set -e
34
35 # set BRANCH to e.g. "1.2" to track the stable 1.2 branch instead of master
36 BRANCH="master"
37
38 # set to "ssh" if you have a developer account and ssh access
39 GIT_ACCESS="anongit"
40
41 # extra clone options
42 #CLONE_OPTS="--depth=1 --no-single-branch"
43
44 # re-use and reference local master branch checkout if one already exists
45 # (saves network bandwidth)
46 REUSE_EXISTING_MASTER_CHECKOUT="true"
47
48 # git modules to clone
49 MODULES="gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad gst-libav"
50
51 # note: we use ~/gst because that's what the gst-uninstalled script
52 # uses by default, so don't just change that to something else
53 UNINSTALLED_ROOT=~/gst
54
55 echo "==========================================================================================="
56 echo "Creating new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT ... "
57 echo "==========================================================================================="
58
59 mkdir -p $UNINSTALLED_ROOT
60 mkdir -p $UNINSTALLED_ROOT/$BRANCH
61
62 mkdir -p $UNINSTALLED_ROOT/$BRANCH/prefix
63
64
65 echo ""
66 echo "Checking basic build tools and dependencies are installed..."
67 echo ""
68
69 if ! pkg-config --version 2>/dev/null >/dev/null; then
70   DEPS_OK="no"
71 elif ! pkg-config --exists glib-2.0 orc-0.4 2>/dev/null >/dev/null; then
72   DEPS_OK="no"
73 elif ! bison --version 2>/dev/null >/dev/null; then
74   DEPS_OK="no"
75 elif ! flex --version 2>/dev/null >/dev/null; then
76   DEPS_OK="no"
77 elif ! git --version 2>/dev/null >/dev/null; then
78   DEPS_OK="no"
79 else
80   DEPS_OK="yes"
81 fi
82
83 if test "$DEPS_OK" != "yes"; then
84 echo "==========================================================================================="
85 echo ""
86 echo "  Some very basic build tools or dependencies are missing."
87 echo ""
88 echo "  Please install the following tools: pkg-config, bison, flex, git"
89 echo ""
90 echo "  and the following libraries: GLib (libglib2.0-dev or glib2-devel)"
91 echo "                           and Orc  (liborc-0.4-dev or orc-devel)"
92 #echo "  Please visit"
93 #echo ""
94 #echo "      http://gstreamer.freedesktop.org/wiki/BuildDependenciesDebianUbuntu"
95 #echo ""
96 #echo "         or"
97 #echo ""
98 #echo "      http://gstreamer.freedesktop.org/wiki/Fedora"
99 #echo ""
100 #echo "  for instructions how to install them on Debian/Ubuntu-based systems."
101 echo ""
102 echo "==========================================================================================="
103 exit 1
104 fi
105
106
107 cd $UNINSTALLED_ROOT/$BRANCH
108
109 for m in $MODULES
110 do
111   REF=""
112   if test "$BRANCH" != "master" \
113     -a "x$REUSE_EXISTING_MASTER_CHECKOUT" = "xtrue" \
114     -a -d ../master/$m; then
115       REF="--reference=../master/$m"
116   fi
117
118   if test "$GIT_ACCESS" = "ssh"; then
119     git clone $CLONE_OPTS $REF git@gitlab.freedesktop.org:gstreamer/$m
120   else
121     git clone $CLONE_OPTS $REF https://gitlab.freedesktop.org/gstreamer/$m.git
122   fi
123
124   cd $m
125   if test "$BRANCH" != "master"; then
126     git checkout -b $BRANCH origin/$BRANCH
127   fi
128   git submodule init && git submodule update
129   cd ..
130 done
131
132 cd $UNINSTALLED_ROOT
133 ln -s $BRANCH/gstreamer/scripts/gst-uninstalled gst-$BRANCH
134 chmod +x gst-$BRANCH
135
136 cd ~
137
138 echo "==========================================================================================="
139 echo
140 echo "Done. Created new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT"
141 echo
142 echo "To enter the uninstalled environment do: cd $UNINSTALLED_ROOT; ./gst-$BRANCH"
143 echo
144 echo "To leave the uninstalled environment do: exit"
145 echo
146 echo "To check the uninstalled environment do: printenv | grep GST"
147 echo "    (loads of output = you're in the uninstalled environment)"
148 echo
149 echo "==========================================================================================="
150 echo
151 echo "Now compile all GStreamer modules one by one by first switching into"
152 echo "the uninstalled environment and then doing:"
153 echo
154 echo "    cd <MODULE>; ./autogen.sh; make"
155 echo
156 echo "First gstreamer, then gst-plugins-base, then the other modules."
157 echo "You do not need to do 'make install'"
158 echo
159 echo "==========================================================================================="
160 echo
161 echo "If your system GLib is too old, you can install a newer version"
162 echo "into --prefix=$UNINSTALLED_ROOT/$BRANCH/prefix and it should be picked up"
163 echo "by autogen.sh/configure"
164 echo
165 echo "==========================================================================================="
166