Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
ca0a02c8 by Alexandre Janniaux at 2026-02-11T16:47:16+01:00
modules: reorder SUBDIRS to process . last

We want to fetch the vlc_modules_list from subdirectories but they must
have already processed their files so that we can include our.

Fix this by reordering SUBDIRS so that "." is processed last instead of
first. This way SUBDIRS (like gui/qt) generate their vlc_modules_list
before the parent directory tries to concatenate them.

- - - - -
f1009d7d by Alexandre Janniaux at 2026-02-11T16:47:16+01:00
apple: improve vlc_modules_list format for SUBDIRS plugins

Change vlc_modules_list format from just plugin names to name:path pairs.
This allows plugins built in SUBDIRS (like the Qt plugin) to specify
their actual location, enabling copy_plugins.sh to find them.

New format: plugin_name: relative/path/to/plugin.dylib

The path is relative to the top build directory as it also inject
$(subdir) in the path from Makefile.am.

- - - - -
0e01acb9 by Alexandre Janniaux at 2026-02-11T16:47:16+01:00
modules: add SUBDIRS support for vlc_modules_list generation

Move the vlc_modules_list generation logic to a shared modulelist.mk file
that can be included by both modules/Makefile.am and modules/gui/qt/Makefile.am.

Now each directory generates its own vlc_modules_list using LTLIBRARIES,
and the parent concatenates lists from SUBDIRS.

- - - - -
ee162c37 by Alexandre Janniaux at 2026-02-11T16:47:16+01:00
qt: generate vlc_modules_list

Now that we have recursive makefile support for vlc_modules_list
generation, we can also reference the Qt plugins by including the
Makefile helper.

- - - - -
4d6c2bd1 by Alexandre Janniaux at 2026-02-11T16:47:16+01:00
modules: add test to validate vlc_modules_list

Add a test script that verifies all plugins listed in vlc_modules_list
exist at their specified paths. This catches issues like incorrect
library extensions on different platforms.

- - - - -


5 changed files:

- extras/package/apple/copy_plugins.sh
- modules/Makefile.am
- + modules/check_vlc_modules_list.sh
- modules/gui/qt/Makefile.am
- + modules/modulelist.mk


Changes:

=====================================
extras/package/apple/copy_plugins.sh
=====================================
@@ -25,21 +25,34 @@ function generate_info_plist()
     echo '</plist>'
 }
 
-PLUGINS=()
+# Parse vlc_modules_list with format: plugin_name: 
relative/path/to/plugin.dylib
+PLUGIN_ENTRIES=()
 for arch in ${ARCHS}; do
-  while read -r plugin; do
-    if [[ ! " ${PLUGINS[*]} " =~ "[[:space:]]${plugin}[[:space:]]" ]]; then
-      PLUGINS+=( "${plugin}" )
+  while IFS= read -r line; do
+    [ -z "$line" ] && continue
+    # Check if entry already exists (by plugin name)
+    plugin="${line%%: *}"
+    found=0
+    for entry in "${PLUGIN_ENTRIES[@]}"; do
+      if [ "${entry%%: *}" = "$plugin" ]; then
+        found=1
+        break
+      fi
+    done
+    if [ $found -eq 0 ]; then
+      PLUGIN_ENTRIES+=( "$line" )
     fi
   done < 
"${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/modules/vlc_modules_list"
 done
 
-for plugin in "${PLUGINS[@]}"; do
+for entry in "${PLUGIN_ENTRIES[@]}"; do
+    plugin="${entry%%: *}"
+    plugin_path="${entry#*: }"
     echo "Copying plugin $plugin for platform ${PLATFORM_NAME}"
 
     INPUT_FILES=()
     for arch in ${ARCHS}; do
-        
input_file="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/modules/.libs/lib${plugin}.dylib"
+        
input_file="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/${plugin_path}"
         if [ ! -f "${input_file}" ]; then
             continue
         fi


=====================================
modules/Makefile.am
=====================================
@@ -5,11 +5,11 @@ pkglib_LTLIBRARIES =
 noinst_HEADERS =
 check_PROGRAMS =
 pkglibexec_PROGRAMS =
-EXTRA_DIST =
+EXTRA_DIST = check_vlc_modules_list.sh
 CLEANFILES =
 
-SUBDIRS = .
-TESTS =
+SUBDIRS =
+TESTS = check_vlc_modules_list.sh
 
 dist_noinst_SCRIPTS = module.rc.in
 EXTRA_LTLIBRARIES =
@@ -127,21 +127,6 @@ SUFFIXES += -client-protocol.h -protocol.c .xml
        $(AM_V_GEN)$(WAYLAND_SCANNER) private-code < "$^" > "[email protected]"
        $(AM_V_at)mv -f -- "[email protected]" "$@"
 
