Build process is inconvenient
Problem
For a couple of days I tried to set up build environment for compiling VLC so I could do something with it.
I'm using Arch Linux (GCC 10.2) and CLion for development. I understand that VLC is cross-platform project and works on other platforms but I suspect that this also can affect other people too in a similar way.
Only resource that describes a process is a wiki page which is quite outdated since you can't successfully build VLC4 using these instructions. vlc/INSTALL contains very little additional information and still refers to this page.
VLC requires additional libraries that not listed there (e.g. qtquick2) and configuration flags are not quite fresh too.
To avoid polluting main OS with development libraries I tried to build VLC inside container. Usually I use systemd-nspawn for this kind of things since it is simple enough.
However, due to large number of dependencies needed to be installed, I wrote Dockerfile and built container to isolate build environment that I can reproduce easily.
Building inside Debian container was a success, but as you might expect, when I run this binary in archlinux it fails because of multiple reasons:
- I am trying to run executable without installing in system directories and without
LD_LIBRARY_PATHVLC can't find its shared libraries - Inevitable library version conflicts. Number of libraries in debian are frozen and of course not compatible with ones in arch. Notably, libplacebo that also checks its version so you can't just make symlink to it
Building with --enable_static fails on linking with qt libraries, probably. So you can't do that easily ATM.
Using contrib libraries isn't possible since it only contains selected subset of required libs. I suspect it only tries to build ones that aren't available in host OS so it might be one of the reasons why I didn't succeed.
The next step was to build inside environment that replicates main OS. I built an archlinux container and installed all dependencies in it.
But I wasn't able to build VLC at all since it fails to compile. I suspect some libraries in arch repository are newer than expected but I can't investigate further because I am not familiar with VLC codebase.
So, all in all after number of evenings I wasn't able to build something that you can run on your PC instead of prebuilt binary.
To be clear, I am not an inexperienced developer and I work with C++ on a daily basis. It's not a news that building C/C++ projects can be unpleasant.
Solution
- Provide official container setup that is known to be working so you can avoid issues with people using different distributions and polluting host OS with rather useless packages
- Make it possible to build static binary. I suppose it is possible but not tested very well.
- Include as much libraries as possible into binary. Not only libvlc and such but also codecs and niche libraries like libplacebo and libsmb. However, I suspect that statically linking qt, libpulse, etc wouldn't be a great idea. Again, it might be like this already but I wasn't able to build static binary