GSoC 2018: Port VLC build system to Meson
This summer I’ve participated in the Google Summer of Code program, contributing to the VLC media player project by VideoLAN.
My project this year was porting the VLC build system to the Meson Build system.
Motivation
The main reason for this project was that the autotools based build system is not the easiest to maintain, the configure autoconf file which is based on the m4 language is quite complex and hard to debug.
Meson is a modern build system which has it’s own syntax for the build files that is similar to python and therefore for most people relatively easy to understand and learn.
Goal
My initial plan was to port all of VLC in the timeframe of GSoC, but it quickly became clear that this is not a realistic goal, given that it’s quite time consuming to read the old build files and correctly “translate” those to meson build definitions. Additionally building VLC is complex, it has two GUIs, one for macOS based on Cocoa and one for Linux and Windows based on Qt and many other modules for codecs, muxing/demuxing, service discovery and other stuff.
Current state
Now, at the end of GSoC, VLC (libvlc, libvlccore) and about 100 modules are ported to Meson.
Most important missing things are:
- Proper library versioning
- Port the two “big” GUI modules
- Port all other missing modules, most notably the libav modules
- Correctly use VLCs “contrib” system
The current state can be found in the VLC Gitlab, all my commits are at the top, rebased onto the VLC master branch.
Additionally there are a few trivial contributions to the Meson repository.
Using it
To build VLC with Meson, two dependencies are needed for the build:
- Python 3
- Ninja
Meson itself is built as part of VLCs extras/tools
so it is not required
and currently VLC uses a patched version of Meson due to some upstream
bugs that await proper fixes.
Check out the Meson GSoC repository meson
branch:
git clone -b meson https://code.videolan.org/GSoC2018/ePirat/vlc.git
Then build the required extras/tools
:
( cd vlc/extras/tools/ && ./bootstrap && make )
The run the mesonconfigure helper script with the build directory as argument:
./mesonconfigure build
Now actually build it with Ninja:
ninja -C build