summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2020-07-11 15:14:29 +0000
committernia <nia@pkgsrc.org>2020-07-11 15:14:29 +0000
commitb8d59e43d438eaf408e08948140b93e013f2ec3d (patch)
tree9b22b9d284dec844047099206933d00679b33402
parent86f2d98a8e5e8aa285343909a3a7fd0d1eb64cf0 (diff)
downloadpkgsrc-b8d59e43d438eaf408e08948140b93e013f2ec3d.tar.gz
Add LUA_LINKER_MAGIC variable that centrally sets LDFLAGS on Darwin,
as should probably have been done to begin with. Remove per-package hacks.
-rw-r--r--archivers/lua-zlib/Makefile7
-rw-r--r--databases/lua-lsqlite3/Makefile4
-rw-r--r--devel/lua-bit32/Makefile4
-rw-r--r--devel/lua-compat53/Makefile4
-rw-r--r--devel/lua-event/Makefile4
-rw-r--r--devel/lua-filesystem/Makefile4
-rw-r--r--devel/lua-posix/Makefile8
-rw-r--r--devel/lua-term/Makefile4
-rw-r--r--lang/lua/module.mk19
-rw-r--r--net/lua-socket/Makefile3
-rw-r--r--textproc/lua-cjson/Makefile4
-rw-r--r--textproc/lua-lyaml/Makefile4
-rw-r--r--textproc/lua-utf8/Makefile4
13 files changed, 30 insertions, 43 deletions
diff --git a/archivers/lua-zlib/Makefile b/archivers/lua-zlib/Makefile
index 2da0dc3e5f1..7da00a011cb 100644
--- a/archivers/lua-zlib/Makefile
+++ b/archivers/lua-zlib/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/07/11 14:30:25 nia Exp $
+# $NetBSD: Makefile,v 1.5 2020/07/11 15:14:29 nia Exp $
DISTNAME= lua-zlib-1.2
PKGNAME= ${DISTNAME:S/lua-/${LUA_PKGPREFIX}-/1}
@@ -17,12 +17,7 @@ BUILD_TARGET= zlib.so
MAKE_FLAGS+= CC=${CC}
MAKE_FLAGS+= LD=${CC}
MAKE_FLAGS+= CFLAGS="${CFLAGS} -fPIC"
-
-.if ${OPSYS} == "Darwin"
-MAKE_FLAGS+= LDFLAGS="${LDFLAGS} -shared -undefined dynamic_lookup"
-.else
MAKE_FLAGS+= LDFLAGS="${LDFLAGS} -shared"
-.endif
INSTALLATION_DIRS+= ${LUA_CDIR}
diff --git a/databases/lua-lsqlite3/Makefile b/databases/lua-lsqlite3/Makefile
index 551bb413464..a5e97fc2518 100644
--- a/databases/lua-lsqlite3/Makefile
+++ b/databases/lua-lsqlite3/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/11 15:14:29 nia Exp $
DISTNAME= lsqlite3_fsl09y
PKGNAME= ${LUA_PKGPREFIX}-lsqlite3-0.9.5
@@ -11,8 +11,6 @@ HOMEPAGE= http://lua.sqlite.org/index.cgi/index
COMMENT= Binding for Lua to the SQLite3 database library
LICENSE= mit
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS+= ${LUA_CDIR} ${LUA_LDIR}
INSTALLATION_DIRS+= ${LUA_DOCDIR}/examples
diff --git a/devel/lua-bit32/Makefile b/devel/lua-bit32/Makefile
index 56008b8ed19..e55bed5b896 100644
--- a/devel/lua-bit32/Makefile
+++ b/devel/lua-bit32/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/11 15:14:29 nia Exp $
# Keep versioning in sync with the luarocks rockspec.
DISTNAME= lua-compat53-0.9
@@ -16,8 +16,6 @@ LICENSE= mit
CONFLICTS+= ${LUA_PKGPREFIX}-bitlib-[0-9]*
SUPERSEDES+= ${LUA_PKGPREFIX}-bitlib-[0-9]*
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS+= ${LUA_CDIR}
pre-build:
diff --git a/devel/lua-compat53/Makefile b/devel/lua-compat53/Makefile
index 926259a9ec2..de0a7e0bf6b 100644
--- a/devel/lua-compat53/Makefile
+++ b/devel/lua-compat53/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.5 2020/07/11 15:14:29 nia Exp $
DISTNAME= lua-compat53-0.9
PKGNAME= ${LUA_PKGPREFIX}-${DISTNAME:S/^lua-//1}
@@ -14,8 +14,6 @@ LICENSE= mit
PLIST_SUBST+= LUA_INCDIR=${LUA_INCDIR}
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
PRINT_PLIST_AWK+= /^${LUA_INCDIR:S|/|\\/|g}/ \
{ gsub(/${LUA_INCDIR:S|/|\\/|g}/, "$${LUA_INCDIR}") }
diff --git a/devel/lua-event/Makefile b/devel/lua-event/Makefile
index b9b72c473ce..02a5b487190 100644
--- a/devel/lua-event/Makefile
+++ b/devel/lua-event/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/11 15:14:29 nia Exp $
DISTNAME= luaevent-0.4.6
PKGNAME= ${LUA_PKGPREFIX}-${DISTNAME:S/^lua//1}
@@ -14,8 +14,6 @@ LICENSE= mit
BUILD_DIRS+= src
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS+= ${LUA_DOCDIR}
INSTALLATION_DIRS+= ${LUA_DOCDIR}/modules
INSTALLATION_DIRS+= ${LUA_CDIR}/luaevent
diff --git a/devel/lua-filesystem/Makefile b/devel/lua-filesystem/Makefile
index 927e33b2dd0..52a9a4116fb 100644
--- a/devel/lua-filesystem/Makefile
+++ b/devel/lua-filesystem/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2020/07/11 14:48:58 nia Exp $
+# $NetBSD: Makefile,v 1.18 2020/07/11 15:14:29 nia Exp $
#
DISTNAME= luafilesystem-1.8.0
@@ -25,7 +25,5 @@ MAKE_FLAGS+= CC=${CC}
MAKE_FLAGS+= CFLAGS="${CFLAGS} -fPIC"
MAKE_FLAGS+= LUA_VERSION=${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
.include "../../lang/lua/module.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/lua-posix/Makefile b/devel/lua-posix/Makefile
index ac70f839355..0795a93acad 100644
--- a/devel/lua-posix/Makefile
+++ b/devel/lua-posix/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2020/07/11 14:48:58 nia Exp $
+# $NetBSD: Makefile,v 1.22 2020/07/11 15:14:29 nia Exp $
DISTNAME= luaposix-34.1.1
PKGNAME= ${DISTNAME:S/lua/${LUA_PKGPREFIX}-/}
@@ -24,13 +24,7 @@ DEPENDS+= ${LUA_PKGPREFIX}-std-_debug-[0-9]*:../../devel/lua-std-_debug
DEPENDS+= lua51-bit32-[0-9]*:../../devel/lua-bit32
.endif
-.include "../../mk/bsd.prefs.mk"
-
-.if ${OPSYS} == "Darwin"
-LIBFLAG+= ${LDFLAGS} -fPIC -bundle -undefined dynamic_lookup
-.else
LIBFLAG+= ${LDFLAGS} -shared -fPIC
-.endif
do-build:
cd ${WRKSRC} && \
diff --git a/devel/lua-term/Makefile b/devel/lua-term/Makefile
index 676be92ae14..9747d5f8da6 100644
--- a/devel/lua-term/Makefile
+++ b/devel/lua-term/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/07/11 14:48:58 nia Exp $
+# $NetBSD: Makefile,v 1.5 2020/07/11 15:14:29 nia Exp $
DISTNAME= lua-term-0.07
PKGNAME= ${DISTNAME:S/lua/${LUA_PKGPREFIX}/}
@@ -19,7 +19,5 @@ MAKE_FLAGS+= LUA_INC=${PREFIX}/${LUA_INCDIR}
MAKE_FLAGS+= LUA_LIBDIR=${PREFIX}/${LUA_CDIR}/term
MAKE_FLAGS+= LUA_SHARE=${PREFIX}/${LUA_LDIR}/term
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
.include "../../lang/lua/module.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/lang/lua/module.mk b/lang/lua/module.mk
index 0b52994006a..0399357dc42 100644
--- a/lang/lua/module.mk
+++ b/lang/lua/module.mk
@@ -1,8 +1,20 @@
-# $NetBSD: module.mk,v 1.8 2020/07/09 15:01:53 nia Exp $
+# $NetBSD: module.mk,v 1.9 2020/07/11 15:14:30 nia Exp $
#
# This Makefile fragment is intended to be included by packages that
# install Lua modules.
#
+# === Package-settable variables ===
+#
+# LUA_LINKER_MAGIC
+# This appends LDFLAGS to properly link Lua modules on non-ELF
+# linkers.
+#
+# You probably want to set this to "no" if the package links
+# binaries that are not Lua modules.
+#
+# Possible values: yes no
+# Default: yes
+#
# === Defined variables ===
#
# LUA_LDIR
@@ -56,6 +68,11 @@ PRINT_PLIST_AWK+= /^${LUA_DOCDIR:S|/|\\/|g}/ \
LUA_EXAMPLESDIR= share/examples/${PKGBASE}
PLIST_SUBST+= LUA_EXAMPLESDIR=${LUA_EXAMPLESDIR}
+LUA_LINKER_MAGIC?= yes
+
+.if !empty(LUA_LINKER_MAGIC:M[yY][eE][sS])
LDFLAGS.Cygwin+= -llua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
+.endif
.endif # LUA_MODULE_MK
diff --git a/net/lua-socket/Makefile b/net/lua-socket/Makefile
index 68aba35a9c0..426e401df7b 100644
--- a/net/lua-socket/Makefile
+++ b/net/lua-socket/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2020/07/11 14:51:02 nia Exp $
+# $NetBSD: Makefile,v 1.13 2020/07/11 15:14:30 nia Exp $
DISTNAME= luasocket-3.0-rc1
PKGNAME= ${LUA_PKGPREFIX}-${DISTNAME:S/lua//:S/-rc/rc/}
@@ -13,7 +13,6 @@ LICENSE= mit
MAKE_FILE= makefile
-LDFLAGS.Darwin= -bundle -undefined dynamic_lookup
LDFLAGS.SunOS= -lrt -lresolv
MAKE_FLAGS+= LUAV=${_LUA_DOT_VERSION}
diff --git a/textproc/lua-cjson/Makefile b/textproc/lua-cjson/Makefile
index 86f96cb5780..8567217d01e 100644
--- a/textproc/lua-cjson/Makefile
+++ b/textproc/lua-cjson/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2020/07/11 14:52:19 nia Exp $
+# $NetBSD: Makefile,v 1.8 2020/07/11 15:14:30 nia Exp $
DISTNAME= lua-cjson-2.1.0
PKGNAME= ${LUA_PKGPREFIX}-${DISTNAME:S/^lua-//1}
@@ -15,8 +15,6 @@ USE_TOOLS+= gmake
MAKE_ENV+= LUA_CDIR=${LUA_CDIR}
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS= ${LUA_CDIR}
do-install:
diff --git a/textproc/lua-lyaml/Makefile b/textproc/lua-lyaml/Makefile
index 497611b3f3d..8ed71b6b9e7 100644
--- a/textproc/lua-lyaml/Makefile
+++ b/textproc/lua-lyaml/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/11 15:14:30 nia Exp $
DISTNAME= lyaml-6.2.5
PKGNAME= ${LUA_PKGPREFIX}-${DISTNAME}
@@ -16,8 +16,6 @@ BUILD_DIRS= ext/yaml
MAKE_FLAGS+= PKGVERSION=${PKGVERSION}
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS+= ${LUA_DOCDIR}
INSTALLATION_DIRS+= ${LUA_CDIR}
INSTALLATION_DIRS+= ${LUA_LDIR}/lyaml
diff --git a/textproc/lua-utf8/Makefile b/textproc/lua-utf8/Makefile
index 499ce44edf1..26104930af6 100644
--- a/textproc/lua-utf8/Makefile
+++ b/textproc/lua-utf8/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/07/11 14:48:57 nia Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/11 15:14:30 nia Exp $
DISTNAME= lua-utf8-0.1.2
PKGNAME= ${DISTNAME:S/lua-/${LUA_PKGPREFIX}-/1}
@@ -13,8 +13,6 @@ LICENSE= mit
WRKSRC= ${WRKDIR}/${GITHUB_PROJECT}-${PKGVERSION_NOREV}
-LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup
-
INSTALLATION_DIRS+= ${LUA_CDIR}
pre-build: