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 development 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 ## Development environment target
68 gst-build also contains a special `devenv` target that lets you enter an
69 development environment where you will be able to work on GStreamer
70 easily. You can get into that environment running:
73 ninja -C build/ devenv
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 development environment, a fully usable prefix is also configured
82 in `gst-build/prefix` where you can install any extra dependency/project.
84 An external script can be run in development environment with:
87 ./gst-env.py external_script.sh
90 ## Update git subprojects
92 We added a special `update` target to update subprojects (it uses `git pull
93 --rebase` meaning you should always make sure the branches you work on are
94 following the right upstream branch, you can set it with `git branch
95 --set-upstream-to origin/master` if you are working on `gst-build` master
98 Update all GStreamer modules and rebuild:
101 ninja -C build/ update
104 Update all GStreamer modules without rebuilding:
107 ninja -C build/ git-update
110 ## Custom subprojects
112 We also added a meson option, `custom_subprojects`, that allows the user
113 to provide a comma-separated list of subprojects that should be built
114 alongside the default ones.
120 git clone my_subproject
122 rm -rf * && meson .. -Dcustom_subprojects=my_subproject
128 You can easily run the test of all the components:
134 To list all available tests:
137 meson test -C build --list
140 To run all the tests of a specific component:
143 meson test -C build --suite gst-plugins-base
146 Or to run a specific test file:
149 meson test -C build/ --suite gstreamer gst_gstbuffer
152 Run a specific test from a specific test file:
155 GST_CHECKS=test_subbuffer meson test -C build/ --suite gstreamer gst_gstbuffer
158 ## Optional Installation
160 `gst-build` has been created primarily for [development usage](#development-environment-target),
161 but you can also install everything that is built into a predetermined prefix like so:
164 meson --prefix=/path/to/install/prefix build/
166 meson install -C build/
169 Note that the installed files have `RPATH` stripped, so you will need to set
170 `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, or `PATH` as appropriate for your
171 platform for things to work.
173 ## Checkout another branch using worktrees
175 If you need to have several versions of GStreamer coexisting (eg. `master` and `1.14`),
176 you can use the `checkout-branch-worktree` script provided by `gst-build`. It allows you
177 to create a new `gst-build` environment with new checkout of all the GStreamer modules as
178 [git worktrees](https://git-scm.com/docs/git-worktree).
180 For example to get a fresh checkout of `gst-1.14` from a `gst-build` in master **already
181 built** in a `build` directory you can simply run:
184 ./checkout-branch-worktree ../gst-build-1.14 origin/1.14 -C build/
187 This will create a new ``gst-build-1.14`` folder at the same level of ``gst-build`` pointing to the given branch ie *1.14*
188 for all the subprojects ( gstreamer, gst-plugins-base etc.)
191 ## Add information about GStreamer development environment in your prompt line
195 We automatically handle `bash` and set `$PS1` accordingly.
197 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:
201 if [[ -n "${GST_ENV-}" ]];
203 PS1+="[ ${GST_ENV} ]"
211 In your `.zshrc`, you should add something like:
214 export PROMPT="$GST_ENV-$PROMPT"
219 In your `~/.config/fish/functions/fish_prompt.fish`, you should add something like this at the end of the fish_prompt function body:
223 echo -n -s (set_color -b blue white) "(" (basename "$GST_ENV") ")" (set_color normal) " "
229 In your powerline theme configuration file (by default in
230 `{POWERLINE INSTALLATION DIR}/config_files/themes/shell/default.json`)
231 you should add a new environment segment as follow:
235 "function": "powerline.segments.common.env.environment",
236 "args": { "variable": "GST_ENV" },
241 ## Windows Prerequisites Setup
243 On Windows, some of the components may require special care.
247 Use the [Git for Windows](https://gitforwindows.org/) installer. It will
248 install a `bash` prompt with basic shell utils and up-to-date git binaries.
250 During installation, when prompted about `PATH`, you should select the
253 ![Select "Git from the command line and also from 3rd-party software"](/data/images/git-installer-PATH.png)
255 ### Python 3.5+ on Windows
257 Use the [official Python installer](https://www.python.org/downloads/windows/).
258 You must ensure that Python is installed into `PATH`:
260 ![Enable Add Python to PATH, then click Customize Installation](/data/images/py-installer-page1.png)
262 You may also want to customize the installation and install it into
263 a system-wide location such as `C:\PythonXY`, but this is not required.
267 The easiest way to install Ninja on Windows is with `pip3`, which will download
268 the compiled binary and place it into the `Scripts` directory inside your
275 You can also download the [official release](https://github.com/ninja-build/ninja/releases)
276 and place it into `PATH`.
280 **IMPORTANT**: Do not use the Meson MSI installer since it is experimental and known to not
281 work with `gst-build`.
283 You can use `pip3` to install Meson, same as Ninja above:
289 Note that Meson is written entirely in Python, so you can also run it as-is
290 from the [git repository](https://github.com/mesonbuild/meson/) if you want to
291 use the latest master branch for some reason.
294 ### Setup a mingw/wine based development environment on linux
296 #### Install wine and mingw
301 sudo dnf install mingw64-gcc mingw64-gcc-c++ mingw64-pkg-config mingw64-winpthreads wine
304 FIXME: Figure out what needs to be installed on other distros
306 #### Get meson from git
308 This simplifies the process and allows us to use the cross files
309 defined in meson itself.
312 git clone https://github.com/mesonbuild/meson.git
315 #### Build and install
318 BUILDDIR=$PWD/winebuild/
319 export WINEPREFIX=$BUILDDIR/wine-prefix/ && mkdir -p $WINEPREFIX
320 # Setting the prefix is mandatory as it is used to setup symlinks during uninstalled development
321 meson/meson.py $BUILDDIR --cross-file meson/cross/linux-mingw-w64-64bit.txt -Dgst-plugins-bad:vulkan=disabled -Dorc:gtk_doc=disabled --prefix=$BUILDDIR/wininstall/ -Djson-glib:gtk_doc=disabled
322 meson/meson.py install -C $BUILDDIR/
325 > __NOTE__: You should use `meson install -C $BUILDDIR` each time you make a change
326 > instead of the usual `ninja -C build` as the environment is not uninstalled.
328 #### The development environment
330 You can get into the development environment the usual way:
333 ninja -C $BUILDDIR/ devenv
336 After setting up [binfmt] to use wine for windows binaries,
337 you can run GStreamer tools under wine by running:
340 gst-launch-1.0.exe videotestsrc ! glimagesink
343 [binfmt]: http://man7.org/linux/man-pages/man5/binfmt.d.5.html