pkgsrc-WIP-changes archive

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

lua-lpeg: add missing .so symlink on macOS



Module Name:	pkgsrc-wip
Committed By:	arcathrax <ivan%ivanpollak.com@localhost>
Pushed By:	arcathrax
Date:		Fri Oct 23 02:07:55 2026 +0200
Changeset:	ce3159e45cf9a28b153213e152cf94cfb8ae94d4

Added Files:
	lua-lpeg/DESCR
	lua-lpeg/Makefile
	lua-lpeg/PLIST
	lua-lpeg/PLIST.Darwin
	lua-lpeg/buildlink3.mk
	lua-lpeg/distinfo
	lua-lpeg/patches/patch-makefile

Log Message:
lua-lpeg: add missing .so symlink on macOS

for lua to successfully load lua-lpeg, the shared library needs to have a .so
extension instead of the .dylib that will be generated on macOS. This patch
fixes this, making it possible to use lua-lpeg without manually needing to
symlink this afterwards.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ce3159e45cf9a28b153213e152cf94cfb8ae94d4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lua-lpeg/DESCR                  |  2 ++
 lua-lpeg/Makefile               | 52 +++++++++++++++++++++++++++++++++++++++++
 lua-lpeg/PLIST                  |  7 ++++++
 lua-lpeg/PLIST.Darwin           |  8 +++++++
 lua-lpeg/buildlink3.mk          | 16 +++++++++++++
 lua-lpeg/distinfo               |  6 +++++
 lua-lpeg/patches/patch-makefile | 19 +++++++++++++++
 7 files changed, 110 insertions(+)

