fritzkink
2023-10-03 3c9fcad8bd25aa12e6af2fb6276d10211fcf93ee
lua-54 - new package (latest lua version)

9 files added
409 ■■■■■ changed files
components/runtime/lua-54/Makefile 80 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/files/lua.pc 11 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/lua-54.p5m 44 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/lua.license 6 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/manifests/sample-manifest.p5m 42 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/patches/01-src.Makefile.patch 69 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/patches/02-headers.patch 87 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/patches/03-Makefile.patch 60 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/pkg5 10 ●●●●● patch | view | raw | blame | history
components/runtime/lua-54/Makefile
New file
@@ -0,0 +1,80 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016. Adam Stevko. All rights reserved.
# Copyright (c) 2020, Andreas Wacknitz
# Copyright (c) 2023, Friedrich Kink
#
BUILD_STYLE=    justmake
include ../../../make-rules/shared-macros.mk
COMPONENT_NAME=            lua
COMPONENT_MJR_VERSION=    5.4
COMPONENT_MNR_VERSION=    6
COMPONENT_VERSION=        $(COMPONENT_MJR_VERSION).$(COMPONENT_MNR_VERSION)
COMPONENT_SUMMARY=        Lua is a powerful, fast, lightweight, embeddable scripting language.
COMPONENT_PROJECT_URL=    https://www.lua.org/
COMPONENT_FMRI=            runtime/lua-54
COMPONENT_CLASSIFICATION=    Development/Other Languages
COMPONENT_SRC=            $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=        $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_URL=    https://www.lua.org/ftp/$(COMPONENT_ARCHIVE)
COMPONENT_ARCHIVE_HASH=    sha256:7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88
COMPONENT_LICENSE=        MIT
COMPONENT_LICENSE_FILE=    $(COMPONENT_NAME).license
LUA_TESTS=              $(COMPONENT_NAME)-$(COMPONENT_VERSION)-tests
COMPONENT_ARCHIVE_1=    $(LUA_TESTS).tar.gz
COMPONENT_ARCHIVE_HASH_1= sha256:63ed5f5bcfd15dfd2f72e04c2f8c10585bb8de9e558df62b335cb9e5c1a4ef34
COMPONENT_ARCHIVE_URL_1= $(COMPONENT_PROJECT_URL)tests/$(COMPONENT_ARCHIVE_1)
CLEAN_PATHS += $(LUA_TESTS)
include $(WS_MAKE_RULES)/common.mk
COMPONENT_BUILD_TARGETS= solaris
# This is because lua uses $(CC) to build it's shared libraries.
CC +=           $(CC_BITS)
CFLAGS +=       $(CC_PIC) $(CPP_LARGEFILES)
# Original patch from userland-gate used LD_OPTIONS_SO and LD_OPTIONS directly in the src/Makefile
# of Lua SOURCE_DIR. This caused that gcc picked wrong linking flags and liblua.so would not be
# created. Till there is a better way, let's stick to this.
MYLDFLAGS= $(shell echo $(LD_OPTIONS_SO) $(LD_OPTIONS) | $(GSED) -e 's/^/-Wl,/g' -e 's/ /,'/g)
COMPONENT_BUILD_ARGS += CC="$(CC)"
COMPONENT_BUILD_ARGS += MYCFLAGS="$(CFLAGS)"
COMPONENT_BUILD_ARGS += MYLDFLAGS="$(MYLDFLAGS)"
COMPONENT_INSTALL_ARGS += INSTALL=$(INSTALL)
COMPONENT_INSTALL_ARGS += INSTALL_TOP=$(PROTOUSRDIR)
$(INSTALL_64):  COMPONENT_INSTALL_ARGS += INSTALL_LIB=$(PROTOUSRLIBDIR64)
$(INSTALL_64):  COMPONENT_INSTALL_ARGS += INSTALL_BIN=$(PROTOUSRBINDIR)
$(TEST_64):     install
        (gzip -dc $(USERLAND_ARCHIVES)$(LUA_TESTS).tar.gz | tar xopf -; \
        cd $(LUA_TESTS); $(ENV) LD_LIBRARY_PATH=$(PROTOUSRLIBDIR64) \
        $(PROTOUSRBINDIR)/$(COMPONENT_NAME)$(COMPONENT_MJR_VERSION) -e"_U=true" all.lua)
