[vlc-commits] contrib: lua: autodetect lua >= 5.1

Alexandre Janniaux git at videolan.org
Fri Dec 11 10:12:41 UTC 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Apr  6 15:56:00 2020 +0200| [5e3357b4a401ef40fdc6d2823f0f7d0c3b0405cf] | committer: Alexandre Janniaux

contrib: lua: autodetect lua >= 5.1

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e3357b4a401ef40fdc6d2823f0f7d0c3b0405cf
---

 contrib/src/lua/rules.mak | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 21f30cccc9..b44fd2c8af 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -28,12 +28,17 @@ 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
+else
 ifeq ($(call need_pkg,"lua5.2"),)
 PKGS_FOUND += lua luac
-endif
+else
 ifeq ($(call need_pkg,"lua5.1"),)
 PKGS_FOUND += lua luac
 endif
+endif
+endif
 
 $(TARBALLS)/lua-$(LUA_VERSION).tar.gz:
 	$(call download_pkg,$(LUA_URL),lua)



More information about the vlc-commits mailing list