-
Notifications
You must be signed in to change notification settings - Fork 7
Building a development version of the LibVLC.UWP nuget
This page will documentate the process of building your own LibVLC.UWP nuget package for Windows.
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 ~/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.
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.
After building the package on Linux you need to export the files to Windows.
We will be creating a tar
out of the files by using the following command.
sudo tar -czvf ~/LibVLC-UWP.tar.gz ~/vlc-uwp-volume/
We will use the shared folder functionality of VirtualBox to extract the file from the virtual machine.
- First, go to
Devices->Shared Folders->Shared Folders Settings...
- Press the
Add Share
button. This will open the Add Share window. - For the
Folder Path
field you need to choose a destination on the Windows host from where you will access the mount in the virtual machine, for example:C:\Users\Tim\Desktop\VM_Mount
. - Check the
Auto-mount
checkbox. - As for the
Mount point
field, you have to give the path of the location where the directory will be mounted to inside the virtual machine. However, we do recommend making use of the/mnt
directory, like:/mnt/VM_Mount
. - Press the
OK
button in both the Settings window and the Add Share window when done. - Check inside the virtual machine if the the mount got created.
- You can check this by executing the path of the mount in the terminal. An example would be
/mnt/VM_Mount/
which results, if the mount exists, in the following message being displayed:bash: /mnt/VM_Mount/: Is a directory
. If the mount didn't get created try restarting the virtual machine. Don't forget marking the mount as permanent in the Add Share window before restarting.
- You can check this by executing the path of the mount in the terminal. An example would be
- Now that we are done setting up the mount we can move the
LibVLC-UWP.tar.gz
file to the mounted directory. Change the destination path when needed.
sudo mv ~/LibVLC-UWP.tar.gz /mnt/VM_Mount/
If everything worked correctly you can now access LibVLC-UWP.tar.gz
inside the directory on Windows. In my case the file resides inside C:\Users\Tim\Desktop\VM_Mount
.
//TODO: libaccess winrt plugin instructions, (nuget) packaging instructions