# Auto-generated dependencies
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/math
components/runtime/lua-54/files/lua.pc
New file
@@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/MACH64
includedir=${prefix}/include/lua5.4
Name: Lua
Description: An Extensible Extension Language
Version: 5.4.6
Requires:
Libs: -L${libdir} -llua5.4 -lm
Cflags: -I${includedir}
components/runtime/lua-54/lua-54.p5m
New file
@@ -0,0 +1,44 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2023 Friedrich Kink
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
file path=usr/bin/lua5.4
file path=usr/bin/luac5.4
file path=usr/include/lua5.4/lauxlib.h
file path=usr/include/lua5.4/lua.h
file path=usr/include/lua5.4/lua.hpp
file path=usr/include/lua5.4/luaconf.h
file path=usr/include/lua5.4/lualib.h
file path=usr/lib/$(MACH64)/liblua5.4.so
file path=usr/share/doc/lua5.4/contents.html
file path=usr/share/doc/lua5.4/logo.gif
file path=usr/share/doc/lua5.4/lua.css
file path=usr/share/doc/lua5.4/manual.css
file path=usr/share/doc/lua5.4/manual.html
file path=usr/share/doc/lua5.4/osi-certified-72x60.png
file path=usr/share/doc/lua5.4/readme.html
file path=usr/share/man/man1/lua5.4.1
file path=usr/share/man/man1/luac5.4.1
file files/lua.pc path=usr/lib/pkgconfig/lua5.4.pc
components/runtime/lua-54/lua.license
New file
@@ -0,0 +1,6 @@
Copyright © 1994–2015 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
components/runtime/lua-54/manifests/sample-manifest.p5m
New file
@@ -0,0 +1,42 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2023 <contributor>
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
file path=usr/bin/lua5.4
file path=usr/bin/luac5.4
file path=usr/include/lua5.4/lauxlib.h
file path=usr/include/lua5.4/lua.h
file path=usr/include/lua5.4/lua.hpp
file path=usr/include/lua5.4/luaconf.h
file path=usr/include/lua5.4/lualib.h
file path=usr/lib/$(MACH64)/liblua5.4.so
file path=usr/share/doc/lua5.4/contents.html
file path=usr/share/doc/lua5.4/logo.gif
file path=usr/share/doc/lua5.4/lua.css
file path=usr/share/doc/lua5.4/manual.css
file path=usr/share/doc/lua5.4/manual.html
file path=usr/share/doc/lua5.4/osi-certified-72x60.png
file path=usr/share/doc/lua5.4/readme.html
file path=usr/share/man/man1/lua5.4.1
file path=usr/share/man/man1/luac5.4.1
components/runtime/lua-54/patches/01-src.Makefile.patch
New file
@@ -0,0 +1,69 @@
--- lua-5.4.6/src/Makefile    2023-10-02 23:00:53.701532908 +0200
+++ lua-5.4.6/src/Makefile.new    2023-10-02 23:00:47.672097994 +0200
@@ -25,6 +25,8 @@
 MYLIBS=
 MYOBJS=
+V=5.4
+
 # Special flags for compiler modules; -Os reduces code size.
 CMCFLAGS=
@@ -32,20 +34,20 @@
 PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
-LUA_A=    liblua.a
+LUA_SO= liblua$V.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
 LIB_O=    lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
 BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-LUA_T=    lua
+LUA_T=    lua$V
 LUA_O=    lua.o
-LUAC_T=    luac
+LUAC_T=    luac$V
 LUAC_O=    luac.o
 ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
-ALL_A= $(LUA_A)
+ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
+ALL_A= $(LUA_SO)
 # Targets start here.
 default: $(PLAT)
@@ -56,15 +58,17 @@
 a:    $(ALL_A)
