3 GStreamer [meson](http://mesonbuild.com/) based repositories aggregrator
5 You can build GStreamer and all its modules at once using
6 meson and its [subproject](https://github.com/mesonbuild/meson/wiki/Subprojects) feature.
10 ### Install git and python 3.5+
12 If you're on Linux, you probably already have these. On macOS, you can use the
13 [official Python installer](https://www.python.org/downloads/mac-osx/).
15 You can find [instructions for Windows below](#windows-prerequisites-setup).
17 ### Install meson and ninja
19 Meson 0.48 or newer is required.
21 On Linux and macOS you can get meson through your package manager or using:
23 $ pip3 install --user meson
25 This will install meson into `~/.local/bin` which may or may not be included
26 automatically in your PATH by default.
28 You should get `ninja` using your package manager or download the [official
29 release](https://github.com/ninja-build/ninja/releases) and put the `ninja`
32 You can find [instructions for Windows below](#windows-prerequisites-setup).
34 ### Build GStreamer and its modules
36 You can get all GStreamer built running:
43 This will automatically create the `build` directory and build everything
46 NOTE: On Windows, you *must* run this from inside the Visual Studio command
47 prompt of the appropriate architecture and version.
49 # Development environment
51 ## Building the Qt5 QML plugin
53 If `qmake` is not in `PATH` and pkgconfig files are not available, you can
54 point the `QMAKE` env var to the Qt5 installation of your choosing before
55 running `meson` as shown above.
57 The plugin will be automatically enabled if possible, but you can ensure that
58 it is built by passing `-Dgst-plugins-good:qt5=enabled` to `meson`. This will
59 cause Meson to error out if the plugin could not be enabled. This also works
60 for all plugins in all GStreamer repositories.
62 ## Uninstalled environment
64 gst-build also contains a special `uninstalled` target that lets you enter an
65 uninstalled development environment where you will be able to work on GStreamer
66 easily. You can get into that environment running:
69 ninja -C build/ uninstalled
72 If your operating system handles symlinks, built modules source code will be
73 available at the root of `gst-build/` for example GStreamer core will be in
74 `gstreamer/`. Otherwise they will be present in `subprojects/`. You can simply
75 hack in there and to rebuild you just need to rerun `ninja -C build/`.
77 NOTE: In the uninstalled environment, a fully usable prefix is also configured
78 in `gst-build/prefix` where you can install any extra dependency/project.
80 ## Update git subprojects
82 We added a special `update` target to update subprojects (it uses `git pull
83 --rebase` meaning you should always make sure the branches you work on are
84 following the right upstream branch, you can set it with `git branch
85 --set-upstream-to origin/master` if you are working on `gst-build` master
88 Update all GStreamer modules and rebuild:
91 ninja -C build/ update
94 Update all GStreamer modules without rebuilding:
97 ninja -C build/ git-update
100 ## Custom subprojects
102 We also added a meson option, `custom_subprojects`, that allows the user
103 to provide a comma-separated list of subprojects that should be built
104 alongside the default ones.
110 git clone my_subproject
112 rm -rf * && meson .. -Dcustom_subprojects=my_subproject
118 You can easily run the test of all the components:
124 To list all available tests:
127 meson test -C build --list
130 To run all the tests of a specific component:
133 meson test -C build --suite gst-plugins-base
136 Or to run a specific test file:
139 meson test -C build/ --suite gstreamer gst_gstbuffer
142 Run a specific test from a specific test file:
145 GST_CHECKS=test_subbuffer meson test -C build/ --suite gstreamer gst_gstbuffer
148 ## Optional Installation
150 `gst-build` has been created primarily for [uninstalled usage](#uninstalled-environment),
151 but you can also install everything that is built into a predetermined prefix like so:
154 meson --prefix=/path/to/install/prefix build/
156 meson install -C build/
159 Note that the installed files have `RPATH` stripped, so you will need to set
160 `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, or `PATH` as appropriate for your
161 platform for things to work.
163 ## Checkout another branch using worktrees
165 If you need to have several versions of GStreamer coexisting (eg. `master` and `1.14`),
166 you can use the `checkout-branch-worktree` script provided by `gst-build`. It allows you
167 to create a new `gst-build` environment with new checkout of all the GStreamer modules as
168 [git worktrees](https://git-scm.com/docs/git-worktree).
170 For example to get a fresh checkout of `gst-1.14` from a `gst-build` in master already
171 built in a `build` directory you can simply run:
174 ./checkout-branch-worktree ../gst-1.14 1.14 -C build/
177 ## Add information about GStreamer development environment in your prompt line
181 We automatically handle `bash` and set `$PS1` accordingly.
183 If the automatic `$PS1` override is not desired (maybe you have a fancy custom prompt), set the `$GST_BUILD_DISABLE_PS1_OVERRIDE` environment variable to `TRUE` and use `$GST_ENV` when setting the custom prompt, for example with a snippet like the following:
187 if [[ -n "${GST_ENV-}" ]];
189 PS1+="[ ${GST_ENV} ]"
197 In your `.zshrc`, you should add something like:
200 export PROMPT="$GST_ENV-$PROMPT"
205 In your `~/.config/fish/functions/fish_prompt.fish`, you should add something like this at the end of the fish_prompt function body:
209 echo -n -s (set_color -b blue white) "(" (basename "$GST_ENV") ")" (set_color normal) " "
215 In your powerline theme configuration file (by default in
216 `{POWERLINE INSTALLATION DIR}/config_files/themes/shell/default.json`)
217 you should add a new environment segment as follow:
221 "function": "powerline.segments.common.env.environment",
222 "args": { "variable": "GST_ENV" },
227 ## Windows Prerequisites Setup
229 On Windows, some of the components may require special care.
233 Use the [Git for Windows](https://gitforwindows.org/) installer. It will
234 install a `bash` prompt with basic shell utils and up-to-date git binaries.
236 During installation, when prompted about `PATH`, you should select the
239 ![Select "Git from the command line and also from 3rd-party software"](/data/images/git-installer-PATH.png)
241 ### Python 3.5+ on Windows
243 Use the [official Python installer](https://www.python.org/downloads/windows/).
244 You must ensure that Python is installed into `PATH`:
246 ![Enable Add Python to PATH, then click Customize Installation](/data/images/py-installer-page1.png)
248 You may also want to customize the installation and install it into
249 a system-wide location such as `C:\PythonXY`, but this is not required.
253 The easiest way to install Ninja on Windows is with `pip3`, which will download
254 the compiled binary and place it into the `Scripts` directory inside your
261 You can also download the [official release](https://github.com/ninja-build/ninja/releases)
262 and place it into `PATH`.
266 **IMPORTANT**: Do not use the Meson MSI installer since it is experimental and known to not
267 work with `gst-build`.
269 You can use `pip3` to install Meson, same as Ninja above:
275 Note that Meson is written entirely in Python, so you can also run it as-is
276 from the [git repository](https://github.com/mesonbuild/meson/) if you want to
277 use the latest master branch for some reason.