Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Add LUA_LINKER_MAGIC variable that centrally sets LDFL...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3d3fb60ae8ff
branches:  trunk
changeset: 435673:3d3fb60ae8ff
user:      nia <nia%pkgsrc.org@localhost>
date:      Sat Jul 11 15:14:29 2020 +0000

description:
Add LUA_LINKER_MAGIC variable that centrally sets LDFLAGS on Darwin,
as should probably have been done to begin with. Remove per-package hacks.

diffstat:

 archivers/lua-zlib/Makefile     |   7 +------
 databases/lua-lsqlite3/Makefile |   4 +---
 devel/lua-bit32/Makefile        |   4 +---
 devel/lua-compat53/Makefile     |   4 +---
 devel/lua-event/Makefile        |   4 +---
 devel/lua-filesystem/Makefile   |   4 +---
 devel/lua-posix/Makefile        |   8 +-------
 devel/lua-term/Makefile         |   4 +---
 lang/lua/module.mk              |  19 ++++++++++++++++++-
 net/lua-socket/Makefile         |   3 +--
 textproc/lua-cjson/Makefile     |   4 +---
 textproc/lua-lyaml/Makefile     |   4 +---
 textproc/lua-utf8/Makefile      |   4 +---
 13 files changed, 30 insertions(+), 43 deletions(-)

diffs (259 lines):

diff -r 91e1421bde39 -r 3d3fb60ae8ff archivers/lua-zlib/Makefile
--- a/archivers/lua-zlib/Makefile       Sat Jul 11 14:52:19 2020 +0000
+++ b/archivers/lua-zlib/Makefile       Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 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 -r 91e1421bde39 -r 3d3fb60ae8ff databases/lua-lsqlite3/Makefile
--- a/databases/lua-lsqlite3/Makefile   Sat Jul 11 14:52:19 2020 +0000
+++ b/databases/lua-lsqlite3/Makefile   Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 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 -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-bit32/Makefile
--- a/devel/lua-bit32/Makefile  Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-bit32/Makefile  Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 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 -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-compat53/Makefile
--- a/devel/lua-compat53/Makefile       Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-compat53/Makefile       Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 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 -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-event/Makefile
--- a/devel/lua-event/Makefile  Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-event/Makefile  Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 BUILD_DIRS+=   src
 
-LDFLAGS.Darwin+=       -bundle -undefined dynamic_lookup
-
 INSTALLATION_DIRS+=    ${LUA_DOCDIR}
 INSTALLATION_DIRS+=    ${LUA_DOCDIR}/modules
 INSTALLATION_DIRS+=    ${LUA_CDIR}/luaevent
diff -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-filesystem/Makefile
--- a/devel/lua-filesystem/Makefile     Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-filesystem/Makefile     Sat Jul 11 15:14:29 2020 +0000
@@ -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+=           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 -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-posix/Makefile
--- a/devel/lua-posix/Makefile  Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-posix/Makefile  Sat Jul 11 15:14:29 2020 +0000
@@ -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+=      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 -r 91e1421bde39 -r 3d3fb60ae8ff devel/lua-term/Makefile
--- a/devel/lua-term/Makefile   Sat Jul 11 14:52:19 2020 +0000
+++ b/devel/lua-term/Makefile   Sat Jul 11 15:14:29 2020 +0000
@@ -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_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 -r 91e1421bde39 -r 3d3fb60ae8ff lang/lua/module.mk
--- a/lang/lua/module.mk        Sat Jul 11 14:52:19 2020 +0000
+++ b/lang/lua/module.mk        Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 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 -r 91e1421bde39 -r 3d3fb60ae8ff net/lua-socket/Makefile
--- a/net/lua-socket/Makefile   Sat Jul 11 14:52:19 2020 +0000
+++ b/net/lua-socket/Makefile   Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 MAKE_FILE=             makefile
 
-LDFLAGS.Darwin=                -bundle -undefined dynamic_lookup
 LDFLAGS.SunOS=         -lrt -lresolv
 
 MAKE_FLAGS+=           LUAV=${_LUA_DOT_VERSION}
diff -r 91e1421bde39 -r 3d3fb60ae8ff textproc/lua-cjson/Makefile
--- a/textproc/lua-cjson/Makefile       Sat Jul 11 14:52:19 2020 +0000
+++ b/textproc/lua-cjson/Makefile       Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 MAKE_ENV+=     LUA_CDIR=${LUA_CDIR}
 
-LDFLAGS.Darwin+=       -bundle -undefined dynamic_lookup
-
 INSTALLATION_DIRS=     ${LUA_CDIR}
 
 do-install:
diff -r 91e1421bde39 -r 3d3fb60ae8ff textproc/lua-lyaml/Makefile
--- a/textproc/lua-lyaml/Makefile       Sat Jul 11 14:52:19 2020 +0000
+++ b/textproc/lua-lyaml/Makefile       Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 MAKE_FLAGS+=   PKGVERSION=${PKGVERSION}
 
-LDFLAGS.Darwin+=       -bundle -undefined dynamic_lookup
-
 INSTALLATION_DIRS+=    ${LUA_DOCDIR}
 INSTALLATION_DIRS+=    ${LUA_CDIR}
 INSTALLATION_DIRS+=    ${LUA_LDIR}/lyaml
diff -r 91e1421bde39 -r 3d3fb60ae8ff textproc/lua-utf8/Makefile
--- a/textproc/lua-utf8/Makefile        Sat Jul 11 14:52:19 2020 +0000
+++ b/textproc/lua-utf8/Makefile        Sat Jul 11 15:14:29 2020 +0000
@@ -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 @@
 
 WRKSRC=                ${WRKDIR}/${GITHUB_PROJECT}-${PKGVERSION_NOREV}
 
-LDFLAGS.Darwin+=       -bundle -undefined dynamic_lookup
-
 INSTALLATION_DIRS+=    ${LUA_CDIR}
 
 pre-build:



Home | Main Index | Thread Index | Old Index