diffs:
diff --git a/lua-lpeg/DESCR b/lua-lpeg/DESCR
new file mode 100644
index 0000000000..10fec12859
--- /dev/null
+++ b/lua-lpeg/DESCR
@@ -0,0 +1,2 @@
+LPeg is a new pattern-matching library for Lua, based on
+Parsing Expression Grammars (PEGs).
diff --git a/lua-lpeg/Makefile b/lua-lpeg/Makefile
new file mode 100644
index 0000000000..006f3dfaed
--- /dev/null
+++ b/lua-lpeg/Makefile
@@ -0,0 +1,52 @@
+# $NetBSD: Makefile,v 1.22 2026/01/07 08:39:52 wiz Exp $
+
+DISTNAME=	lpeg-1.1.0
+PKGREVISION=	2
+PKGNAME=	${DISTNAME:S/lpeg/${LUA_PKGPREFIX}-lpeg/}
+CATEGORIES=	devel lua
+MASTER_SITES=	https://www.inf.puc-rio.br/~roberto/lpeg/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://www.inf.puc-rio.br/~roberto/lpeg/
+COMMENT=	Parsing Expression Grammars (PEGs) library for Lua
+LICENSE=	mit
+
+NO_CONFIGURE=	yes
+USE_TOOLS+=	gmake
+# For Darwin
+MAKE_ENV+=	LUA_CDIR=${LUA_CDIR}
+MAKE_FILE=	makefile
+TEST_TARGET=	test
+
+BUILD_TARGET.Darwin=	macosx
+BUILD_TARGET.*=		linux
+
+SUBST_CLASSES+=		test
+SUBST_MESSAGE.test=	Fixing shebang in test.lua
+SUBST_STAGE.test=	post-build
+SUBST_FILES.test=	test.lua
+SUBST_SED.test=		-e 's,/usr/bin/env *lua,${LUA_INTERPRETER},'
+
+INSTALLATION_DIRS+=	${LUA_CDIR} ${LUA_LDIR} ${LUA_DOCDIR}
+
+.include "../../mk/bsd.prefs.mk"
+
+do-install:
+	${INSTALL_LIB} ${WRKSRC}/lpeg.${SHLIB_EXT} \
+		${DESTDIR}${PREFIX}/${LUA_CDIR}
+.if ${OPSYS} == "Darwin"
+	${LN} -s ${DESTDIR}${PREFIX}/${LUA_CDIR}/lpeg.${SHLIB_EXT} \
+		${DESTDIR}${PREFIX}/${LUA_CDIR}/lpeg.so
+.endif
+	${INSTALL_DATA} ${WRKSRC}/re.lua \
+		${DESTDIR}${PREFIX}/${LUA_LDIR}
+	${INSTALL_DATA} ${WRKSRC}/*.html \
+		${DESTDIR}${PREFIX}/${LUA_DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/lpeg-128.gif \
+		${DESTDIR}${PREFIX}/${LUA_DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/HISTORY \
+		${DESTDIR}${PREFIX}/${LUA_DOCDIR}
+
+.include "../../lang/lua/module.mk"
+.include "../../lang/lua/application.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lua-lpeg/PLIST b/lua-lpeg/PLIST
new file mode 100644
index 0000000000..c0f3e8a81d
--- /dev/null
+++ b/lua-lpeg/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.5 2025/05/02 11:18:43 jperkin Exp $
+${LUA_CDIR}/lpeg.${SHLIB_EXT}
+${LUA_DOCDIR}/lpeg.html
+${LUA_DOCDIR}/re.html
+${LUA_DOCDIR}/lpeg-128.gif
+${LUA_DOCDIR}/HISTORY
+${LUA_LDIR}/re.lua
diff --git a/lua-lpeg/PLIST.Darwin b/lua-lpeg/PLIST.Darwin
new file mode 100644
index 0000000000..29d13cf375
--- /dev/null
+++ b/lua-lpeg/PLIST.Darwin
@@ -0,0 +1,8 @@
+@comment $NetBSD$
+${LUA_CDIR}/lpeg.${SHLIB_EXT}
+${LUA_CDIR}/lpeg.so
+${LUA_DOCDIR}/HISTORY
+${LUA_DOCDIR}/lpeg-128.gif
+${LUA_DOCDIR}/lpeg.html
+${LUA_DOCDIR}/re.html
+${LUA_LDIR}/re.lua
diff --git a/lua-lpeg/buildlink3.mk b/lua-lpeg/buildlink3.mk
new file mode 100644
index 0000000000..22f8e39258
--- /dev/null
+++ b/lua-lpeg/buildlink3.mk
@@ -0,0 +1,16 @@
+#	$NetBSD: buildlink3.mk,v 1.2 2025/02/07 07:50:33 adam Exp $
+
+BUILDLINK_TREE+=	lua-lpeg
+
+.if !defined(LUA_LPEG_BUILDLINK3_MK)
+LUA_LPEG_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lua-lpeg+=	${LUA_PKGPREFIX}-lpeg>=1.1.0nb1
+BUILDLINK_ABI_DEPENDS.lua-lpeg+=	${LUA_PKGPREFIX}-lpeg>=1.1.0nb1
+BUILDLINK_PKGSRCDIR.lua-lpeg=		../../devel/lua-lpeg
+
+BUILDLINK_FILES.lua-lpeg+=	lib/lua/*/lpeg.dylib
+BUILDLINK_FILES.lua-lpeg+=	lib/lua/*/lpeg.so
+.endif
+
+BUILDLINK_TREE+=	-lua-lpeg
diff --git a/lua-lpeg/distinfo b/lua-lpeg/distinfo
new file mode 100644
index 0000000000..e332807116
--- /dev/null
+++ b/lua-lpeg/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.13 2025/01/22 18:16:58 adam Exp $
+
+BLAKE2s (lpeg-1.1.0.tar.gz) = d3681bbc523cb81bc921bb22ce5a4ccaae8ce593916ba17b573b788b05651e75
+SHA512 (lpeg-1.1.0.tar.gz) = 01b2a4ceb2d110e143603bc63c84a59736ea735dd0ed9866286ba115d41be48d09c9ff21c8e2327974d2296944f6508d50a5c3a18f26ac1d81b8b2fc41f61222
+Size (lpeg-1.1.0.tar.gz) = 78042 bytes
+SHA1 (patch-makefile) = fc723ba72934aa34e1a0febb2dc21cd7b77eb731
diff --git a/lua-lpeg/patches/patch-makefile b/lua-lpeg/patches/patch-makefile
new file mode 100644
index 0000000000..2ad1483c2f
--- /dev/null
+++ b/lua-lpeg/patches/patch-makefile
@@ -0,0 +1,19 @@
+$NetBSD: patch-makefile,v 1.3 2025/01/22 18:16:58 adam Exp $
+
+Honor LDFLAGS for RELRO builds.
+On Darwin, build dylib for neovim.
+
+--- makefile.orig	2023-06-26 16:30:55.000000000 +0000
++++ makefile
+@@ -37,9 +37,10 @@ linux:
+ # For Mac OS
+ macosx:
+ 	$(MAKE) lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
++	env $(CC) -dynamiclib -Wl,-undefined,dynamic_lookup,-install_name,${PREFIX}/${LUA_CDIR}/lpeg.dylib $(FILES) -o lpeg.dylib
+ 
+ lpeg.so: $(FILES)
+-	env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
++	env $(CC) $(LDFLAGS) $(DLLFLAGS) $(FILES) -o lpeg.so
+ 
+ $(FILES): makefile
+ 


Home | Main Index | Thread Index | Old Index