[vlc-commits] contrib: lua: rewrite prefix in pkg-config file

Alexandre Janniaux git at videolan.org
Sat Apr 11 09:13:22 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Apr  6 11:24:14 2020 +0200| [e9c04ec4779d4369fb6042d2a5a9badd7e4ac98f] | committer: Alexandre Janniaux

contrib: lua: rewrite prefix in pkg-config file

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
detection.

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.

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

 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 d0ce491c91..f9315e1594 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -80,9 +80,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/"
 endif
+	mkdir -p -- "$(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-commits mailing list