Skip to content

Building a development version of the LibVLC.UWP nuget

Tim Gels edited this page Dec 30, 2020 · 17 revisions

Building LibVLC for UWP

This page will documentate the process of building your own LibVLC.UWP nuget package for Windows.

Getting the Docker image up and running

First, make sure you have a PC or VM running Linux with about 10-20 GB free disk space.

Install docker for your distro using the instructions. Next, pull the (at the time of writing) latest Debian image from Videolan, which includes the LLVM compiler:

sudo docker image pull registry.videolan.org/vlc-debian-llvm-uwp:20201201150955

This will take a while. Now, create a new directory, note it's location and change ownership to the videolan docker user:

cd ~/
mkdir vlc-uwp-volume
sudo chown -R 499:499 vlc-uwp-volume

Start the container, bind the volume and exec into it:

sudo docker run -it -v /home/$USER/vlc-uwp-volume:/home/videolan/vlc-uwp-volume registry.videolan.org/vlc-debian-llvm-uwp:20201201150955 bash

Now you should be in the container at /build as the videolan user.

Building LibVLC

Switch to home and checkout the vlc 3.0 maintenance repo:

cd ~/
git clone https://code.videolan.org/videolan/vlc-3.0.git
cd vlc-3.0

Pick one of the HOST_ARCH variables, depending on the architecture:

export HOST_ARCH=i686
export HOST_ARCH=x86_64

Note: The compiler can build for armv7 and aarch64 as well, but this is not tested.

Now set the other environment variables:

export TRIPLET=$HOST_ARCH-w64-mingw32
export LIBVLC_EXTRA_BUILD_FLAGS=-z
export UWP_EXTRA_BUILD_FLAGS="-u -w"

This will set our host triplet to be used by the compiler, and some extra flags for the VLC build script specifically.

Finally, we are ready to build:

extras/package/win32/build.sh -c -a $HOST_ARCH $LIBVLC_EXTRA_BUILD_FLAGS $UWP_EXTRA_BUILD_FLAGS -D c:/sources/vlc-3.0 -o /home/videolan/vlc-uwp-volume/

This will instruct the build script to create a debug build, install it in /home/videolan/vlc-uwp-volume/ and map PDB symbol locations to C:\sources\vlc-3.0\. For a release build, -r should be added.

It also downloads all the third-party dependencies (called contrib) and creates a new contrib package in the contrib folder for each architecture, based on the current sources and with various VLC-specific patches applied. It is (at the time of writing) only possible on x86_64 to use a prebuilt contrib package. Again, see the VLC build script for instructions.

//TODO: nuget packaging instructions

Clone this wiki locally