-$(LUA_A): $(BASE_O)
-    $(AR) $@ $(BASE_O)
-    $(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+    $(CC) -o $(LUA_SO) -shared -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
+    $(LIB_O) $(LIBS)
-$(LUA_T): $(LUA_O) $(LUA_A)
-    $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+$(LUA_T): $(LUA_O) $(LUA_SO)
+    $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
 $(LUAC_T): $(LUAC_O) $(LUA_A)
     $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
+    $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
 test:
     ./$(LUA_T) -v
@@ -141,7 +145,7 @@
     $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX"
 SunOS solaris:
-    $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_REENTRANT" SYSLIBS="-ldl"
+    $(MAKE) all "USRCFLAGS=$(USRCFLAGS)" MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D__EXTENSIONS__ -D_REENTRANT -fPIC -DPIC" MYLIBS="-ldl"
 # Targets that do not create files (not all makes understand .PHONY).
 .PHONY: all $(PLATS) help test clean default o a depend echo
components/runtime/lua-54/patches/02-headers.patch
New file
@@ -0,0 +1,87 @@
--- lua-5.4.6/src/lauxlib.h    2023-05-02 22:02:28.000000000 +0200
+++ lua-5.4.6/src/lauxlib.h.new    2023-10-02 22:24:14.018899755 +0200
@@ -8,6 +8,9 @@
 #ifndef lauxlib_h
 #define lauxlib_h
+#ifdef __cplusplus
+extern "C" {
+#endif
 #include <stddef.h>
 #include <stdio.h>
@@ -294,7 +297,9 @@
 #endif
 /* }============================================================ */
-
+#ifdef __cplusplus
+}
+#endif
 #endif
--- lua-5.4.6/src/lua.h    2023-05-02 22:02:30.000000000 +0200
+++ lua-5.4.6/src/lua.h.new    2023-10-02 22:25:46.666545597 +0200
@@ -9,6 +9,10 @@
 #ifndef lua_h
 #define lua_h
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
@@ -519,5 +523,8 @@
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ******************************************************************************/
+#ifdef __cplusplus
+}
+#endif
 #endif
--- lua-5.4.6/src/lualib.h    2023-05-02 22:02:30.000000000 +0200
+++ lua-5.4.6/src/lualib.h.new    2023-10-02 22:28:07.547172506 +0200
@@ -8,6 +8,10 @@
 #ifndef lualib_h
 #define lualib_h
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lua.h"
@@ -48,5 +52,8 @@
 /* open all previous libraries */
 LUALIB_API void (luaL_openlibs) (lua_State *L);
+#ifdef __cplusplus
+}
+#endif
 #endif
--- lua-5.4.6/src/luaconf.h    2023-05-02 22:02:30.000000000 +0200
+++ lua-5.4.6/src/luaconf.h.new    2023-10-02 22:30:32.600468200 +0200
@@ -223,7 +223,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 "/"
@@ -313,7 +313,7 @@
 */
 #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
     defined(__ELF__)        /* { */
-#define LUAI_FUNC    __attribute__((visibility("internal"))) extern
+#define LUAI_FUNC    extern
 #else                /* }{ */
 #define LUAI_FUNC    extern
 #endif                /* } */
components/runtime/lua-54/patches/03-Makefile.patch
New file
@@ -0,0 +1,60 @@
--- lua-5.4.6/Makefile    2023-05-02 22:06:08.000000000 +0200
+++ lua-5.4.6/Makefile.new    2023-10-02 22:46:58.368043987 +0200
@@ -10,19 +10,20 @@
 # so take care if INSTALL_TOP is not an absolute path. See the local target.
 # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
 # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= $(ROOT)/usr
 INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
 INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
 INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+INSTALL_DOC= $(INSTALL_TOP)/share/doc/lua$V
 # How to install. If your install program does not support "-p", then
 # you may have to run ranlib on the installed liblua.a.
-INSTALL= install -p
-INSTALL_EXEC= $(INSTALL) -m 0755
-INSTALL_DATA= $(INSTALL) -m 0644
+INSTALL= ginstall -p
+INSTALL_EXEC= $(INSTALL) -m 0555
+INSTALL_DATA= $(INSTALL) -m 0444
 #
 # If you don't have "install" you can use "cp" instead.
 # INSTALL= cp -p
@@ -39,10 +40,11 @@
 PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
 # What to install.
-TO_BIN= lua luac
+TO_BIN= lua$V luac$V
 TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
-TO_MAN= lua.1 luac.1
+TO_LIB= liblua$V.so
+TO_MAN= lua$V.1 luac$V.1
+TO_DOC= contents.html osi-certified-72x60.png logo.gif lua.css manual.css manual.html readme.html
 # Lua version and release.
 V= 5.4
@@ -55,11 +57,13 @@
     @cd src && $(MAKE) $@
 install: dummy
-    cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+    cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_DOC) $(INSTALL_MAN) $(INSTALL_TEST)
     cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
     cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-    cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+    cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
+    cd doc && cp lua.1 lua$V.1 && cp luac.1 luac$V.1
     cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+    cd doc && $(INSTALL_DATA) $(TO_DOC) $(INSTALL_DOC)
 uninstall:
     cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
components/runtime/lua-54/pkg5
New file
@@ -0,0 +1,10 @@
{
    "dependencies": [
        "system/library",
        "system/library/math"
    ],
    "fmris": [
        "runtime/lua-54"
    ],
    "name": "lua"
}