[vlc-commits] [Git][videolan/vlc][master] 2 commits: meson: add support for generating a NSIS installer
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Sep 14 20:20:33 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
b3e852f6 by Steve Lhomme at 2026-09-14T19:45:44+00:00
meson: add support for generating a NSIS installer
makensis needs to be run after "meson install"
lua is not supported yet as we don't compiler the scripts yet.
- - - - -
86363b2f by Steve Lhomme at 2026-09-14T19:45:44+00:00
package/win32: generate a .exe installer with meson
- - - - -
4 changed files:
- + extras/package/win32/NSIS/meson.build
- extras/package/win32/build.sh
- extras/package/win32/meson.build
- meson_options.txt
Changes:
=====================================
extras/package/win32/NSIS/meson.build
=====================================
@@ -0,0 +1,57 @@
+# nsis packaging
+
+have_win64 = host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64' or host_machine.cpu() == 'arm64'
+
+nsi_conf = cdata
+nsi_conf.set('BUILD_LUA_TRUE', lua_dep.found() and get_option('lua').allowed() ? '' : '#')
+nsi_conf.set('BUILD_SKINS_TRUE', skins2_feasible ? '' : '#')
+nsi_conf.set('HAVE_WIN64_TRUE', have_win64 ? '' : '#')
+nsi_conf.set('HAVE_WIN64_FALSE', have_win64 ? '#' : '')
+nsi_conf.set('HAVE_ARM64_TRUE', host_machine.cpu_family() == 'aarch64' or host_machine.cpu() == 'arm64' ? '' : '#')
+nsi_conf.set('HAVE_ARM64_FALSE', host_machine.cpu_family() == 'aarch64' or host_machine.cpu() == 'arm64' ? '#' : '')
+nsi_conf.set('PROGRAMFILES', have_win64 ? 'PROGRAMFILES64' : 'PROGRAMFILES')
+
+nsProcess_cargs = ['-D_UNICODE=1', '-DUNICODE=1']
+if not have_win64
+ nsProcess_cargs += '-D_WIN32_IE=0x0601'
+endif
+nsProcess_link_args = ['-static-libgcc']
+
+if have_win64
+ # nsProcess.dll needs to be a 32-bit DLL
+ # with clang we can select it via -target i686-w64-mingw32
+ if cc.has_argument(['--target=i686-w64-mingw32']) and cc.has_link_argument(['--target=i686-w64-mingw32'])
+ nsProcess_cargs += '--target=i686-w64-mingw32'
+ nsProcess_link_args += '--target=i686-w64-mingw32'
+ endif
+endif
+
+nsProcess = shared_library('nsProcess',
+ 'nsProcess/nsProcess.c', 'nsProcess/pluginapi.c',
+ c_args: nsProcess_cargs,
+ link_args: nsProcess_link_args,
+ dependencies : [ cc.find_library('ole32', required: true) ],
+ name_prefix: '',
+ install: true,
+ install_dir: 'NSIS')
+
+vlc_nsi = configure_file(
+ input: 'vlc.win32.nsi.in',
+ output: 'vlc.win32.nsi',
+ configuration: nsi_conf,
+ install: true,
+ install_dir: '.',
+)
+
+spad_nsi = configure_file(
+ input: 'spad.nsi.in',
+ output: 'spad.nsi',
+ configuration: nsi_conf,
+ install: true,
+ install_dir: '.',
+)
+
+install_data('nsProcess.nsh', install_dir : 'NSIS')
+install_data('vlc_branding.bmp', install_dir : 'NSIS')
+install_subdir('languages', install_dir : '.')
+install_subdir('helpers', install_dir : '.')
=====================================
extras/package/win32/build.sh
=====================================
@@ -575,6 +575,10 @@ if [ -n "$BUILD_MESON" ]; then
# we don't want to install in <destdir>/usr/local, just <destdir>
MCONFIGFLAGS="$MCONFIGFLAGS --prefix=/"
+ if [ "$INSTALLER" = "n" ] || [ "$INSTALLER" = "r" ] || [ "$INSTALLER" = "u" ]; then
+ MCONFIGFLAGS="$MCONFIGFLAGS -Dnsis=enabled"
+ fi
+
# generate the crossfile.meson
test -e $SHORTARCH-meson/crossfile.meson && unlink $SHORTARCH-meson/crossfile.meson
exec 3>$SHORTARCH-meson/crossfile.meson || return $?
@@ -622,19 +626,30 @@ if [ -n "$BUILD_MESON" ]; then
meson compile -j $JOBS -C ${BUILD_PATH}/$SHORTARCH-meson ${MCOMPILEFLAGS}
if [ -n "$INSTALL_PATH" ]; then
- MINSTALLFLAGS="--destdir=$INSTALL_PATH $MINSTALLFLAGS"
+ MDESTDIR="$INSTALL_PATH"
else
- MINSTALLFLAGS="--destdir=${BUILD_PATH}/$SHORTARCH-meson/vlc-$SHORTARCH $MINSTALLFLAGS"
+ MDESTDIR="${BUILD_PATH}/$SHORTARCH-meson/vlc-$SHORTARCH"
fi
+ MINSTALLFLAGS="--destdir=$MDESTDIR $MINSTALLFLAGS"
if [ "$INSTALLER" = "n" ]; then
meson install -C ${BUILD_PATH}/$SHORTARCH-meson ${MINSTALLFLAGS}
+ makensis $MDESTDIR/spad.nsi
+ makensis $MDESTDIR/vlc.win32.nsi
+
VLC_GIT_TAG="$(git describe --tags --long --match '?.*.*' --always)"
rm -rf ${BUILD_PATH}/$SHORTARCH-meson/vlc-$SHORTARCH-$VLC_GIT_TAG-debug.7z
cd ${BUILD_PATH}/$SHORTARCH-meson && \
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on vlc-$SHORTARCH-$VLC_GIT_TAG-debug.7z vlc-$SHORTARCH
elif [ "$INSTALLER" = "r" ]; then
meson dist -C ${BUILD_PATH}/$SHORTARCH-meson -j$JOBS --no-tests
+ meson install -C ${BUILD_PATH}/$SHORTARCH-meson ${MINSTALLFLAGS}
+ makensis $MDESTDIR/spad.nsi
+ makensis $MDESTDIR/vlc.win32.nsi
+ elif [ "$INSTALLER" = "u" ]; then
+ meson install -C ${BUILD_PATH}/$SHORTARCH-meson ${MINSTALLFLAGS}
+ makensis $MDESTDIR/spad.nsi
+ makensis $MDESTDIR/vlc.win32.nsi
fi
else
info "Bootstrapping"
=====================================
extras/package/win32/meson.build
=====================================
@@ -1,4 +1,3 @@
-# TODO handle nsis packaging
# TODO handle msi packaging
install_data('../../../AUTHORS', rename : 'AUTHORS.txt', install_dir : '.')
@@ -6,3 +5,9 @@ install_data('../../../COPYING', rename : 'COPYING.txt', install_dir : '.')
install_data('../../../NEWS', rename : 'NEWS.txt', install_dir : '.')
install_data('../../../README.md', rename : 'README.txt', install_dir : '.')
install_data('../../../THANKS', rename : 'THANKS.txt', install_dir : '.')
+
+install_data('../../../share/icons/vlc.ico', install_dir : '.')
+
+if get_option('nsis').allowed()
+ subdir('NSIS')
+endif
=====================================
meson_options.txt
=====================================
@@ -820,6 +820,11 @@ option('v4l2',
value: 'auto',
description: 'Video4Linux2 support')
+option('nsis',
+ type: 'feature',
+ value: 'disabled',
+ description: 'Generate NSIS files to create Windows installer')
+
# TODO: Missing rpi-omxil
# TODO: Missing gst-decode
# TODO: Missing libva
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/330b4e71516ae1b1d0104b8c9db411a1a550f067...86363b2f28094dd31a09c037f09aa08fb7ff788c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/330b4e71516ae1b1d0104b8c9db411a1a550f067...86363b2f28094dd31a09c037f09aa08fb7ff788c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list