[vlc-devel] [PATCH 4/5] contrib: lua: rewrite prefix in pkg-config file

Alexandre Janniaux ajanni at videolabs.io
Mon Apr 6 15:56:03 CEST 2020

This patch enable the writing of the pkg-config file for all platforms
and enforce the correct prefix= value in the file. Previously the
pkg-config file was never installed for linux platforms so it was using
the file detection in the configure.ac, which is the last method of

If a newer lua was detected that was not in the contrib file
autodetection, it would build the lua contrib but still configure with
the newer one, which means that contrib includes will be used and then
it will be linked to the detected external lua.

In particular, on Archlinux, when using the default lua (5.3) version,
the contrib would be built but it will still link lua5.3 which has no
symbol for the luaL_register function used when header version is less
than or equal to 5.2.

With previous change, as `lua >= 5.1` is tested first, contrib will be
used first if built whatever the version of lua on the platform, so in
the worst case we only build lua from the contrib too often (like
previously) instead of failing link on some platforms too.
 contrib/src/lua/rules.mak | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index bf5671572c..87de70b7f4 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -83,9 +83,9 @@ endif
 	cd $< && $(HOSTVARS) $(MAKE) install INSTALL_TOP="$(PREFIX)"
 ifdef HAVE_WIN32
 	cd $< && $(RANLIB) "$(PREFIX)/lib/liblua.a"
 	mkdir -p -- "$(PREFIX)/lib/pkgconfig"
-	cp $</etc/lua.pc "$(PREFIX)/lib/pkgconfig/"
+	sed "s#^prefix=.*#prefix=$(PREFIX)#" $</etc/lua.pc > "$(PREFIX)/lib/pkgconfig/lua.pc"
 	touch $@
 .sum-luac: .sum-lua

More information about the vlc-devel mailing list