pkgsrc/devel/lua-filesystem/patches/patch-config
maya ff7bc5e929 lua-filesystem: update to 1.7.0
Update provided by Jonathan Buschmann in PR pkg/53787.
I added some pkgconfig invocations, because otherwise it was linking
to lua without the RPATH to liblua.
Added a test target.

Version 1.7.0 [15/Sep/2017]

        symlinkattributes function now provides 'target' field, containing name of the file that the symlink points to.
        attributes, symlinkattributes, touch, mkdir, and rmdir functions now return system-dependent error code as the third value on error.
        Fixed detection of closed files for Lua 5.2+ in setmode, lock, and unlock functions.
        Fixed various compiler warnings.
s: ----------------------------------------------------------------------
2019-05-28 20:43:04 +00:00

42 lines
1.2 KiB
Text

$NetBSD: patch-config,v 1.1 2019/05/28 20:43:04 maya Exp $
Fix default directory locations
Try to find lua libs from pkgconfig, so we get RPATH specified.
(This eliminates the need to separately add -lm)
--- config.orig 2017-09-15 23:07:33.000000000 +0000
+++ config
@@ -1,22 +1,28 @@
# Installation directories
# Default installation prefix
-PREFIX=/usr/local
+PREFIX?=/usr/local
# System's libraries directory (where binary libraries are installed)
-LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
+LUA_LIBS= $(pkg-config --libs lua-$(LUA_VERS))
+LUA_LIBDIR= $(DESTDIR)$(PREFIX)/$(LUA_CDIR)
# Lua includes directory
LUA_INC= $(PREFIX)/include
# OS dependent
-LIB_OPTION= -shared #for Linux
-#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
+ifeq ($(shell uname -s 2>/dev/null), Darwin)
+# for macOS
+LIB_OPTION+= -L$(PREFIX)/lib $(LUA_LIBS) -shared -install_name $(PREFIX)/$(LUA_CDIR)/$(notdir $@)
+else
+# for Linux & other unix
+LIB_OPTION+= -L$(PREFIX)/lib $(LUA_LIBS) -shared
+endif
LIBNAME= $T.so.$V
# Compilation directives
-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+WARN= -O2 -fPIC
INCS= -I$(LUA_INC)
CFLAGS= $(WARN) $(INCS)
CC= gcc