3 GStreamer [meson](http://mesonbuild.com/) based repositories aggregrator.
5 Check out this module and run meson on it, and it will git clone the other
6 GStreamer modules as [meson subprojects](http://mesonbuild.com/Subprojects.html)
7 and build everything in one go. Once that is done you can switch into an
8 uninstalled environment which allows you to easily develop and test the latest
9 version of GStreamer without the need to install anything or touch an existing
10 GStreamer system installation.
14 ### Install git and python 3.5+
16 If you're on Linux, you probably already have these. On macOS, you can use the
17 [official Python installer](https://www.python.org/downloads/mac-osx/).
19 You can find [instructions for Windows below](#windows-prerequisites-setup).
21 ### Install meson and ninja
23 Meson 0.48 or newer is required.
25 On Linux and macOS you can get meson through your package manager or using:
27 $ pip3 install --user meson
29 This will install meson into `~/.local/bin` which may or may not be included
30 automatically in your PATH by default.
32 You should get `ninja` using your package manager or download the [official
33 release](https://github.com/ninja-build/ninja/releases) and put the `ninja`
36 You can find [instructions for Windows below](#windows-prerequisites-setup).
38 ### Build GStreamer and its modules
40 You can get all GStreamer built running:
47 This will automatically create the `build` directory and build everything
50 NOTE: On Windows, you *must* run this from inside the Visual Studio command
51 prompt of the appropriate architecture and version.
53 # Development environment
55 ## Building the Qt5 QML plugin
57 If `qmake` is not in `PATH` and pkgconfig files are not available, you can
58 point the `QMAKE` env var to the Qt5 installation of your choosing before
59 running `meson` as shown above.
61 The plugin will be automatically enabled if possible, but you can ensure that
62 it is built by passing `-Dgst-plugins-good:qt5=enabled` to `meson`. This will
63 cause Meson to error out if the plugin could not be enabled. This also works
64 for all plugins in all GStreamer repositories.
66 ## Uninstalled environment
68 gst-build also contains a special `uninstalled` target that lets you enter an
69 uninstalled development environment where you will be able to work on GStreamer
70 easily. You can get into that environment running:
73 ninja -C build/ uninstalled
76 If your operating system handles symlinks, built modules source code will be
77 available at the root of `gst-build/` for example GStreamer core will be in
78 `gstreamer/`. Otherwise they will be present in `subprojects/`. You can simply
79 hack in there and to rebuild you just need to rerun `ninja -C build/`.
81 NOTE: In the uninstalled environment, a fully usable prefix is also configured
82 in `gst-build/prefix` where you can install any extra dependency/project.
84 ## Update git subprojects
86 We added a special `update` target to update subprojects (it uses `git pull
87 --rebase` meaning you should always make sure the branches you work on are
88 following the right upstream branch, you can set it with `git branch
89 --set-upstream-to origin/master` if you are working on `gst-build` master
92 Update all GStreamer modules and rebuild:
95 ninja -C build/ update
98 Update all GStreamer modules without rebuilding:
101 ninja -C build/ git-update
104 ## Custom subprojects
106 We also added a meson option, `custom_subprojects`, that allows the user
107 to provide a comma-separated list of subprojects that should be built
108 alongside the default ones.
114 git clone my_subproject
116 rm -rf * && meson .. -Dcustom_subprojects=my_subproject
122 You can easily run the test of all the components:
128 To list all available tests:
131 meson test -C build --list
134 To run all the tests of a specific component:
137 meson test -C build --suite gst-plugins-base
140 Or to run a specific test file:
143 meson test -C build/ --suite gstreamer gst_gstbuffer
146 Run a specific test from a specific test file:
149 GST_CHECKS=test_subbuffer meson test -C build/ --suite gstreamer gst_gstbuffer
152 ## Optional Installation
154 `gst-build` has been created primarily for [uninstalled usage](#uninstalled-environment),
155 but you can also install everything that is built into a predetermined prefix like so:
158 meson --prefix=/path/to/install/prefix build/
160 meson install -C build/
163 Note that the installed files have `RPATH` stripped, so you will need to set
164 `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, or `PATH` as appropriate for your
165 platform for things to work.
167 ## Checkout another branch using worktrees
169 If you need to have several versions of GStreamer coexisting (eg. `master` and `1.14`),
170 you can use the `checkout-branch-worktree` script provided by `gst-build`. It allows you
171 to create a new `gst-build` environment with new checkout of all the GStreamer modules as
172 [git worktrees](https://git-scm.com/docs/git-worktree).
174 For example to get a fresh checkout of `gst-1.14` from a `gst-build` in master already
175 built in a `build` directory you can simply run:
178 ./checkout-branch-worktree ../gst-1.14 1.14 -C build/
181 ## Add information about GStreamer development environment in your prompt line
185 We automatically handle `bash` and set `$PS1` accordingly.
187 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:
191 if [[ -n "${GST_ENV-}" ]];
193 PS1+="[ ${GST_ENV} ]"
201 In your `.zshrc`, you should add something like:
204 export PROMPT="$GST_ENV-$PROMPT"
209 In your `~/.config/fish/functions/fish_prompt.fish`, you should add something like this at the end of the fish_prompt function body:
213 echo -n -s (set_color -b blue white) "(" (basename "$GST_ENV") ")" (set_color normal) " "
219 In your powerline theme configuration file (by default in
220 `{POWERLINE INSTALLATION DIR}/config_files/themes/shell/default.json`)
221 you should add a new environment segment as follow:
225 "function": "powerline.segments.common.env.environment",
226 "args": { "variable": "GST_ENV" },
231 ## Windows Prerequisites Setup
233 On Windows, some of the components may require special care.
237 Use the [Git for Windows](https://gitforwindows.org/) installer. It will
238 install a `bash` prompt with basic shell utils and up-to-date git binaries.
240 During installation, when prompted about `PATH`, you should select the
243 ![Select "Git from the command line and also from 3rd-party software"](/data/images/git-installer-PATH.png)
245 ### Python 3.5+ on Windows
247 Use the [official Python installer](https://www.python.org/downloads/windows/).
248 You must ensure that Python is installed into `PATH`:
250 ![Enable Add Python to PATH, then click Customize Installation](/data/images/py-installer-page1.png)
252 You may also want to customize the installation and install it into
253 a system-wide location such as `C:\PythonXY`, but this is not required.
257 The easiest way to install Ninja on Windows is with `pip3`, which will download
258 the compiled binary and place it into the `Scripts` directory inside your
265 You can also download the [official release](https://github.com/ninja-build/ninja/releases)
266 and place it into `PATH`.
270 **IMPORTANT**: Do not use the Meson MSI installer since it is experimental and known to not
271 work with `gst-build`.
273 You can use `pip3` to install Meson, same as Ninja above:
279 Note that Meson is written entirely in Python, so you can also run it as-is
280 from the [git repository](https://github.com/mesonbuild/meson/) if you want to
281 use the latest master branch for some reason.