[vlc-devel] [PATCH v2 5/6] contrib: lua: autodetect lua >= 5.1

Alexandre Janniaux ajanni at videolabs.io
Sat Nov 14 16:30:03 CET 2020


When building on ArchLinux currently, the contrib was built even if
lua5.3 is installed. As at least Archlinux and Debian are exposing both
a luaX.Y.pc and lua.pc file for the latest supported version of lua,
detecting that the system version is correct through lua.pc should
also ensure that the latest compatible version is installed and used
instead.

The other checks are still needed as you can for example install lua5.2
(which will expose a lua5.2.pc file but no lua.pc file) without having
to install lua (5.3).

It is worth noticing that being able to use lua >= 5.1 doesn't mean any
version of lua >= 5.1 would be compatible. The source code is completely
compliant to those version and native builds will have no issues with
using a more recent version, but cross-compilation environment for 32bit
environment from a 64bit one won't and need the appropriate version to
be installed.
---
 contrib/src/lua/rules.mak | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 491353b484..c64eb6299d 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -28,6 +28,9 @@ endif
 # Feel free to add autodetection if you need to...
 PKGS += lua luac
 PKGS_ALL += luac
+ifeq ($(call need_pkg,"lua >= 5.1"),)
+PKGS_FOUND += lua luac
+endif
 ifeq ($(call need_pkg,"lua5.2"),)
 PKGS_FOUND += lua luac
 endif
-- 
2.29.2



More information about the vlc-devel mailing list