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 meson and ninja
12 Meson 0.48 or newer is required.
14 You should get meson through your package manager or using:
16 $ pip3 install --user meson
18 This will install meson into ~/.local/bin which may or may not be included
19 automatically in your PATH by default.
21 If you are building on Windows, do not use the Meson MSI installer since it is
22 experimental and will likely not work.
24 You can also run meson directly from a meson git checkout if you like.
26 You should get `ninja` using your package manager or download the [official
27 release](https://github.com/ninja-build/ninja/releases) and put it in your PATH.
29 ### Build GStreamer and its modules
31 You can get all GStreamer built running:
34 mkdir build/ && meson build && ninja -C build/
37 NOTE: on fedora (and maybe other distributions) replace `ninja` with `ninja-build`
39 # Development environment
41 ## Building the Qt5 QML plugin
43 If `qmake` is not in `PATH` and pkgconfig files are not available, you can
44 point the `QMAKE` env var to the Qt5 installation of your choosing before
45 running `meson` as shown above.
47 The plugin will be automatically enabled if possible, but you can ensure that
48 it is built by passing `-Dgst-plugins-good:qt5=enabled` to `meson`. This will
49 cause Meson to error out if the plugin could not be enabled. This also works
50 for all plugins in all GStreamer repositories.
52 ## Uninstalled environment
54 gst-build also contains a special `uninstalled` target that lets you enter an
55 uninstalled development environment where you will be able to work on GStreamer
56 easily. You can get into that environment running:
59 ninja -C build/ uninstalled
62 If your operating system handles symlinks, built modules source code will be
63 available at the root of `gst-build/` for example GStreamer core will be in
64 `gstreamer/`. Otherwise they will be present in `subprojects/`. You can simply
65 hack in there and to rebuild you just need to rerun `ninja -C build/`.
67 NOTE: In the uninstalled environment, a fully usable prefix is also configured
68 in `gst-build/prefix` where you can install any extra dependency/project.
70 ## Update git subprojects
72 We added a special `update` target to update subprojects (it uses `git pull
73 --rebase` meaning you should always make sure the branches you work on are
74 following the right upstream branch, you can set it with `git branch
75 --set-upstream-to origin/master` if you are working on `gst-build` master
78 Update all GStreamer modules and rebuild:
81 ninja -C build/ update
84 Update all GStreamer modules without rebuilding:
87 ninja -C build/ git-update
92 We also added a meson option, 'custom_subprojects', that allows the user
93 to provide a comma-separated list of subprojects that should be built
94 alongside the default ones.
100 git clone my_subproject
102 rm -rf * && meson .. -Dcustom_subprojects=my_subproject
109 You can easily run the test of all the components:
115 To list all available tests:
118 meson test -C build --list
121 To run all the tests of a specific component:
124 meson test -C build --suite gst-plugins-base
127 Or to run a specific test file:
130 meson test -C build/ --suite gstreamer gst_gstbuffer
133 Run a specific test from a specific test file:
136 GST_CHECKS=test_subbuffer meson test -C build/ --suite gstreamer gst_gstbuffer
139 ## Checkout another branch using worktrees
141 If you need to have several versions of GStreamer coexisting (eg. `master` and `1.14`),
142 you can use the `checkout-branch-worktree` script provided by `gst-build`. It allows you
143 to create a new `gst-build` environment with new checkout of all the GStreamer modules as
144 [git worktrees](https://git-scm.com/docs/git-worktree).
146 For example to get a fresh checkout of `gst-1.14` from a `gst-build` in master already
147 built in a `build` directory you can simply run:
150 ./checkout-branch-worktree ../gst-1.14 1.14 -C build/
153 ## Add information about GStreamer development environment in your prompt line
157 We automatically handle `bash` and set `$PS1` accordingly.
159 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:
163 if [[ -n "${GST_ENV-}" ]];
165 PS1+="[ ${GST_ENV} ]"
173 In your `.zshrc`, you should add something like:
176 export PROMPT="$GST_ENV-$PROMPT"
181 In your `~/.config/fish/functions/fish_prompt.fish`, you should add something like this at the end of the fish_prompt function body:
185 echo -n -s (set_color -b blue white) "(" (basename "$GST_ENV") ")" (set_color normal) " "
191 In your powerline theme configuration file (by default in
192 `{POWERLINE INSTALLATION DIR}/config_files/themes/shell/default.json`)
193 you should add a new environment segment as follow:
197 "function": "powerline.segments.common.env.environment",
198 "args": { "variable": "GST_ENV" },