1 # Building from source using Cerbero
3 > ![Warning] This section is intended for advanced users.
7 The GStreamer build system provides bootstrapping facilities for all
8 platforms, but it still needs a minimum base to bootstrap:
10 - python > 2.6 and python's `argparse` module, which is already
11 included in python2.7.
16 Cerbero can be used on Windows using the Msys/MinGW shell (a Unix-like
17 shell for Windows). There is a bit of setup that you need to do before
18 Cerbero can take control.
20 You need to install the following programs:
23 - [Git] (Select the install option "Checkout as-is, Commit as-is" and
24 install it in a path without spaces, eg: c:\Git)
25 - [Msys/MinGW] (Install it with all the options enabled)
26 - [CMake] (Select the option "Add CMake in system path for the
28 - [Yasm] (Download the win32 or win64 version for your platform, name
29 it `yasm.exe`, and place it in your MinGW `bin` directory,
30 typically, `C:\MinGW\bin`)
32 - [Microsoft SDK 7.1] (Install the SDK samples and the Visual C++
33 Compilers, required to build the DirectShow base classes. Might need
34 installing the .NET 4 Framework first if the SDK installer doesn't
36 - [Windows Driver Kit 7.1.0]
38 Your user ID can't have spaces (eg: John Smith). Paths with spaces are
39 not correctly handled in the build system and msys uses the user ID for
42 Cerbero must be run in the MinGW shell, which is accessible from the
43 main menu once MinGW is installed.
45 The last step is making `python` and `git` available from the shell, for
46 which you will need to create a `.profile` file. Issue this command from
47 within the MinGW shell:
49 `echo "export PATH=\"\$PATH:/c/Python27:/c/Git/bin\"" >> ~/.profile`
51 Using the appropriate paths to where you installed `python` and `git`
53 (Note that inside the shell, / is mapped to c:\Mingw\msys\1.0 )
57 To use cerbero on OS X you need to install the "Command Line Tools" from
58 XCode. They are available from the "Preferences" dialog under
63 If you want to build GStreamer for iOS, you also need the iOS
64 SDK. The minimum required iOS SDK version is 6.0 and is included in
65 [XCode] since version 4.
67 ## Download the sources
69 To build GStreamer, you first need to download **Cerbero**.
70 Cerbero is a multi-platform build system for Open Source projects that
71 builds and creates native packages for different platforms,
72 architectures and distributions.
74 Get a copy of Cerbero by cloning the git repository:
76 git clone git://anongit.freedesktop.org/gstreamer/cerbero
78 Cerbero can be run uninstalled and for convenience you can create an
79 alias in your `.bashrc` file*. *If you prefer to skip this step,
80 remember that you need to replace the calls to `cerbero` with
81 `./cerbero-uninstalled` in the next steps.
83 echo "alias cerbero='~/git/cerbero/cerbero-uninstalled'" >> ~/.bashrc
87 After Cerbero and the base requirements are in place, you need to setup
88 the build environment.
90 Cerbero reads the configuration file `$HOME/.cerbero/cerbero.cbc` to
91 determine the build options. This file is a python code which allows
92 overriding/defining some options.
94 If the file does not exist, Cerbero will try to determine the distro you
95 are running and will use default build options such as the default build
96 directory. The default options should work fine on the supported
99 An example configuration file with detailed comments can be found [here]
101 To fire up the bootstrapping process, go to the directory where you
102 cloned/unpacked Cerbero and type:
106 Enter the superuser/root password when prompted.
108 The bootstrap process will then install all packages required to build
113 To generate GStreamer binaries, use the following command:
115 cerbero package gstreamer-1.0
117 This should build all required GStreamer components and create packages for
118 your distribution at the Cerbero source directory.
120 A list of supported packages to build can be retrieved using:
122 cerbero list-packages
124 Packages are composed of 0 (in case of a meta package) or more
125 components that can be built separately if desired. The components are
126 defined as individual recipes and can be listed with:
130 To build an individual recipe and its dependencies, do the following:
132 cerbero build <recipe_name>
134 Or to build or force a rebuild of a recipe without building its
137 cerbero buildone <recipe_name>
139 To wipe everything and start from scratch:
143 Once built, the output of the recipes will be installed at the prefix
144 defined in the Cerbero configuration file `$HOME/.cerbero/cerbero.cbc`
145 or at `$HOME/cerbero/dist` if no prefix is defined.
147 ### Build a single project with GStreamer
149 Rebuilding the whole GStreamer is relatively fast on Linux and OS X, but it
150 can be very slow on Windows, so if you only need to rebuild a single
151 project (eg: gst-plugins-good to patch qtdemux) there is a much faster
152 way of doing it. You will need to follow the steps detailed in this
153 page, but skipping the step "**Build GStreamer**", and installing the
154 GStreamer's development files as explained in [Installing GStreamer].
156 By default, Cerbero uses as prefix a folder in the user directory with
157 the following schema \~/cerbero/dist/$platform\_$arch, but for GStreamer
158 we must change this prefix to use its installation directory. This can
159 be done with a custom configuration file named *custom.cbc*:
162 prefix='/c/gstreamer/1.0/x86/'
165 #prefix='/c/gstreamer/1.0/x86_64'
168 #prefix='/opt/gstreamer'
171 #prefix='/Library/Frameworks/GStreamer.framework/Versions/1.0'
173 The prefix path might not be writable by your current user. Make sure
174 you fix it before, for instance with:
176 $ sudo chown -R <username> /Library/Frameworks/GStreamer.framework/
178 Cerbero has a shell command that starts a new shell with all the
179 environment set up to target GStreamer. You can start a new shell using
180 the installation prefix defined in *custom.cbc *with the following
183 $ cerbero -c custom.cbc shell
185 Once you are in Cerbero's shell you can compile new projects targeting
186 GStreamer using the regular build process:
188 $ git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-good; cd gst-plugins-good
189 $ sh autogen.sh --disable-gtk-doc --prefix=<prefix>
192 ### Cross-compilation of GStreamer
194 Cerbero can be used to cross-compile GStreamer to other platforms like
195 Android or Windows. You only need to use a configuration file that sets
196 the target platform, but we also provide a set of of pre-defined
197 configuration files for the supported platforms (you will find them in
198 the `config` folder with the `.cbc` extension
202 You can cross-compile GStreamer for Android from a Linux host using the
203 configuration file `config/cross-android.cbc`. Replace all the previous
206 cerbero -c config/cross-android.cbc <command>
210 GStreamer can also be cross-compiled to Windows from Linux, but you should
211 only use it for testing purpose. The DirectShow plugins cannot be
212 cross-compiled yet and WiX can't be used with Wine yet, so packages can
213 only be created from Windows.
215 Replace all the above commands for Windows 32bits with:
217 cerbero -c config/cross-win32.cbc <command>
219 Or with using the following for Windows 64bits:
221 cerbero -c config/cross-win64.cbc <command>
225 To cross compile for iOS from OS X, use the configuration file
226 `config/cross-ios-universal.cbc`. Replace all previous commands with:
228 cerbero -c config/cross-ios-universal.cbc <command>
230 [Warning]: images/icons/emoticons/warning.png
231 [Python 2.7]: http://www.python.org/getit/releases/2.7/
232 [Git]: http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
233 [Msys/MinGW]: https://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
234 [CMake]: http://www.cmake.org/cmake/resources/software.htm
235 [Yasm]: http://yasm.tortall.net/Download.html
236 [WiX 3.5]: http://wix.codeplex.com/releases/view/60102
237 [Microsoft SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=8279
238 [Windows Driver Kit 7.1.0]: http://msdn.microsoft.com/en-us/windows/hardware/hh852365
239 [XCode]: https://developer.apple.com/devcenter/ios/index.action#downloads
240 [here]: http://www.freedesktop.org/software/gstreamer-sdk/cerbero.cbc.template
241 [Installing GStreamer]: sdk-installing.md