[crux-commits] ports/opt (3.5): lua53: initial import

crux at crux.nu crux at crux.nu
Mon Jul 13 13:04:58 UTC 2020


commit bd2e3d3a117b0efbd17d0c067cdf1d9c82e63687
Author: Danny Rawlins <monster.romster at gmail.com>
Date:   Mon Jul 13 23:04:47 2020 +1000

    lua53: initial import

diff --git a/lua53/.footprint b/lua53/.footprint
new file mode 100644
index 000000000..648e15408
--- /dev/null
+++ b/lua53/.footprint
@@ -0,0 +1,30 @@
+drwxr-xr-x	root/root	usr/
+drwxr-xr-x	root/root	usr/bin/
+-rwxr-xr-x	root/root	usr/bin/lua5.3
+-rwxr-xr-x	root/root	usr/bin/luac5.3
+drwxr-xr-x	root/root	usr/include/
+drwxr-xr-x	root/root	usr/include/lua5.3/
+-rw-r--r--	root/root	usr/include/lua5.3/lauxlib.h
+-rw-r--r--	root/root	usr/include/lua5.3/lua.h
+-rw-r--r--	root/root	usr/include/lua5.3/lua.hpp
+-rw-r--r--	root/root	usr/include/lua5.3/luaconf.h
+-rw-r--r--	root/root	usr/include/lua5.3/lualib.h
+drwxr-xr-x	root/root	usr/lib/
+lrwxrwxrwx	root/root	usr/lib/liblua.so.5.3 -> liblua5.3.so
+lrwxrwxrwx	root/root	usr/lib/liblua.so.5.3.5 -> liblua5.3.so
+-rw-r--r--	root/root	usr/lib/liblua5.3.a
+lrwxrwxrwx	root/root	usr/lib/liblua5.3.so -> liblua5.3.so.5.3.5
+lrwxrwxrwx	root/root	usr/lib/liblua5.3.so.5.3 -> liblua5.3.so.5.3.5
+-rwxr-xr-x	root/root	usr/lib/liblua5.3.so.5.3.5
+drwxr-xr-x	root/root	usr/lib/lua/
+drwxr-xr-x	root/root	usr/lib/lua/5.3/
+drwxr-xr-x	root/root	usr/lib/pkgconfig/
+lrwxrwxrwx	root/root	usr/lib/pkgconfig/lua-5.3.pc -> lua53.pc
+lrwxrwxrwx	root/root	usr/lib/pkgconfig/lua5.3.pc -> lua53.pc
+drwxr-xr-x	root/root	usr/share/
+drwxr-xr-x	root/root	usr/share/lua/
+drwxr-xr-x	root/root	usr/share/lua/5.3/
+drwxr-xr-x	root/root	usr/share/man/
+drwxr-xr-x	root/root	usr/share/man/man1/
+-r--r--r--	root/root	usr/share/man/man1/lua5.3.1.gz
+-rw-r--r--	root/root	usr/share/man/man1/luac5.3.1.gz
diff --git a/lua53/.signature b/lua53/.signature
new file mode 100644
index 000000000..5c2eb3f67
--- /dev/null
+++ b/lua53/.signature
@@ -0,0 +1,7 @@
+untrusted comment: verify with /etc/ports/opt.pub
+RWSE3ohX2g5d/RfY3g/DYi4ozJ7K6BemHtk1CexcdzpXeujzYZbhkDcqdP6RDWSUuuNaCRVDxy/j4/0BOdhJZ+xt/l6/hFv4owc=
+SHA256 (Pkgfile) = 4e5a3d985b69cf2613d2f93f5e8b0e77e935f11aa8319956f96f7b163e8088fe
+SHA256 (.footprint) = e03e4f855d1fd4f6d7c5eaaa6bfa7622e9654082501f10496ab186b7a2aee05f
+SHA256 (lua-5.3.5.tar.gz) = 0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
+SHA256 (liblua.so.patch) = 2cc83c77423a2dda3696766b2d1ccee2796e052ab04d5178905f41ed9241a3d8
+SHA256 (lua.pc) = ca9252633e782b8f85d6a94ea4f6babd4fe30bd759085b373160b1878e36ff78
diff --git a/lua53/Pkgfile b/lua53/Pkgfile
new file mode 100644
index 000000000..595294e54
--- /dev/null
+++ b/lua53/Pkgfile
@@ -0,0 +1,51 @@
+# Description: A programming language designed for extending applications.
+# URL: https://www.lua.org/
+# Maintainer: Danny Rawlins, crux at romster dot me
+# Depends on: readline
+
+name=lua53
+version=5.3.5
+release=1
+source=(https://www.lua.org/ftp/lua-$version.tar.gz
+	liblua.so.patch lua.pc)
+
+build() {
+	cd lua-$version
+
+	patch -p1 -i $SRC/liblua.so.patch
+
+	sed -e "s/%VER%/${version%.*}/g;s/%REL%/$version/g" $SRC/lua.pc > lua.pc
+
+	# Lua 5.3.4 has wrong release version in its Makefile. Fix it.
+	sed "s/^R= \$V.4/R= \$V.5/" -i Makefile
+
+	sed -e 's:llua:llua5.3:' -e 's:/include:/include/lua5.3:' -i lua.pc
+	sed -r \
+		-e '/^LUA_(SO|A|T)=/ s/lua/lua5.3/' \
+		-e '/^LUAC_T=/ s/luac/luac5.3/' \
+		-i src/Makefile
+
+	make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" linux
+
+	install -d $PKG/usr/include/lua5.3 $PKG/usr/share/man/man1 $PKG/usr/lib
+
+	make \
+		TO_BIN="lua5.3 luac5.3" \
+		TO_LIB="liblua5.3.a liblua5.3.so liblua5.3.so.5.3 liblua5.3.so.$version" \
+		INSTALL_DATA='cp -d' \
+		INSTALL_TOP="$PKG/usr" \
+		INSTALL_INC="$PKG/usr/include/lua5.3" \
+		INSTALL_MAN="$PKG/usr/share/man/man1" \
+		install
+
+	install -m 0644 -D lua.pc $PKG/usr/lib/pkgconfig/lua5.3.pc
+	ln -sf lua53.pc $PKG/usr/lib/pkgconfig/lua5.3.pc
+	ln -sf lua53.pc $PKG/usr/lib/pkgconfig/lua-5.3.pc
+
+	ln -s liblua5.3.so $PKG/usr/lib/liblua.so.5.3
+	ln -s liblua5.3.so $PKG/usr/lib/liblua.so.$version
+
+	cd $PKG/usr/share/man/man1
+	mv lua.1 lua5.3.1
+	mv luac.1 luac5.3.1
+}
diff --git a/lua53/liblua.so.patch b/lua53/liblua.so.patch
new file mode 100644
index 000000000..f9e24f328
--- /dev/null
+++ b/lua53/liblua.so.patch
@@ -0,0 +1,60 @@
+diff --git a/Makefile b/Makefile
+index 7fa91c8..dccf485 100644
+--- a/Makefile
++++ b/Makefile
+@@ -52,7 +52,7 @@ R= $V.0
+ all:	$(PLAT)
+ 
+ $(PLATS) clean:
+-	cd src && $(MAKE) $@
++	cd src && $(MAKE) $@ V=$(V) R=$(R)
+ 
+ test:	dummy
+ 	src/lua -v
+diff --git a/src/Makefile b/src/Makefile
+index 2e7a412..fa5769f 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,6 +29,7 @@ MYOBJS=
+ PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+ 
+ LUA_A=	liblua.a
++LUA_SO= liblua.so
+ CORE_O=	lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
+ 	lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
+ 	ltm.o lundump.o lvm.o lzio.o
+@@ -43,7 +44,7 @@ LUAC_T=	luac
+ LUAC_O=	luac.o
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+ 
+ # Targets start here.
+@@ -59,6 +60,12 @@ $(LUA_A): $(BASE_O)
+ 	$(AR) $@ $(BASE_O)
+ 	$(RANLIB) $@
+ 
++$(LUA_SO): $(CORE_O) $(LIB_O)
++	$(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO)
++
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+ 	$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+diff --git a/src/luaconf.h b/src/luaconf.h
+index fd28d21..e2662cc 100644
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -175,7 +175,7 @@
+ 
+ #else			/* }{ */
+ 
+-#define LUA_ROOT	"/usr/local/"
++#define LUA_ROOT	"/usr/"
+ #define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR "/"
+ #define LUA_PATH_DEFAULT  \
diff --git a/lua53/lua.pc b/lua53/lua.pc
new file mode 100644
index 000000000..bf7977bcd
--- /dev/null
+++ b/lua53/lua.pc
@@ -0,0 +1,20 @@
+V=%VER%
+R=%REL%
+
+prefix=/usr
+INSTALL_BIN=${prefix}/bin
+INSTALL_INC=${prefix}/include
+INSTALL_LIB=${prefix}/lib
+INSTALL_MAN=${prefix}/man/man1
+INSTALL_LMOD=${prefix}/share/lua/${V}
+INSTALL_CMOD=${prefix}/lib/lua/${V}
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${R}
+Requires: 
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}


More information about the crux-commits mailing list