-# Remove the non-plugins, it needs intermediate steps because
-# we can only replace and not match inverse. Instead we;
-#  1/ replace plugins .la targets by plugins names
-#  2/ remove every word which is a .la target (ie. non-plugins)
-#  3/ rename every plugin name back into the target name
-ALL_TARGETS_PLUGIN_RENAMED := $(LTLIBRARIES:lib%_plugin.la=%_plugin)
-PLUGINS_NAMES := $(ALL_TARGETS_PLUGIN_RENAMED:%.la=)
-
-# Generate a list containing the name of every plugin being built
-# Note that it cannot include plugins from recursive makefiles,
-# like the Qt plugin.
-vlc_modules_list: Makefile
-       $(AM_V_GEN)rm -f [email protected]; for plugin in $(PLUGINS_NAMES); do \
-               printf "$${plugin}\n" >> [email protected]; done && \
-               mv [email protected] $@
-
-BUILT_SOURCES += vlc_modules_list
-CLEANFILES += vlc_modules_list
+# Generate vlc_modules_list (local plugins + SUBDIRS)
+include modulelist.mk
+SUBDIRS += .


=====================================
modules/check_vlc_modules_list.sh
=====================================
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Copyright (C) Alexandre Janniaux <[email protected]>
+#
+# License: see COPYING
+#
+## Check that vlc_modules_list points to existing plugins
+set -e
+
+# When run from make check, we're in the modules build directory
+MODULE_LIST="vlc_modules_list"
+
+if [ ! -f "$MODULE_LIST" ]; then
+    echo "ERROR: $MODULE_LIST not found" >&2
+    exit 1
+fi
+
+errors=0
+
+# Parse vlc_modules_list with format: plugin_name: relative/path/to/plugin.ext
+while IFS= read -r line; do
+    [ -z "$line" ] && continue
+
+    plugin="${line%%: *}"
+    plugin_path="${line#*: }"
+
+    # Path is relative to top build directory, we're in modules/
+    full_path="../$plugin_path"
+
+    if [ ! -f "$full_path" ]; then
+        echo "MISSING: $plugin -> $full_path" >&2
+        errors=$((errors + 1))
+    fi
+done < "$MODULE_LIST"
+
+if [ $errors -gt 0 ]; then
+    echo "ERROR: $errors plugin(s) listed in vlc_modules_list not found" >&2
+    exit 1
+fi
+
+echo "OK: All plugins in vlc_modules_list exist"


=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -16,6 +16,10 @@ CLEANFILES =
 include ../../common.am
 guidir = $(pluginsdir)/gui
 gui_LTLIBRARIES =
+
+# Generate vlc_modules_list for Qt plugins
+include ../../modulelist.mk
+
 SUFFIXES += .ui .h .hpp .moc.cpp .qml .js .mjs .moc
 TEST_EXTENSIONS = .qml
 EXTRA_DIST = qt6.pro qtest.pro quicktest.pro scripts


=====================================
modules/modulelist.mk
=====================================
@@ -0,0 +1,30 @@
+# modulelist.mk - Generate vlc_modules_list from LTLIBRARIES and SUBDIRS
+# Paths are relative to top_builddir using automake's $(subdir)
+
+
+# Remove the non-plugins, it needs intermediate steps because
+# we can only replace and not match inverse. Instead we:
+#  1/ replace plugins .la targets by plugins names
+#  2/ remove every word which is a .la target (ie. non-plugins)
+#  3/ rename every plugin name back into the target name
+VLC_PLUGINS_RENAMED = $(LTLIBRARIES:lib%_plugin.la=%_plugin)
+VLC_PLUGINS = $(VLC_PLUGINS_RENAMED:%.la=)
+
+# Generate a list containing the name and path of every plugin being built
+# Format: plugin_name: relative/path/to/plugin$(LIBEXT)
+# This allows plugins from SUBDIRS (like Qt) to specify their actual location
+# The recipee concatenates records from local plugins and those from SUBDIRS
+vlc_modules_list: Makefile
+       $(AM_V_GEN)rm -f [email protected]; \
+       for plugin in $(VLC_PLUGINS); do \
+               printf "$${plugin}: $(subdir)/.libs/lib$${plugin}$(LIBEXT)\n" 
>> [email protected]; \
+       done; \
+       for subdir in $(SUBDIRS); do \
+               [ "$$subdir" = "." ] && continue; \
+               [ -f "$$subdir/vlc_modules_list" ] && \
+                       cat "$$subdir/vlc_modules_list" >> [email protected]; \
+       done; \
+       if [ -s "[email protected]" ]; then mv [email protected] $@; else rm -f [email protected] && touch $@; fi
+
+BUILT_SOURCES += vlc_modules_list
+CLEANFILES += vlc_modules_list



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/6484ef36750456d0b48bd05c86042fb461d905f3...4d6c2bd16363c2d86ea7c2b7ff3e3eb6604651ae

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/6484ef36750456d0b48bd05c86042fb461d905f3...4d6c2bd16363c2d86ea7c2b7ff3e3eb6604651ae
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to