lua: move Lua packages under lang/lua sub-folder
authorAlexandru Ardelean <[email protected]>
Sun, 16 Nov 2025 10:02:03 +0000 (12:02 +0200)
committerAlexandru Ardelean <[email protected]>
Mon, 17 Nov 2025 06:46:33 +0000 (08:46 +0200)
There are roughly 50 Lua packages.
It's about time we consider a proposal for moving all of them
under a lang/lua sub-folder.

Signed-off-by: Alexandru Ardelean <[email protected]>
178 files changed:
lang/cqueues/Makefile [deleted file]
lang/dkjson/Makefile [deleted file]
lang/json4lua/Makefile [deleted file]
lang/ldbus/Makefile [deleted file]
lang/linotify/Makefile [deleted file]
lang/lpeg/Makefile [deleted file]
lang/lua-argparse/Makefile [deleted file]
lang/lua-bencode/Makefile [deleted file]
lang/lua-bit32/Makefile [deleted file]
lang/lua-cjson/Makefile [deleted file]
lang/lua-cjson/patches/001-add-support-lua5-x.patch [deleted file]
lang/lua-cjson/patches/900-cmake-4-compatibility.patch [deleted file]
lang/lua-copas/Makefile [deleted file]
lang/lua-coxpcall/Makefile [deleted file]
lang/lua-coxpcall/patches/config.patch [deleted file]
lang/lua-cs-bouncer/Makefile [deleted file]
lang/lua-cs-bouncer/files/lua-cs-bouncer.defaults [deleted file]
lang/lua-curl-v3/Makefile [deleted file]
lang/lua-eco/Makefile [deleted file]
lang/lua-ev/Makefile [deleted file]
lang/lua-ffi/Makefile [deleted file]
lang/lua-libmodbus/Makefile [deleted file]
lang/lua-lsqlite3/Makefile [deleted file]
lang/lua-lzlib/Makefile [deleted file]
lang/lua-lzlib/patches/001-allow_optim_flags.patch [deleted file]
lang/lua-md5/Makefile [deleted file]
lang/lua-md5/patches/config.patch [deleted file]
lang/lua-md5/patches/makefile.patch [deleted file]
lang/lua-mobdebug/Makefile [deleted file]
lang/lua-mosquitto/Makefile [deleted file]
lang/lua-openssl/Makefile [deleted file]
lang/lua-openssl/patches/010-no-luajit.patch [deleted file]
lang/lua-penlight/Makefile [deleted file]
lang/lua-rings/Makefile [deleted file]
lang/lua-rings/patches/config.patch [deleted file]
lang/lua-rings/patches/makefile.patch [deleted file]
lang/lua-rs232/Makefile [deleted file]
lang/lua-rs232/patches/010-gcc13.patch [deleted file]
lang/lua-rs232/patches/100-remove-build-timestamps.patch [deleted file]
lang/lua-sha2/Makefile [deleted file]
lang/lua-sha2/patches/001-makefile.patch [deleted file]
lang/lua-struct/Makefile [deleted file]
lang/lua-wsapi/Makefile [deleted file]
lang/lua-xavante/Makefile [deleted file]
lang/lua/cqueues/Makefile [new file with mode: 0644]
lang/lua/dkjson/Makefile [new file with mode: 0644]
lang/lua/json4lua/Makefile [new file with mode: 0644]
lang/lua/ldbus/Makefile [new file with mode: 0644]
lang/lua/linotify/Makefile [new file with mode: 0644]
lang/lua/lpeg/Makefile [new file with mode: 0644]
lang/lua/lua-argparse/Makefile [new file with mode: 0644]
lang/lua/lua-bencode/Makefile [new file with mode: 0644]
lang/lua/lua-bit32/Makefile [new file with mode: 0644]
lang/lua/lua-cjson/Makefile [new file with mode: 0644]
lang/lua/lua-cjson/patches/001-add-support-lua5-x.patch [new file with mode: 0644]
lang/lua/lua-cjson/patches/900-cmake-4-compatibility.patch [new file with mode: 0644]
lang/lua/lua-copas/Makefile [new file with mode: 0644]
lang/lua/lua-coxpcall/Makefile [new file with mode: 0644]
lang/lua/lua-coxpcall/patches/config.patch [new file with mode: 0644]
lang/lua/lua-cs-bouncer/Makefile [new file with mode: 0644]
lang/lua/lua-cs-bouncer/files/lua-cs-bouncer.defaults [new file with mode: 0644]
lang/lua/lua-curl-v3/Makefile [new file with mode: 0644]
lang/lua/lua-eco/Makefile [new file with mode: 0644]
lang/lua/lua-ev/Makefile [new file with mode: 0644]
lang/lua/lua-ffi/Makefile [new file with mode: 0644]
lang/lua/lua-libmodbus/Makefile [new file with mode: 0644]
lang/lua/lua-lsqlite3/Makefile [new file with mode: 0644]
lang/lua/lua-lzlib/Makefile [new file with mode: 0644]
lang/lua/lua-lzlib/patches/001-allow_optim_flags.patch [new file with mode: 0644]
lang/lua/lua-md5/Makefile [new file with mode: 0644]
lang/lua/lua-md5/patches/config.patch [new file with mode: 0644]
lang/lua/lua-md5/patches/makefile.patch [new file with mode: 0644]
lang/lua/lua-mobdebug/Makefile [new file with mode: 0644]
lang/lua/lua-mosquitto/Makefile [new file with mode: 0644]
lang/lua/lua-openssl/Makefile [new file with mode: 0644]
lang/lua/lua-openssl/patches/010-no-luajit.patch [new file with mode: 0644]
lang/lua/lua-penlight/Makefile [new file with mode: 0644]
lang/lua/lua-rings/Makefile [new file with mode: 0644]
lang/lua/lua-rings/patches/config.patch [new file with mode: 0644]
lang/lua/lua-rings/patches/makefile.patch [new file with mode: 0644]
lang/lua/lua-rs232/Makefile [new file with mode: 0644]
lang/lua/lua-rs232/patches/010-gcc13.patch [new file with mode: 0644]
lang/lua/lua-rs232/patches/100-remove-build-timestamps.patch [new file with mode: 0644]
lang/lua/lua-sha2/Makefile [new file with mode: 0644]
lang/lua/lua-sha2/patches/001-makefile.patch [new file with mode: 0644]
lang/lua/lua-struct/Makefile [new file with mode: 0644]
lang/lua/lua-wsapi/Makefile [new file with mode: 0644]
lang/lua/lua-xavante/Makefile [new file with mode: 0644]
lang/lua/lua5.4/Makefile [new file with mode: 0644]
lang/lua/lua5.4/patches-host/001-include-version-number.patch [new file with mode: 0644]
lang/lua/lua5.4/patches-host/100-no_readline.patch [new file with mode: 0644]
lang/lua/lua5.4/patches/001-include-version-number.patch [new file with mode: 0644]
lang/lua/lua5.4/patches/020-shared_liblua.patch [new file with mode: 0644]
lang/lua/lua5.4/patches/100-no_readline.patch [new file with mode: 0644]
lang/lua/luabitop/Makefile [new file with mode: 0644]
lang/lua/luaexpat/Makefile [new file with mode: 0644]
lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.c [new file with mode: 0644]
lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.h [new file with mode: 0644]
lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.lua [new file with mode: 0644]
lang/lua/luafilesystem/Makefile [new file with mode: 0644]
lang/lua/luajit/Makefile [new file with mode: 0644]
lang/lua/luajit/patches/010-lua-path.patch [new file with mode: 0644]
lang/lua/luajit/patches/020-clang.patch [new file with mode: 0644]
lang/lua/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch [new file with mode: 0644]
lang/lua/luajit/patches/040-softfloat-ppc.patch [new file with mode: 0644]
lang/lua/luajit/patches/050-ppc-softfloat.patch [new file with mode: 0644]
lang/lua/luajit/patches/060-ppc-musl.patch [new file with mode: 0644]
lang/lua/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch [new file with mode: 0644]
lang/lua/luajit2/Makefile [new file with mode: 0644]
lang/lua/luajit2/patches/010-lua-path.patch [new file with mode: 0644]
lang/lua/lualanes/Makefile [new file with mode: 0644]
lang/lua/luaossl/Makefile [new file with mode: 0644]
lang/lua/luaossl/patches/900_fix_build_on_macos.patch [new file with mode: 0644]
lang/lua/luaposix/Makefile [new file with mode: 0644]
lang/lua/luaposix/patches/102-disable-compat-deprecated.patch [new file with mode: 0644]
lang/lua/luaposix/scripts/uname [new file with mode: 0755]
lang/lua/luarocks/Makefile [new file with mode: 0644]
lang/lua/luarocks/patches/01_dont_modify_bin_shebang.diff [new file with mode: 0644]
lang/lua/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch [new file with mode: 0644]
lang/lua/luasec/Makefile [new file with mode: 0644]
lang/lua/luasec/patches/100-fix-compilation.patch [new file with mode: 0644]
lang/lua/luasoap/Makefile [new file with mode: 0644]
lang/lua/luasocket/Makefile [new file with mode: 0644]
lang/lua/luasocket/patches/0001-Add-interface-support.patch [new file with mode: 0644]
lang/lua/luasocket/patches/0301-Fix-mpc85xx-build.patch [new file with mode: 0644]
lang/lua/luasql/Makefile [new file with mode: 0644]
lang/lua/luasrcdiet/Makefile [new file with mode: 0644]
lang/lua/luv/Config.in [new file with mode: 0644]
lang/lua/luv/Makefile [new file with mode: 0644]
lang/lua/lyaml/Makefile [new file with mode: 0755]
lang/lua/lzmq/Makefile [new file with mode: 0644]
lang/lua/lzmq/patches/010-gcc14.patch [new file with mode: 0644]
lang/lua/uuid/Makefile [new file with mode: 0644]
lang/lua5.4/Makefile [deleted file]
lang/lua5.4/patches-host/001-include-version-number.patch [deleted file]
lang/lua5.4/patches-host/100-no_readline.patch [deleted file]
lang/lua5.4/patches/001-include-version-number.patch [deleted file]
lang/lua5.4/patches/020-shared_liblua.patch [deleted file]
lang/lua5.4/patches/100-no_readline.patch [deleted file]
lang/luabitop/Makefile [deleted file]
lang/luaexpat/Makefile [deleted file]
lang/luaexpat/files/compat-5.1r5/compat-5.1.c [deleted file]
lang/luaexpat/files/compat-5.1r5/compat-5.1.h [deleted file]
lang/luaexpat/files/compat-5.1r5/compat-5.1.lua [deleted file]
lang/luafilesystem/Makefile [deleted file]
lang/luajit/Makefile [deleted file]
lang/luajit/patches/010-lua-path.patch [deleted file]
lang/luajit/patches/020-clang.patch [deleted file]
lang/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch [deleted file]
lang/luajit/patches/040-softfloat-ppc.patch [deleted file]
lang/luajit/patches/050-ppc-softfloat.patch [deleted file]
lang/luajit/patches/060-ppc-musl.patch [deleted file]
lang/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch [deleted file]
lang/luajit2/Makefile [deleted file]
lang/luajit2/patches/010-lua-path.patch [deleted file]
lang/lualanes/Makefile [deleted file]
lang/luaossl/Makefile [deleted file]
lang/luaossl/patches/900_fix_build_on_macos.patch [deleted file]
lang/luaposix/Makefile [deleted file]
lang/luaposix/patches/102-disable-compat-deprecated.patch [deleted file]
lang/luaposix/scripts/uname [deleted file]
lang/luarocks/Makefile [deleted file]
lang/luarocks/patches/01_dont_modify_bin_shebang.diff [deleted file]
lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch [deleted file]
lang/luasec/Makefile [deleted file]
lang/luasec/patches/100-fix-compilation.patch [deleted file]
lang/luasoap/Makefile [deleted file]
lang/luasocket/Makefile [deleted file]
lang/luasocket/patches/0001-Add-interface-support.patch [deleted file]
lang/luasocket/patches/0301-Fix-mpc85xx-build.patch [deleted file]
lang/luasql/Makefile [deleted file]
lang/luasrcdiet/Makefile [deleted file]
lang/luv/Config.in [deleted file]
lang/luv/Makefile [deleted file]
lang/lyaml/Makefile [deleted file]
lang/lzmq/Makefile [deleted file]
lang/lzmq/patches/010-gcc14.patch [deleted file]
lang/uuid/Makefile [deleted file]

diff --git a/lang/cqueues/Makefile b/lang/cqueues/Makefile
deleted file mode 100644 (file)
index 14191c6..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#
-# Copyright (C) 2022 Siger Yang <[email protected]>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=cqueues
-PKG_VERSION:=20200726
-PKG_RELEASE:=2
-PKG_MAINTAINER:=Siger Yang <[email protected]>
-
-PKG_MIRROR_HASH:=214a09c250e92d12cd63cdaedce9491f874a920e8222cc4faf10a978ec7bd1bd
-PKG_SOURCE_URL:=https://github.com/wahern/cqueues.git
-PKG_SOURCE_VERSION:=rel-$(PKG_VERSION)
-PKG_SOURCE_PROTO:=git
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/cqueues/default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=cqueues for $(1)
-  URL:=http://25thandclement.com/~william/projects/cqueues.html
-  DEPENDS:=+libopenssl
-endef
-
-define Package/cqueues/default/description
- Continuation Queues: Embeddable asynchronous networking, threading, and
- notification framework for Lua on Unix. 
-endef
-
-TARGET_CFLAGS += $(FPIC)
-TARGET_LDFLAGS += $(FPIC)
-
-define Package/cqueues
-  $(call Package/cqueues/default,lua5.1)
-  DEPENDS+=+liblua
-  VARIANT:=lua51
-endef
-
-define Package/cqueues-lua5.3
-  $(call Package/cqueues/default,lua5.3)
-  DEPENDS+=+liblua5.3
-  VARIANT:=lua53
-endef
-
-define Package/cqueues-lua5.4
-  $(call Package/cqueues/default,lua5.4)
-  DEPENDS+=+liblua5.4
-  VARIANT:=lua54
-endef
-
-Package/cqueues/description = $(Package/cqueues/default/description)
-Package/cqueues-lua5.3/description = $(Package/cqueues/default/description)
-Package/cqueues-lua5.4/description = $(Package/cqueues/default/description)
-
-ifeq ($(BUILD_VARIANT),lua51)
-  MAKE_FLAGS += \
-       LUA_APIS="5.1" \
-       LUA51_CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
-       lua51cpath="/usr/lib/lua" \
-       lua51path="/usr/lib/lua"
-endif
-ifeq ($(BUILD_VARIANT),lua53)
-  MAKE_FLAGS += \
-       LUA_APIS="5.3" \
-       LUA53_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.3" \
-       lua53cpath="/usr/local/lib/lua/5.3" \
-       lua53path="/usr/local/lib/lua/5.3"
-endif
-ifeq ($(BUILD_VARIANT),lua54)
-  MAKE_FLAGS += \
-       LUA_APIS="5.4" \
-       LUA54_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.4" \
-       lua54cpath="/usr/local/lib/lua/5.4" \
-       lua54path="/usr/local/lib/lua/5.4"
-endif
-
-define Package/cqueues/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/_cqueues.so $(1)/usr/lib/lua/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/cqueues.lua $(1)/usr/lib/lua/
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/cqueues $(1)/usr/lib/lua/
-endef
-
-define Package/cqueues-lua5.3/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/_cqueues.so $(1)/usr/local/lib/lua/5.3
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/cqueues.lua $(1)/usr/local/lib/lua/5.3
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/cqueues $(1)/usr/local/lib/lua/5.3
-endef
-define Package/cqueues-lua5.4/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/_cqueues.so $(1)/usr/local/lib/lua/5.4
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/cqueues.lua $(1)/usr/local/lib/lua/5.4
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/cqueues $(1)/usr/local/lib/lua/5.4
-endef
-
-$(eval $(call BuildPackage,cqueues))
-$(eval $(call BuildPackage,cqueues-lua5.3))
-$(eval $(call BuildPackage,cqueues-lua5.4))
diff --git a/lang/dkjson/Makefile b/lang/dkjson/Makefile
deleted file mode 100644 (file)
index 3f0f6fd..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 20013-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=dkjson
-PKG_VERSION:=2.5
-PKG_RELEASE:=4
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/LuaDist/dkjson/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=8560ee3c7ed421b293bf0905017bc90bd2f282d56517aa59ec6c53f5fb4057bd
-
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/dkjson
-       SUBMENU:=Lua
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=DKJSON
-       URL:=http://dkolf.de/src/dkjson-lua.fsl/home
-       MAINTAINER:=Lars Gierth <[email protected]>
-       DEPENDS:=+lua
-       PKGARCH:=all
-endef
-
-define Package/dkjson/description
-       Lua JSON parser/serializer with UTF-8 support
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/dkjson/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/dkjson.lua $(1)/usr/lib/lua/
-endef
-
-$(eval $(call BuildPackage,dkjson))
diff --git a/lang/json4lua/Makefile b/lang/json4lua/Makefile
deleted file mode 100644 (file)
index 6a4f8af..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#  
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=json4lua
-PKG_VERSION:=0.9.54
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/amrhassan/json4lua/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=2498e5224b024521af7f2de9a2c2af4028cd8da4b724ffd6bd94beede2402cfe
-
-PKG_MAINTAINER:=Amr Hassan <[email protected]>
-PKG_LICENSE:=MIT
-
-LUA_MODULE_PATH:=/usr/lib/lua
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/json4lua
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=json4lua
-  URL:=https://github.com/amrhassan/json4lua
-  DEPENDS:=+lua +luasocket
-  PKGARCH:=all
-endef
-
-define Package/json4lua/description
-       JSON and JSONRPC for Lua
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/json4lua/install
-       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)/json
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/json.lua $(1)/$(LUA_MODULE_PATH)/json.lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/rpc.lua $(1)/$(LUA_MODULE_PATH)/json/rpc.lua
-endef
-
-$(eval $(call BuildPackage,json4lua))
diff --git a/lang/ldbus/Makefile b/lang/ldbus/Makefile
deleted file mode 100644 (file)
index b5ba07b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Copyright (C) 2006-2017 OpenWrt.org
-#
-# This is free software, licensed under the GPL 2 license.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ldbus
-PKG_SOURCE_DATE:=2019-08-15
-PKG_SOURCE_VERSION:=9e176fe851006037a643610e6d8f3a8e597d4073
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=https://github.com/daurnimator/ldbus
-PKG_MIRROR_HASH:=6a17564734b9cd3a9c4713777b8219c5e08252be3fd6ba9f9aecbf109d1ed899
-
-PKG_MAINTAINER:=Enrico Mioso <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_DEPENDS:=luarocks/host
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ldbus
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=ldbus Lua DBus bindings
-  URL:=https://github.com/daurnimator/ldbus
-  DEPENDS:=+dbus +lua
-endef
-
-define Package/ldbus/description
-  This package contains "ldbus": LUA bindings to interact with the DBUS
-  message bus system, and services connected to it.
-  See https://github.com/daurnimator/ldbus
-  for details.
-endef
-
-define Build/Compile
-  cd $(PKG_BUILD_DIR) && \
-  luarocks make --pack-binary-rock ldbus-scm-0.rockspec \
-    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-    LUA_PKGNAME=lua5.1 \
-    DBUS_INCDIR=$(STAGING_DIR)/usr/include/dbus-1.0/ \
-    DBUS_ARCH_INCDIR=$(STAGING_DIR)/usr/lib/dbus-1.0/include \
-    DBUS_LIBDIR=$(STAGING_DIR)/usr/lib \
-    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
-    CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-    LDFLAGS="$(TARGET_LDFLAGS)"
-endef
-
-define Package/ldbus/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ldbus.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,ldbus))
diff --git a/lang/linotify/Makefile b/lang/linotify/Makefile
deleted file mode 100644 (file)
index 17be2b2..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# This is free software, licensed under your choice of the following SPDX identifiers:
-# Apache-2.0, BSD-2-Clause, CC-BY-4.0, ISC, MIT, X11 or GPL-2.0-or-later
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=linotify
-PKG_VERSION:=0.5
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL=https://codeload.github.com/hoelzro/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=21d005f16043397a85913a7d14a267716d6384f0228718d5de464bfc0274e338
-
-PKG_MAINTAINER:=Karl Palsson <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYRIGHT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/linotify
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=inotify binding for lua
-  DEPENDS:=+lua
-  URL:=https://github.com/hoelzro/linotify
-endef
-
-define Package/linotify/description
- This provides a lua binding to the inotify file system change notification system
-endef
-
-define Build/Compile
-  cd $(PKG_BUILD_DIR) && \
-  $(TARGET_CC) -o inotify.so -shared $(FPIC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) linotify.c
-endef
-
-define Package/$(PKG_NAME)/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/inotify.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,linotify))
diff --git a/lang/lpeg/Makefile b/lang/lpeg/Makefile
deleted file mode 100644 (file)
index 896b70b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lpeg
-PKG_VERSION:=1.0.2
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
-PKG_HASH:=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lpeg
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=LPeg
-  URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
-  DEPENDS:=+lua
-endef
-
-define Package/lpeg/description
-       LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs)
-endef
-
-define Build/Configure
-endef
-
-# add make variable overrides here
-MAKE_FLAGS += \
-       COPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -O2"
-
-define Package/lpeg/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lpeg.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lpeg))
diff --git a/lang/lua-argparse/Makefile b/lang/lua-argparse/Makefile
deleted file mode 100644 (file)
index 82aeb7a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2006-2020 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-argparse
-PKG_VERSION:=0.7.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/luarocks/argparse/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=d344e49404c3e7b3e7fa4fe6741c106f25909d9b24923cb08dcceda1f9754809
-PKG_BUILD_DIR:=$(BUILD_DIR)/argparse-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Vladimir Malyutin <[email protected]>
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-argparse
-        SUBMENU:=Lua
-        SECTION:=lang
-        CATEGORY:=Languages
-        TITLE:=lua-argparse
-        URL:=https://github.com/mpeterv/argparse
-        DEPENDS:=+lua
-        PKGARCH:=all
-endef
-
-define Package/lua-argparse/description
-        Argparse is a feature-rich command line parser for Lua inspired by argparse for Python.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/lua-argparse/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/argparse.lua $(1)/usr/lib/lua/
-endef
-
-$(eval $(call BuildPackage,lua-argparse))
diff --git a/lang/lua-bencode/Makefile b/lang/lua-bencode/Makefile
deleted file mode 100644 (file)
index 3edee23..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 20013-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-bencode
-PKG_VERSION:=2.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://bitbucket.org/wilhelmy/lua-bencode/downloads/
-PKG_HASH:=25830ff3fe342c09c65995d46c4d89ad0387cc502b1a2f70f9cca2d8c7ccafdd
-
-PKG_MAINTAINER:=Lars Gierth <[email protected]>
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-bencode
-       SUBMENU:=Lua
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=lua-bencode
-       URL:=https://bitbucket.org/wilhelmy/lua-bencode
-       DEPENDS:=+lua
-       PKGARCH:=all
-endef
-
-define Package/lua-bencode/description
-       This is a module for the lua programming language for decoding and encoding
-       bencoded data which can be used to read and write torrent files for bittorrent.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-
-define Package/lua-bencode/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/bencode.lua $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-bencode))
diff --git a/lang/lua-bit32/Makefile b/lang/lua-bit32/Makefile
deleted file mode 100644 (file)
index da4ae87..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-bit32
-PKG_VERSION:=5.3.0
-PKG_RELEASE:=1
-
-
-PKG_SRC_NAME:=lua-compat-5.2
-PKG_SRC_VERSION:=0.3
-PKG_SOURCE_URL=https://codeload.github.com/keplerproject/$(PKG_SRC_NAME)/tar.gz/v$(PKG_SRC_VERSION)?
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=627e842c488c1afece4383da9f9a839a7ddbc2f7fedfc456f76e3a590d4ca67f
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SRC_NAME)-$(PKG_SRC_VERSION)
-
-PKG_MAINTAINER:=Maxim Storchak <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_DEPENDS:=luarocks/host
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-bit32
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua 5.2 bit manipulation library
-  DEPENDS:=+lua
-endef
-
-define Package/lua-bit32/description
-  lua-bit32 is the native Lua 5.2 bit manipulation library,
-  backported to Lua 5.1
-endef
-
-TARGET_CFLAGS += \
-       -I$(STAGING_DIR)/usr/include
-
-define Build/Compile
-  cd $(PKG_BUILD_DIR) && \
-  luarocks make --pack-binary-rock bit32-scm-1.rockspec \
-    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-    LUA_PKGNAME=lua5.1 \
-       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-    CC="$(TARGET_CC)" LD="$(TARGET_CC)"
-endef
-
-define Package/$(PKG_NAME)/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit32.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-bit32))
diff --git a/lang/lua-cjson/Makefile b/lang/lua-cjson/Makefile
deleted file mode 100644 (file)
index 3a70707..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-cjson
-PKG_VERSION:=2.1.0
-PKG_RELEASE:=5
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://kyne.au/~mark/software/download/
-PKG_HASH:=51bc69cd55931e0cba2ceae39e9efa2483f4292da3a88a1ed470eda829f6c778
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-HOST_BUILD_DEPENDS:=lua/host
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lua-cjson/default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua CJSON parser
-  URL:=https://github.com/mpx/lua-cjson
-endef
-
-define Package/lua-cjson
-  $(Package/lua-cjson/default)
-  DEPENDS+=+liblua
-  VARIANT:=lua-51
-endef
-
-define Package/lua-cjson-lua5.3
-  $(Package/lua-cjson/default)
-  DEPENDS+=+liblua5.3
-  VARIANT:=lua-53
-endef
-
-define Package/lua-cjson-lua5.4
-  $(Package/lua-cjson/default)
-  DEPENDS+=+liblua5.4
-  VARIANT:=lua-54
-endef
-
-define Package/lua-cjson/default/description
-  Lua CJSON is a fast JSON encoding/parsing module for Lua.
-endef
-
-Package/lua-cjson/description = $(Package/lua-cjson/default/description)
-Package/lua-cjson-lua5.3/description = $(Package/lua-cjson/default/description)
-Package/lua-cjson-lua5.4/description = $(Package/lua-cjson/default/description)
-
-CMAKE_OPTIONS += \
-       -DUSE_LUA=ON
-
-CMAKE_HOST_OPTIONS += \
-       -DLUA_MATH_LIBRARY=m
-
-ifeq ($(BUILD_VARIANT),lua-53)
-  CMAKE_OPTIONS += -DUSE_LUA53=ON
-endif
-
-ifeq ($(BUILD_VARIANT),lua-54)
-  CMAKE_OPTIONS += -DUSE_LUA54=ON
-endif
-
-define Package/lua-cjson/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/cjson
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
-endef
-
-define Package/lua-cjson-lua5.3/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/local/lib/lua/5.3
-endef
-
-define Package/lua-cjson-lua5.4/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/local/lib/lua/5.4
-endef
-
-$(eval $(call HostBuild))
-$(eval $(call BuildPackage,lua-cjson))
-$(eval $(call BuildPackage,lua-cjson-lua5.3))
-$(eval $(call BuildPackage,lua-cjson-lua5.4))
diff --git a/lang/lua-cjson/patches/001-add-support-lua5-x.patch b/lang/lua-cjson/patches/001-add-support-lua5-x.patch
deleted file mode 100644 (file)
index 253cfbd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
---- a/lua_cjson.c
-+++ b/lua_cjson.c
-@@ -1227,7 +1227,10 @@ static void json_process_value(lua_State
-         lua_pushlstring(l, token->value.string, token->string_len);
-         break;;
-     case T_NUMBER:
--        lua_pushnumber(l, token->value.number);
-+        if ((lua_Integer)token->value.number == token->value.number)
-+            lua_pushinteger(l, (lua_Integer)token->value.number);
-+        else
-+            lua_pushnumber(l, token->value.number);
-         break;;
-     case T_BOOLEAN:
-         lua_pushboolean(l, token->value.boolean);
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -15,8 +15,28 @@ if(NOT CMAKE_BUILD_TYPE)
-         FORCE)
- endif()
--find_package(Lua51 REQUIRED)
--include_directories(${LUA_INCLUDE_DIR})
-+if(USE_LUA54)
-+    find_path(LUA54_INCLUDE_DIRS lua.h PATH_SUFFIXES lua5.4)
-+    find_library(LUA54_LIBRARIES lua5.4)
-+
-+    if (NOT LUA54_INCLUDE_DIRS OR NOT LUA54_LIBRARIES)
-+        message(FATAL_ERROR "Liblua 5.4 is required.")
-+    endif()
-+
-+    include_directories(${LUA54_INCLUDE_DIRS})
-+elseif(USE_LUA53)
-+    find_path(LUA53_INCLUDE_DIRS lua.h PATH_SUFFIXES lua5.3)
-+    find_library(LUA53_LIBRARIES lua5.3)
-+
-+    if (NOT LUA53_INCLUDE_DIRS OR NOT LUA53_LIBRARIES)
-+        message(FATAL_ERROR "Liblua 5.3 is required.")
-+    endif()
-+
-+    include_directories(${LUA53_INCLUDE_DIRS})
-+else()
-+    find_package(Lua51 REQUIRED)
-+    include_directories(${LUA_INCLUDE_DIR})
-+endif()
- if(NOT USE_INTERNAL_FPCONV)
-     # Use libc number conversion routines (strtod(), sprintf())
-@@ -51,7 +71,14 @@ if(NOT HAVE_ISINF)
- endif()
- set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}")
--get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
-+
-+if(USE_LUA54)
-+    get_filename_component(_lua_lib_dir ${LUA54_LIBRARIES} PATH)
-+elseif(USE_LUA53)
-+    get_filename_component(_lua_lib_dir ${LUA53_LIBRARIES} PATH)
-+else()
-+    get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
-+endif()
- if(APPLE)
-     set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
-@@ -65,7 +92,13 @@ if(WIN32)
-     # Windows sprintf()/strtod() handle NaN/inf differently. Not supported.
-     add_definitions(-DDISABLE_INVALID_NUMBERS)
- else()
--    set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
-+    if(USE_LUA54)
-+        set(_lua_module_dir "${_lua_lib_dir}/lua/5.4")
-+    elseif(USE_LUA53)
-+        set(_lua_module_dir "${_lua_lib_dir}/lua/5.3")
-+    else()
-+        set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
-+    endif()
- endif()
- add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES})
diff --git a/lang/lua-cjson/patches/900-cmake-4-compatibility.patch b/lang/lua-cjson/patches/900-cmake-4-compatibility.patch
deleted file mode 100644 (file)
index dd3880c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -3,8 +3,8 @@
- #       Unix: export LUA_DIR=/home/user/pkg
- #       Windows: set LUA_DIR=c:\lua51
-+cmake_minimum_required(VERSION 3.10)
- project(lua-cjson C)
--cmake_minimum_required(VERSION 2.6)
- option(USE_INTERNAL_FPCONV "Use internal strtod() / g_fmt() code for performance")
- option(MULTIPLE_THREADS "Support multi-threaded apps with internal fpconv - recommended" ON)
diff --git a/lang/lua-copas/Makefile b/lang/lua-copas/Makefile
deleted file mode 100644 (file)
index 527ec52..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2009-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-copas
-PKG_VERSION:=2.0.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=copas-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/copas/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=1469eaf987513f5a9a0bee345c040c8fa30ca6194bc75ad78171362f9904cf3e
-PKG_BUILD_DIR:=$(BUILD_DIR)/copas-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-copas
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua-Copas
-  URL:=https://github.com/keplerproject/copas
-  DEPENDS:=+lua
-endef
-
-define Package/lua-copas/description
-  Copas is a dispatcher based on coroutines that can be used by TCP/IP servers.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               T="$(BUILD_VARIANT)" \
-               PREFIX="$(PKG_INSTALL_DIR)/usr" \
-               install
-endef
-
-define Package/lua-copas/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DIR) $(1)/usr/lib/lua/copas
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas.lua $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/ftp.lua $(1)/usr/lib/lua/copas
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/smtp.lua $(1)/usr/lib/lua/copas
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/http.lua $(1)/usr/lib/lua/copas
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/limit.lua $(1)/usr/lib/lua/copas
-endef
-
-$(eval $(call BuildPackage,lua-copas))
diff --git a/lang/lua-coxpcall/Makefile b/lang/lua-coxpcall/Makefile
deleted file mode 100644 (file)
index c9345df..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2009-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-coxpcall
-PKG_VERSION:=1.17.0
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=e037c1aa1d2a2b213fca144d86cd5b5cf2cd77cec6d8f52d056add7ea806f0dc
-PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=ea22f44e490430e40217f0792bf82eaeaec51903
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-coxpcall
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua-Coxpcall
-  URL:=https://github.com/keplerproject/coxpcall
-  DEPENDS:=+lua
-endef
-
-define Package/lua-coxpcall/description
-  Coxpcall encapsulates the protected calls with a coroutine based loop,
-  so errors can be dealed without the usual pcall/xpcall issues with coroutines.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-# add make variable overrides here
-MAKE_FLAGS +=
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               T="$(BUILD_VARIANT)" \
-               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
-               install
-endef
-
-define Package/lua-coxpcall/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/coxpcall.lua $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-coxpcall))
diff --git a/lang/lua-coxpcall/patches/config.patch b/lang/lua-coxpcall/patches/config.patch
deleted file mode 100644 (file)
index b96455a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
---- /dev/null
-+++ b/config
-@@ -0,0 +1 @@
-+LUA_DIR ?=$(DESTDIR)/usr/lib/lua
diff --git a/lang/lua-cs-bouncer/Makefile b/lang/lua-cs-bouncer/Makefile
deleted file mode 100644 (file)
index 3f8f759..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# SPDX-License-Identifier: MIT
-#
-# Copyright (C) 2021-2022 Gerald Kerma
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-cs-bouncer
-PKG_SOURCE_DATE:=2022-01-18
-PKG_SOURCE_VERSION:=e0f68b1265c386715c1d6ab79fe9063c0a9e3d3a
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/$(PKG_NAME)/tar.gz/$(PKG_SOURCE_VERSION)?
-PKG_HASH:=c7e92cc9dc023ebcd84f3632d6cf0e38a7d9f5e7bba15367247753a306b89829
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Gerald Kerma <[email protected]>
-
-HOST_BUILD_DEPENDS:=lua/host
-PKG_BUILD_DEPENDS:=luarocks/host
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-cs-bouncer
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua Crowdsec Bouncer module
-  URL:=https://github.com/crowdsecurity/lua-cs-bouncer
-  DEPENDS:=+lua \
-        +luasec
-endef
-
-define Package/lua-cs-bouncer/description
-  Lua module to allow ip (or not) from CrowdSec API.
-endef
-
-define Build/Compile
-endef
-
-define Package/lua-cs-bouncer/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/crowdsec
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/lib/*.lua \
-               $(1)/usr/lib/lua/crowdsec/
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/template.conf \
-               $(1)/usr/lib/lua/crowdsec/crowdsec.conf
-
-       $(INSTALL_DIR) $(1)/usr/lib/crowdsec/lua/plugins/crowdsec
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/nginx/config.lua \
-               $(1)/usr/lib/crowdsec/lua/plugins/crowdsec/
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/nginx/crowdsec.lua \
-               $(1)/usr/lib/crowdsec/lua/
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/nginx/recaptcha.lua \
-               $(1)/usr/lib/crowdsec/lua/
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/nginx/access.lua \
-               $(1)/usr/lib/crowdsec/lua/
-
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) \
-               ./files/lua-cs-bouncer.defaults \
-               $(1)/etc/uci-defaults/99_lua-cs-bouncer
-endef
-
-define Package/lua-cs-bouncer/conffiles
-/usr/lib/lua/crowdsec/crowdsec.conf
-endef
-
-$(eval $(call BuildPackage,lua-cs-bouncer))
diff --git a/lang/lua-cs-bouncer/files/lua-cs-bouncer.defaults b/lang/lua-cs-bouncer/files/lua-cs-bouncer.defaults
deleted file mode 100644 (file)
index 12e4a99..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-CONFIG=/usr/lib/lua/crowdsec/crowdsec.conf
-## Gen&ConfigApiKey
-if grep -q "{API_KEY}" "$CONFIG"; then
-       SUFFIX=`tr -dc A-Za-z0-9 </dev/urandom | head -c 8`
-       API_KEY=`/usr/bin/cscli bouncers add lua-cs-bouncer-${SUFFIX} -o raw`
-       sed -i "s,^\(\s*API_KEY\s*=\s*\).*\$,\1$API_KEY," $CONFIG
-else
-       echo API key already registered...
-fi
-
-exit 0
diff --git a/lang/lua-curl-v3/Makefile b/lang/lua-curl-v3/Makefile
deleted file mode 100644 (file)
index 0d474a7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2021 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-curl-v3
-PKG_VERSION:=0.3.13~9f8b6dba8
-PKG_RELEASE:=2
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE_URL:=https://github.com/Lua-cURL/Lua-cURLv3.git
-PKG_MIRROR_HASH:=41f9e418b203fe3bdf256e4a5517ac8dbaf5ab5026b972f603052a0c56dfcfc7
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=9f8b6dba8b5ef1b26309a571ae75cda4034279e5
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-curl-v3
-    SUBMENU:=Lua
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=Lua-curl
-    DEPENDS:=+libcurl +lua
-    MAINTAINER:=Rainer Poisel <[email protected]>
-endef
-
-MAKE_FLAGS += \
-       UNAME="Linux"
-
-define Package/lua-curl-v3/description
-       Lua bindings to libcurl (Lua-cURLv3)
-endef
-
-define Package/lua-curl-v3/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lcurl.so $(1)/usr/lib/lua
-       $(CP) $(PKG_BUILD_DIR)/src/lua/* $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-curl-v3))
-
diff --git a/lang/lua-eco/Makefile b/lang/lua-eco/Makefile
deleted file mode 100644 (file)
index f82953e..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-eco
-PKG_VERSION:=3.13.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION)
-PKG_HASH:=7629312a5946774f2fa8372d46e8aa3e06a651a73a343addf0eb8aea4413cad9
-
-PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_CONFIG_DEPENDS:= \
-       LUA_ECO_OPENSSL \
-       LUA_ECO_WOLFSSL \
-       LUA_ECO_MBEDTLS
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lua-eco
-  TITLE:=A Lua interpreter with a built-in libev event loop
-  SECTION:=lang
-  CATEGORY:=Languages
-  SUBMENU:=Lua
-  URL:=https://github.com/zhaojh329/lua-eco
-  DEPENDS:=+libev +liblua5.4
-endef
-
-define Package/lua-eco/description
-  Lua-eco is a Lua interpreter with a built-in event loop for scheduling
-  lightweight coroutines automatically, enabling efficient concurrency in
-  Lua. Build high-performance, scalable applications.
-endef
-
-define Package/lua-eco/Module
-  TITLE:=$1 support for lua-eco
-  SECTION:=lang
-  CATEGORY:=Languages
-  SUBMENU:=Lua
-  URL:=https://github.com/zhaojh329/lua-eco
-  DEPENDS:=+lua-eco $2
-endef
-
-Package/lua-eco-log=$(call Package/lua-eco/Module,log utils)
-Package/lua-eco-base64=$(call Package/lua-eco/Module,base64)
-Package/lua-eco-sha1=$(call Package/lua-eco/Module,sha1)
-Package/lua-eco-sha256=$(call Package/lua-eco/Module,sha256)
-Package/lua-eco-md5=$(call Package/lua-eco/Module,md5)
-Package/lua-eco-hmac=$(call Package/lua-eco/Module,hmac)
-Package/lua-eco-socket=$(call Package/lua-eco/Module,socket)
-Package/lua-eco-dns=$(call Package/lua-eco/Module,dns,+lua-eco-socket)
-Package/lua-eco-ssl=$(call Package/lua-eco/Module,ssl,\
-  +LUA_ECO_OPENSSL:libopenssl +LUA_ECO_WOLFSSL:libwolfssl \
-  +LUA_ECO_MBEDTLS:libmbedtls +LUA_ECO_MBEDTLS:zlib +lua-eco-socket)
-Package/lua-eco-ubus=$(call Package/lua-eco/Module,ubus,+libubus)
-Package/lua-eco-http=$(call Package/lua-eco/Module,http/https,+lua-eco-dns +lua-eco-ssl +lua-eco-base64 +lua-eco-log)
-Package/lua-eco-mqtt=$(call Package/lua-eco/Module,mqtt,+lua-eco-socket +lua-eco-ssl)
-Package/lua-eco-websocket=$(call Package/lua-eco/Module,websocket,+lua-eco-http +lua-eco-base64 +lua-eco-sha1)
-Package/lua-eco-termios=$(call Package/lua-eco/Module,termios)
-Package/lua-eco-netlink=$(call Package/lua-eco/Module,netlink,+lua-eco-socket)
-Package/lua-eco-ip=$(call Package/lua-eco/Module,ip utils,+lua-eco-netlink)
-Package/lua-eco-nl80211=$(call Package/lua-eco/Module,nl80211,+lua-eco-netlink)
-Package/lua-eco-ssh=$(call Package/lua-eco/Module,ssh,+lua-eco-socket +libssh2)
-Package/lua-eco-packet=$(call Package/lua-eco/Module,packet,+lua-eco-nl80211)
-Package/lua-eco-uci=$(call Package/lua-eco/Module,uci,+libuci)
-Package/lua-eco-shared=$(call Package/lua-eco/Module,shared,+lua-eco-socket)
-
-define Package/lua-eco-ssl/config
-       choice
-               prompt "SSL Library"
-               default LUA_ECO_MBEDTLS
-
-               config LUA_ECO_OPENSSL
-                       bool "OpenSSL"
-
-               config LUA_ECO_WOLFSSL
-                       bool "wolfSSL"
-
-               config LUA_ECO_MBEDTLS
-                       bool "mbedTLS"
-       endchoice
-endef
-
-CMAKE_OPTIONS += \
-  -DECO_UBUS_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ubus),N,FF) \
-  -DECO_SSL_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ssl),N,FF)
-
-ifneq ($(CONFIG_PACKAGE_lua-eco-ssl),)
-  ifneq ($(CONFIG_LUA_ECO_OPENSSL),)
-    CMAKE_OPTIONS += -DUSE_OPENSSL=ON
-  else ifneq ($(CONFIG_LUA_ECO_WOLFSSL),)
-    CMAKE_OPTIONS += -DUSE_WOLFSSL=ON
-  else ifneq ($(CONFIG_LUA_ECO_MBEDTLS),)
-    CMAKE_OPTIONS += -DUSE_MBEDTLS=ON
-  endif
-endif
-
-define Package/lua-eco/install
-       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/local/lib/lua/5.4/eco/core \
-               $(1)/usr/lib $(1)/usr/local/lib/lua/5.4/eco/encoding
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/eco $(1)/usr/bin
-       $(CP) $(PKG_BUILD_DIR)/libeco.so* $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bufio.so $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hex.lua $(1)/usr/local/lib/lua/5.4/eco/encoding
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/{time,bufio,sys,file}.so $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/{time,sys,file,sync,channel}.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-log/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/log.so $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-base64/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/encoding
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/base64.so $(1)/usr/local/lib/lua/5.4/eco/encoding
-endef
-
-define Package/lua-eco-sha1/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sha1.so $(1)/usr/local/lib/lua/5.4/eco/hash
-endef
-
-define Package/lua-eco-sha256/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sha256.so $(1)/usr/local/lib/lua/5.4/eco/hash
-endef
-
-define Package/lua-eco-md5/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/md5.so $(1)/usr/local/lib/lua/5.4/eco/hash
-endef
-
-define Package/lua-eco-hmac/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/local/lib/lua/5.4/eco/hash
-endef
-
-define Package/lua-eco-socket/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/socket.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/socket.so $(1)/usr/local/lib/lua/5.4/eco/core
-endef
-
-define Package/lua-eco-dns/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/dns.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-ssl/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ssl.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssl.so $(1)/usr/local/lib/lua/5.4/eco/core
-endef
-
-define Package/lua-eco-ubus/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ubus.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ubus.so $(1)/usr/local/lib/lua/5.4/eco/core
-endef
-
-define Package/lua-eco-http/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/http
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/http/*.lua $(1)/usr/local/lib/lua/5.4/eco/http
-endef
-
-define Package/lua-eco-mqtt/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/mqtt.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-websocket/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/websocket.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-termios/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/termios.so $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-netlink/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/{nl,genl}.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/{nl,genl}.so $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/rtnl.so $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-ip/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ip.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-nl80211/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/nl80211.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/nl80211.so $(1)/usr/local/lib/lua/5.4/eco/core
-endef
-
-define Package/lua-eco-ssh/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ssh.lua $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssh.so $(1)/usr/local/lib/lua/5.4/eco/core
-endef
-
-define Package/lua-eco-packet/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/packet.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-uci/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/uci.so $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-define Package/lua-eco-shared/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/shared.lua $(1)/usr/local/lib/lua/5.4/eco
-endef
-
-$(eval $(call BuildPackage,lua-eco))
-$(eval $(call BuildPackage,lua-eco-log))
-$(eval $(call BuildPackage,lua-eco-base64))
-$(eval $(call BuildPackage,lua-eco-sha1))
-$(eval $(call BuildPackage,lua-eco-sha256))
-$(eval $(call BuildPackage,lua-eco-md5))
-$(eval $(call BuildPackage,lua-eco-hmac))
-$(eval $(call BuildPackage,lua-eco-socket))
-$(eval $(call BuildPackage,lua-eco-dns))
-$(eval $(call BuildPackage,lua-eco-ssl))
-$(eval $(call BuildPackage,lua-eco-ubus))
-$(eval $(call BuildPackage,lua-eco-http))
-$(eval $(call BuildPackage,lua-eco-mqtt))
-$(eval $(call BuildPackage,lua-eco-websocket))
-$(eval $(call BuildPackage,lua-eco-termios))
-$(eval $(call BuildPackage,lua-eco-netlink))
-$(eval $(call BuildPackage,lua-eco-ip))
-$(eval $(call BuildPackage,lua-eco-nl80211))
-$(eval $(call BuildPackage,lua-eco-ssh))
-$(eval $(call BuildPackage,lua-eco-packet))
-$(eval $(call BuildPackage,lua-eco-uci))
-$(eval $(call BuildPackage,lua-eco-shared))
diff --git a/lang/lua-ev/Makefile b/lang/lua-ev/Makefile
deleted file mode 100644 (file)
index 7a6a3fb..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2019 Jianhui Zhao
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-ev
-PKG_VERSION:=1.5
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/brimworks/lua-ev/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=26ac116722a241bf59daf5315ce0ffe751c1babea9a146ffc0a389f1af3facca
-
-PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lua-ev
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=lua-ev
-  URL:=https://github.com/brimworks/lua-ev
-  DEPENDS:=+lua +libev
-endef
-
-define Package/lua-ev/description
-  Lua integration with libev.
-endef
-
-define Package/lua-ev/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/lua/cmod/ev.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-ev))
diff --git a/lang/lua-ffi/Makefile b/lang/lua-ffi/Makefile
deleted file mode 100644 (file)
index 3edf4d4..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-ffi
-PKG_VERSION:=1.1.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL=https://github.com/zhaojh329/lua-ffi/releases/download/v$(PKG_VERSION)
-PKG_HASH:=85651aa772de5717b85fc6ac9bba61f0dc20155707fad8099245f97ecd301996
-
-PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lua-ffi/default
-  TITLE:=A portable lightweight C FFI for $(1), based on libffi
-  CATEGORY:=Languages
-  SECTION:=lang
-  SUBMENU:=Lua
-  DEPENDS:=+libffi
-  URL:=https://github.com/zhaojh329/lua-ffi
-endef
-
-define Package/lua-ffi/default/description
-  Lua-ffi is a portable lightweight C FFI for Lua, based on libffi
-  and aiming to be mostly compatible with LuaJIT FFI, but written
-  from scratch in C language.
-endef
-
-define Package/lua-ffi
-  $(call Package/lua-ffi/default,lua5.1)
-  DEPENDS+=+liblua
-  VARIANT:=lua51
-endef
-
-define Package/lua-ffi-lua5.3
-  $(call Package/lua-ffi/default,lua5.3)
-  DEPENDS+=+liblua5.3
-  VARIANT:=lua53
-endef
-
-define Package/lua-ffi-lua5.4
-  $(call Package/lua-ffi/default,lua5.4)
-  DEPENDS+=+liblua5.4
-  VARIANT:=lua54
-endef
-
-Package/lua-ffi/description = $(Package/lua-ffi/default/description)
-Package/lua-ffi-lua5.3/description = $(Package/lua-ffi/default/description)
-Package/lua-ffi-lua5.4/description = $(Package/lua-ffi/default/description)
-
-ifeq ($(BUILD_VARIANT),lua51)
-  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include"
-endif
-
-ifeq ($(BUILD_VARIANT),lua53)
-  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include/lua5.3"
-endif
-
-ifeq ($(BUILD_VARIANT),lua54)
-  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include/lua5.4"
-endif
-
-define Package/lua-ffi/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/lib/lua
-endef
-
-define Package/lua-ffi-lua5.3/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/local/lib/lua/5.3
-endef
-
-define Package/lua-ffi-lua5.4/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/local/lib/lua/5.4
-endef
-
-$(eval $(call BuildPackage,lua-ffi))
-$(eval $(call BuildPackage,lua-ffi-lua5.3))
-$(eval $(call BuildPackage,lua-ffi-lua5.4))
diff --git a/lang/lua-libmodbus/Makefile b/lang/lua-libmodbus/Makefile
deleted file mode 100644 (file)
index 0527567..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-libmodbus
-PKG_VERSION:=0.7
-PKG_RELEASE:=1
-
-PKG_SOURCE:=lua-libmodbus-$(PKG_VERSION).tar.gz
-PKG_SOURCE_SUBDIR:=lua-libmodbus-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://codeload.github.com/etactica/lua-libmodbus/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=70369f4c4e36421095bf00dcee36c633b4284eaa79bcfdfd230bfefb27acefda
-PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-
-PKG_MAINTAINER:=Karl Palsson <[email protected]>
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-libmodbus
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=lua-libmodbus
-  URL:=https://github.com/etactica/lua-libmodbus
-  DEPENDS:=+liblua +libmodbus
-endef
-
-define Package/lua-libmodbus/description
-       lua-libmodbus is a binding to libmodbus,
-       see also http://www.libmodbus.org
-endef
-
-define Build/Configure
-endef
-
-define Package/lua-libmodbus/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/libmodbus.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-libmodbus))
diff --git a/lang/lua-lsqlite3/Makefile b/lang/lua-lsqlite3/Makefile
deleted file mode 100644 (file)
index 7a31424..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# Copyright (C) 2006-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lsqlite3
-PKG_VERSION:=0.9.5
-PKG_RELEASE:=1
-
-PKG_SOURCE:=lsqlite3_fsl09y.zip
-PKG_SOURCE_URL:=http://lua.sqlite.org/index.cgi/zip/
-PKG_HASH:=d38402aa7640055d260c1246c36e6d6d31b425a25a805431f13695694466b722
-
-PKG_LICENSE:=MIT
-PKG_MAINTAINER:=Oskari Rauta <[email protected]>
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/lsqlite3-$(BUILD_VARIANT)/$(basename $(PKG_SOURCE))
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lsqlite3/default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua wrapper for the SQLite3 library
-  URL:=http://lua.sqlite.org
-  DEPENDS:=+libsqlite3
-endef
-
-define Package/lsqlite3
-  $(Package/lsqlite3/default)
-  DEPENDS+=+liblua
-  VARIANT:=lua-51
-endef
-
-define Package/lsqlite3-lua5.3
-  $(Package/lsqlite3/default)
-  DEPENDS+=+liblua5.3
-  VARIANT:=lua-53
-endef
-
-define Package/lsqlite3/default/description
- LuaSQLite3 is a thin wrapper around the public domain SQLite3 database engine.
-endef
-
-Package/lsqlite3/description = $(Package/lsqlite3/default/description)
-Package/lsqlite3-lua5.3/description = $(Package/lsqlite3/default/description)
-
-TARGET_CFLAGS += $(FPIC) -std=gnu99
-TARGET_CPPFLAGS += -DLUA_USE_LINUX
-TARGET_LDFLAGS += -lsqlite3 -lpthread
-
-ifeq ($(BUILD_VARIANT),lua-53)
-  TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/lua5.3
-endif
-
-define Build/Compile
-       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
-               -c $(PKG_BUILD_DIR)/lsqlite3.c \
-               -o $(PKG_BUILD_DIR)/lsqlite3.o \
-               -DLSQLITE_VERSION=\"$(PKG_VERSION)\"
-       $(TARGET_CC) $(TARGET_LDFLAGS) -shared \
-               $(PKG_BUILD_DIR)/lsqlite3.o \
-               -o $(PKG_BUILD_DIR)/lsqlite3.so
-endef
-
-define Package/lsqlite3/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/lua/
-endef
-
-define Package/lsqlite3-lua5.3/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
-       $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/local/lib/lua/5.3
-endef
-
-$(eval $(call BuildPackage,lsqlite3))
-$(eval $(call BuildPackage,lsqlite3-lua5.3))
diff --git a/lang/lua-lzlib/Makefile b/lang/lua-lzlib/Makefile
deleted file mode 100644 (file)
index bf84a51..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-lzlib
-PKG_VERSION:=0.4.3
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
-PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-lzlib
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua zlib binding
-  URL:=http://github.com/LuaDist/lzlib
-  DEPENDS:= +lua +zlib
-endef
-
-define Package/lua-lzlib/description
-       A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package. 
-endef
-
-MAKE_FLAGS += \
-       LUA="$(STAGING_DIR)/usr" \
-       OFLAGS="$(TARGET_CFLAGS)" \
-
-define Package/lua-lzlib/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
-
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
-endef
-
-$(eval $(call BuildPackage,lua-lzlib))
diff --git a/lang/lua-lzlib/patches/001-allow_optim_flags.patch b/lang/lua-lzlib/patches/001-allow_optim_flags.patch
deleted file mode 100644 (file)
index 78f981d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -14,7 +14,8 @@ LUABIN= $(LUA)/bin
- ZLIB=../zlib-1.2.3
- # no need to change anything below here
--CFLAGS= $(INCS) $(DEFS) $(WARN) -O0 -fPIC
-+CFLAGS= $(INCS) $(DEFS) $(WARN) $(OFLAGS) -fPIC
-+OFLAGS= -O0
- WARN= -g -Werror -Wall -pedantic #-ansi
- INCS= -I$(LUAINC) -I$(ZLIB)
- LIBS= -L$(ZLIB) -lz -L$(LUALIB) -L$(LUABIN) #-llua51
diff --git a/lang/lua-md5/Makefile b/lang/lua-md5/Makefile
deleted file mode 100644 (file)
index f4bb3e1..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-md5
-PKG_VERSION:=1.3
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=675b8ba144d14cbe66abfd360d9a8861a18d5b69966768d6cdc78ca3c9fe0baf
-PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=2a98633d7587a4900cfa7cbed340f377f4acd930
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-md5
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua-MD5
-  URL:=https://github.com/keplerproject/md5
-  DEPENDS:=+lua
-endef
-
-define Package/lua-md5/description
-  MD5 offers basic cryptographic facilities for Lua
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-# add make variable overrides here
-MAKE_FLAGS +=
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               PREFIX="$(STAGING_DIR)/usr" \
-               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
-               clean
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               PREFIX="$(STAGING_DIR)/usr" \
-               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
-               LIB_OPTION="-shared" \
-               CC="$(TARGET_CROSS)gcc" \
-               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
-               all
-endef
-
-define Build/Install
-       mkdir -p $(PKG_INSTALL_DIR)/usr/lib/lua
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
-               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
-               install
-endef
-
-define Package/lua-md5/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
-       $(INSTALL_DIR) $(1)/usr/lib/lua/md5
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
-endef
-
-$(eval $(call BuildPackage,lua-md5))
diff --git a/lang/lua-md5/patches/config.patch b/lang/lua-md5/patches/config.patch
deleted file mode 100644 (file)
index 4c95037..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/config
-+++ b/config
-@@ -1,16 +1,16 @@
- # Installation directories
- # Default prefix
--PREFIX = /usr/local
-+PREFIX = /usr
- # Lua version
- LUA_SYS_VER ?= 5.2
- # System's libraries directory (where binary libraries are installed)
--LUA_LIBDIR= $(PREFIX)/lib/lua/$(LUA_SYS_VER)
-+LUA_LIBDIR= $(PREFIX)/lib/lua
- # System's lua directory (where Lua libraries are installed)
--LUA_DIR= $(PREFIX)/share/lua/$(LUA_SYS_VER)
-+LUA_DIR= $(PREFIX)/share/lua
- # Lua includes directory
- LUA_INC= $(PREFIX)/include
diff --git a/lang/lua-md5/patches/makefile.patch b/lang/lua-md5/patches/makefile.patch
deleted file mode 100644 (file)
index 0f0f709..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -1,6 +1,6 @@
- # $Id: Makefile,v 1.7 2007/10/11 00:02:56 carregal Exp $
--CONFIG= ./config
-+CFLAGS+= -fPIC
- include $(CONFIG)
diff --git a/lang/lua-mobdebug/Makefile b/lang/lua-mobdebug/Makefile
deleted file mode 100644 (file)
index b1c387d..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-mobdebug
-PKG_VERSION:=0.70
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/pkulchenko/MobDebug/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=35ec131a0ecc74dbe1cc50582ed977120a4ef6d9f815ce07367fdb945cfee370
-PKG_BUILD_DIR:=$(BUILD_DIR)/MobDebug-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-mobdebug
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua-MobDebug
-  URL:=https://github.com/pkulchenko/MobDebug
-  DEPENDS:=+lua
-  PKGARCH:=all
-endef
-
-define Package/lua-mobdebug/description
-  MobDebug is a remote debugger for Lua (including Lua 5.1, Lua 5.2, Lua 5.3, and LuaJIT 2.x).
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Build/Install
-endef
-
-# add make variable overrides here
-MAKE_FLAGS +=
-
-define Package/lua-mobdebug/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/mobdebug.lua $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-mobdebug))
diff --git a/lang/lua-mosquitto/Makefile b/lang/lua-mosquitto/Makefile
deleted file mode 100644 (file)
index 4e0aaac..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2013-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-mosquitto
-PKG_VERSION:=0.4.1
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_HASH:=d6bc828ea05f9a1ff3241f575a6ce699e577f9b79277182699e8fa03ac094ac9
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
-PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-mosquitto
-    SUBMENU:=Lua
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=Lua-mosquitto
-    DEPENDS:=+libmosquitto +lua
-    MAINTAINER:=Karl Palsson <[email protected]>
-endef
-
-define Package/lua-mosquitto/description
-       Lua bindings to libmosquitto
-endef
-
-define Package/lua-mosquitto/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-mosquitto))
diff --git a/lang/lua-openssl/Makefile b/lang/lua-openssl/Makefile
deleted file mode 100644 (file)
index ddacdef..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2016 Amnon Paz <[email protected]>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-openssl
-PKG_SOURCE_VERSION:=0.10.0-0
-PKG_VERSION:=$(subst -,.,$(PKG_SOURCE_VERSION))
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
-PKG_MIRROR_HASH:=e3c6173321132e2ce69cdedd8638acdc970a3fb1c0c3677d4edd9fe39e84853f
-
-PKG_MAINTAINER:=Amnon Paz <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lua-openssl
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua openSSL binding
-  URL:=http://github.com/zhaozg/lua-openssl
-  DEPENDS:=+lua +libopenssl +librt
-endef
-
-define Package/lua-openssl/description
-    A free, MIT-licensed OpenSSL binding for Lua.
-endef
-
-define Package/lua-openssl/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/openssl.so $(1)/usr/lib/lua/
-endef
-
-$(eval $(call BuildPackage,lua-openssl))
diff --git a/lang/lua-openssl/patches/010-no-luajit.patch b/lang/lua-openssl/patches/010-no-luajit.patch
deleted file mode 100644 (file)
index 5530968..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -12,10 +12,7 @@ endif()
- include(GNUInstallDirs)
--find_package(LuaJIT)
--if(NOT LUAJIT_FOUND)
--    find_package(Lua REQUIRED)
--endif()
-+find_package(Lua REQUIRED)
- find_package(OpenSSL REQUIRED)
- set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
diff --git a/lang/lua-penlight/Makefile b/lang/lua-penlight/Makefile
deleted file mode 100644 (file)
index 34d96e6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-penlight
-PKG_VERSION:=1.13.1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/lunarmodules/Penlight/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=530380e1a377df519c2e589f47823f79701f8e0e67f6bbd994e18d09a470b680
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE.md
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-penlight
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Penlight
-  URL:=http://lunarmodules.github.io/Penlight/manual/01-introduction.md.html
-  DEPENDS:=+luafilesystem
-  MAINTAINER:=Karl Palsson <[email protected]>
-endef
-
-define Package/lua-penlight/description
-  It is often said of Lua that it does not include batteries.
-  Penlight is the batteries.
-endef
-
-define Build/Compile
-       echo "Nothing to compile, pure lua package"
-endef
-
-define Package/lua-penlight/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(CP) $(PKG_BUILD_DIR)/lua/pl $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-penlight))
diff --git a/lang/lua-rings/Makefile b/lang/lua-rings/Makefile
deleted file mode 100644 (file)
index 53fe67b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-rings
-PKG_VERSION:=1.3.0
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=7026ce5898d37a4175b7afad693d59ff1fff1a84adafcabfafd065956a03616c
-PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_FIXUP:=autoreconf
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-rings
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua-Rings
-  URL:=http://keplerproject.github.io/rings/
-  DEPENDS:=+lua
-endef
-
-define Package/lua-rings/description
-  Rings is a library which provides a way to create new Lua states from within Lua.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-# add make variable overrides here
-MAKE_FLAGS +=
-
-define Build/Configure
-endef
-
-define Package/lua-rings/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rings.so $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/stable.lua $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-rings))
diff --git a/lang/lua-rings/patches/config.patch b/lang/lua-rings/patches/config.patch
deleted file mode 100644 (file)
index 0551378..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/config
-+++ b/config
-@@ -1,15 +1,15 @@
- # Installation directories
- # Default prefix
--PREFIX ?= /usr/local
-+PREFIX ?= /usr
- DESTDIR ?= /
- # System's libraries directory (where binary libraries are installed)
--LUA_LIBDIR ?= $(PREFIX)/lib/lua/5.1
-+LUA_LIBDIR ?= $(PREFIX)/lib/lua
- # System's lua directory (where Lua libraries are installed)
--LUA_DIR ?= $(PREFIX)/share/lua/5.1
-+LUA_DIR ?= $(PREFIX)/lib/lua
- # Lua includes directory
- LUA_INC ?= $(PREFIX)/include
-@@ -24,6 +24,5 @@ LIBNAME ?= $T.so.$V
- WARN ?= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith -pedantic
- INCS ?= -I$(LUA_INC)
- CFLAGS ?= $(WARN) $(INCS)
--CC ?= gcc
- # $Id: config,v 1.7 2007/10/29 22:51:39 carregal Exp $
diff --git a/lang/lua-rings/patches/makefile.patch b/lang/lua-rings/patches/makefile.patch
deleted file mode 100644 (file)
index d639ef9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -3,6 +3,8 @@
- T= rings
- CONFIG= ./config
-+CFLAGS+= -fPIC
-+
- include $(CONFIG)
- SRCS= src/rings.c
diff --git a/lang/lua-rs232/Makefile b/lang/lua-rs232/Makefile
deleted file mode 100644 (file)
index 925ee69..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-rs232
-PKG_SOURCE_DATE:=2019-11-20
-PKG_SOURCE_VERSION:=c106c94d1a5a84e8582c936528303528608776c2
-PKG_RELEASE:=3
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/srdgame/librs232
-PKG_MIRROR_HASH:=d507ce004a9b02b8d8a31d0c348eb9c481f1030153c941131aeff0dd3046a419
-
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYING
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=lua/host
-PKG_BUILD_FLAGS:=gc-sections
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-rs232
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua Serial Library
-  URL:=https://github.com/srdgame/librs232
-  DEPENDS:= +lua
-endef
-
-define Package/lua-rs232/description
-  multiplatform library for serial communications over RS-232
-endef
-
-TARGET_LDFLAGS += -Wl,--as-needed
-MAKE_FLAGS += luadir='$$$${prefix}/lib/lua' luaexecdir='$$$${exec_prefix}/lib/lua'
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/librs232
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/librs232/rs232* $(1)/usr/include/librs232
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librs232.pc $(1)/usr/lib/pkgconfig
-endef
-
-define Package/lua-rs232/install
-       $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,lua-rs232))
diff --git a/lang/lua-rs232/patches/010-gcc13.patch b/lang/lua-rs232/patches/010-gcc13.patch
deleted file mode 100644 (file)
index 32da137..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From 3467c3c354263b066ad47bddfe6eb869c0111e0d Mon Sep 17 00:00:00 2001
-From: Damian Wrobel <[email protected]>
-Date: Tue, 24 Jan 2023 10:19:16 +0100
-Subject: [PATCH] Fix rs232_set_* prototypes mismatch
-
-Fixes compilation error on gcc 13 (excerpt):
- rs232_posix.c:490:1: error: conflicting types for 'rs232_set_baud' \
-   due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
-   enum rs232_baud_e)' [-Werror=enum-int-mismatch]
-  490 | rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud)
-      | ^~~~~~~~~~~~~~
- In file included from rs232_posix.c:39:
- ../include/librs232/rs232.h:203:24: note: previous declaration of \
-   'rs232_set_baud' with type 'unsigned int(struct rs232_port_t *, unsigned int)'
-  203 | RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
-      |                        ^~~~~~~~~~~~~~
-
- rs232_posix.c:591:1: error: conflicting types for 'rs232_set_dtr' \
-  due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
-  enum rs232_dtr_e)' [-Werror=enum-int-mismatch]
-  591 | rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state)
-      | ^~~~~~~~~~~~~
- In file included from rs232_posix.c:39:
-  ../include/librs232/rs232.h:208:24: note: previous declaration of 'rs232_set_dtr' \
-  with type 'unsigned int(struct rs232_port_t *, unsigned int)'
-  208 | RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
-      |                        ^~~~~~~~~~~~~
-
-Signed-off-by: Damian Wrobel <[email protected]>
----
- include/librs232/rs232.h | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
---- a/include/librs232/rs232.h
-+++ b/include/librs232/rs232.h
-@@ -200,13 +200,13 @@ RS232_LIB unsigned int rs232_port_open(s
- RS232_LIB unsigned int rs232_close(struct rs232_port_t *p);
- RS232_LIB unsigned int rs232_flush(struct rs232_port_t *p);
- RS232_LIB void rs232_set_device(struct rs232_port_t *p, const char *device);
--RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
--RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, unsigned int stop);
--RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, unsigned int data);
--RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, unsigned int parity);
--RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, unsigned int flow);
--RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
--RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, unsigned int rts);
-+RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud);
-+RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, enum rs232_stop_e stop);
-+RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, enum rs232_data_e data);
-+RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, enum rs232_parity_e parity);
-+RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, enum rs232_flow_e flow);
-+RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state);
-+RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, enum rs232_rts_e state);
- RS232_LIB const char * rs232_get_device(struct rs232_port_t *p);
- RS232_LIB unsigned int rs232_get_baud(struct rs232_port_t *p);
- RS232_LIB unsigned int rs232_get_stop(struct rs232_port_t *p);
diff --git a/lang/lua-rs232/patches/100-remove-build-timestamps.patch b/lang/lua-rs232/patches/100-remove-build-timestamps.patch
deleted file mode 100644 (file)
index 4299cdf..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/bindings/lua/luars232.c
-+++ b/bindings/lua/luars232.c
-@@ -31,7 +31,6 @@
- #include "librs232/rs232.h"
--#define MODULE_TIMESTAMP __DATE__ " " __TIME__
- #define MODULE_NAMESPACE "luars232"
- #define MODULE_VERSION "1.0.3"
- #define MODULE_BUILD "$Id: luars232.c 15 2011-02-23 09:02:20Z sp $"
-@@ -553,9 +552,6 @@ RS232_LIB int luaopen_luars232(lua_State
-       lua_pushstring(L, MODULE_BUILD);
-       lua_setfield(L, -2, "_BUILD");
--      lua_pushstring(L, MODULE_TIMESTAMP);
--      lua_setfield(L, -2, "_TIMESTAMP");
--
-       lua_pushstring(L, MODULE_COPYRIGHT);
-       lua_setfield(L, -2, "_COPYRIGHT");
diff --git a/lang/lua-sha2/Makefile b/lang/lua-sha2/Makefile
deleted file mode 100644 (file)
index e76a5a2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 20013-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-sha2
-PKG_VERSION:=0.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=79e65bd7cb1b8ef64e125c9e57f40b7d38678599587c1894ce57838814403945
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-sha2
-       SUBMENU:=Lua
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=Lua binding for Aaron Gifford's SHA-2 implementation
-       URL:=https://code.google.com/p/sha2/
-       MAINTAINER:=Lars Gierth <[email protected]>
-       DEPENDS:=+lua
-endef
-
-define Package/lua-sha2/description
-       Lua Binding for the SHA-2 (SHA-256/384/512) BSD-licensed C implementation by Aaron Gifford.
-       Also contains a HMAC implementation in Lua.
-endef
-
-TARGET_CFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
-TARGET_LDFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
-
-define Build/Configure
-endef
-
-define Package/lua-sha2/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/hmac
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/sha2.so $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/sha2.lua $(1)/usr/lib/lua/hmac
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/md5.lua $(1)/usr/lib/lua/hmac
-endef
-
-$(eval $(call BuildPackage,lua-sha2))
diff --git a/lang/lua-sha2/patches/001-makefile.patch b/lang/lua-sha2/patches/001-makefile.patch
deleted file mode 100644 (file)
index e395044..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-From: Lars Gierth <[email protected]>
-Date: Tue, 2 Sep 2014 00:05:39 +0200
-
-    Add rump Makefile
-
-new file mode 100644
-index 0000000..f081d38
---- /dev/null
-+++ b/Makefile
-@@ -0,0 +1,4 @@
-+all: sha2.o sha2lib.o
-+      $(CC) -shared -o sha2.so sha2.o sha2lib.o
-+
-+.PHONY: all
diff --git a/lang/lua-struct/Makefile b/lang/lua-struct/Makefile
deleted file mode 100644 (file)
index f24131f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-struct
-PKG_VERSION:=0.9.2
-PKG_RELEASE:=1
-
-PKG_VERSION_TAG:=$(PKG_VERSION)-1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION_TAG).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/iryont/$(PKG_NAME)/tar.gz/$(PKG_VERSION_TAG)?
-PKG_HASH:=30d4e3584e27caa504745fdf5e191f2469ae284dc51271292654856905a4603d
-
-PKG_MAINTAINER:=jasle <[email protected]>
-PKG_LICENSE:=MIT/X11
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION_TAG)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-struct
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Implementation of binary packing/unpacking in pure lua
-  URL:=https://github.com/iryont/lua-struct
-endef
-
-define Package/lua-struct/desription
-       lua-struct is a pure lua Implementation for packing and unpacking 
-       binary data. 
-endef
-
-define Build/Compile
-       echo "Nothing to compile, pure lua package"
-endef
-
-define Package/lua-struct/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/struct.lua $(1)/usr/lib/lua/
-endef
-
-$(eval $(call BuildPackage,lua-struct))
-
diff --git a/lang/lua-wsapi/Makefile b/lang/lua-wsapi/Makefile
deleted file mode 100644 (file)
index 5a1c99b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-wsapi
-PKG_VERSION:=1.7
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/wsapi/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=48dc7aba0fd2e96a3e5ef51045b5d923964f6ae299de761aa0467031ad44e987
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/wsapi-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-wsapi/Default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua WSAPI
-  URL:=https://keplerproject.github.io/wsapi/
-  DEPENDS:= +lua
-  PKGARCH:=all
-endef
-
-define Package/lua-wsapi/Default/description
-  WSAPI is an API that abstracts the web server from Lua web applications
-endef
-
-
-define Package/lua-wsapi-base
-$(call Package/lua-wsapi/Default)
-  TITLE+= base
-  DEPENDS+= +luafilesystem
-  VARIANT:=base
-endef
-
-define Package/lua-wsapi-base/description
-$(call Package/lua-wsapi/Default/description)
- .
- This package contains the basic stuff.
-endef
-
-define Package/lua-wsapi-xavante
-$(call Package/lua-wsapi/Default)
-  TITLE+= xavante
-  DEPENDS+= +lua-wsapi-base +lua-xavante
-  VARIANT:=xavante
-endef
-
-define Package/lua-wsapi-xavante/description
-$(call Package/lua-wsapi/Default/description)
- .
- This package contains the Xavante stuff.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Build/Install
-endef
-
-define Package/lua-wsapi-base/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi.lua $(1)/usr/lib/lua
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi.cgi $(1)/usr/bin
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/{common,request,response,util,cgi,sapi,ringer,mock}.lua $(1)/usr/lib/lua/wsapi
-endef
-
-define Package/lua-wsapi-xavante/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi $(1)/usr/bin
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/xavante.lua $(1)/usr/lib/lua/wsapi
-endef
-
-
-$(eval $(call BuildPackage,lua-wsapi-base))
-$(eval $(call BuildPackage,lua-wsapi-xavante))
diff --git a/lang/lua-xavante/Makefile b/lang/lua-xavante/Makefile
deleted file mode 100644 (file)
index 9b870aa..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua-xavante
-PKG_VERSION:=2.4.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/xavante/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=0e4f49dd96cb092cd5d80cc66a5204dcb22a14f80897a121f2f0d1dceb1c7ba5
-PKG_BUILD_DIR:=$(BUILD_DIR)/xavante-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lua-xavante
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Xavante Web Server
-  URL:=https://keplerproject.github.io/xavante/
-  DEPENDS:= +lua
-  PKGARCH:=all
-endef
-
-define Package/lua-xavante/description
-  Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture based on URI mapped handlers.
-endef
-
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Build/Install
-endef
-
-define Package/lua-xavante/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/sajax/sajax.lua $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/xavante.lua $(1)/usr/lib/lua
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/xavante
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/{cgiluahandler,encoding,filehandler,httpd,mime,patternhandler,redirecthandler,vhostshandler,indexhandler,urlhandler,ruleshandler}.lua $(1)/usr/lib/lua/xavante
-endef
-
-$(eval $(call BuildPackage,lua-xavante))
diff --git a/lang/lua/cqueues/Makefile b/lang/lua/cqueues/Makefile
new file mode 100644 (file)
index 0000000..14191c6
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Copyright (C) 2022 Siger Yang <[email protected]>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cqueues
+PKG_VERSION:=20200726
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Siger Yang <[email protected]>
+
+PKG_MIRROR_HASH:=214a09c250e92d12cd63cdaedce9491f874a920e8222cc4faf10a978ec7bd1bd
+PKG_SOURCE_URL:=https://github.com/wahern/cqueues.git
+PKG_SOURCE_VERSION:=rel-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/cqueues/default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=cqueues for $(1)
+  URL:=http://25thandclement.com/~william/projects/cqueues.html
+  DEPENDS:=+libopenssl
+endef
+
+define Package/cqueues/default/description
+ Continuation Queues: Embeddable asynchronous networking, threading, and
+ notification framework for Lua on Unix. 
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += $(FPIC)
+
+define Package/cqueues
+  $(call Package/cqueues/default,lua5.1)
+  DEPENDS+=+liblua
+  VARIANT:=lua51
+endef
+
+define Package/cqueues-lua5.3
+  $(call Package/cqueues/default,lua5.3)
+  DEPENDS+=+liblua5.3
+  VARIANT:=lua53
+endef
+
+define Package/cqueues-lua5.4
+  $(call Package/cqueues/default,lua5.4)
+  DEPENDS+=+liblua5.4
+  VARIANT:=lua54
+endef
+
+Package/cqueues/description = $(Package/cqueues/default/description)
+Package/cqueues-lua5.3/description = $(Package/cqueues/default/description)
+Package/cqueues-lua5.4/description = $(Package/cqueues/default/description)
+
+ifeq ($(BUILD_VARIANT),lua51)
+  MAKE_FLAGS += \
+       LUA_APIS="5.1" \
+       LUA51_CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+       lua51cpath="/usr/lib/lua" \
+       lua51path="/usr/lib/lua"
+endif
+ifeq ($(BUILD_VARIANT),lua53)
+  MAKE_FLAGS += \
+       LUA_APIS="5.3" \
+       LUA53_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.3" \
+       lua53cpath="/usr/local/lib/lua/5.3" \
+       lua53path="/usr/local/lib/lua/5.3"
+endif
+ifeq ($(BUILD_VARIANT),lua54)
+  MAKE_FLAGS += \
+       LUA_APIS="5.4" \
+       LUA54_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.4" \
+       lua54cpath="/usr/local/lib/lua/5.4" \
+       lua54path="/usr/local/lib/lua/5.4"
+endif
+
+define Package/cqueues/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/_cqueues.so $(1)/usr/lib/lua/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/cqueues.lua $(1)/usr/lib/lua/
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/cqueues $(1)/usr/lib/lua/
+endef
+
+define Package/cqueues-lua5.3/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/_cqueues.so $(1)/usr/local/lib/lua/5.3
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/cqueues.lua $(1)/usr/local/lib/lua/5.3
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/cqueues $(1)/usr/local/lib/lua/5.3
+endef
+define Package/cqueues-lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/_cqueues.so $(1)/usr/local/lib/lua/5.4
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/cqueues.lua $(1)/usr/local/lib/lua/5.4
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/cqueues $(1)/usr/local/lib/lua/5.4
+endef
+
+$(eval $(call BuildPackage,cqueues))
+$(eval $(call BuildPackage,cqueues-lua5.3))
+$(eval $(call BuildPackage,cqueues-lua5.4))
diff --git a/lang/lua/dkjson/Makefile b/lang/lua/dkjson/Makefile
new file mode 100644 (file)
index 0000000..3f0f6fd
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 20013-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dkjson
+PKG_VERSION:=2.5
+PKG_RELEASE:=4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/LuaDist/dkjson/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=8560ee3c7ed421b293bf0905017bc90bd2f282d56517aa59ec6c53f5fb4057bd
+
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dkjson
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=DKJSON
+       URL:=http://dkolf.de/src/dkjson-lua.fsl/home
+       MAINTAINER:=Lars Gierth <[email protected]>
+       DEPENDS:=+lua
+       PKGARCH:=all
+endef
+
+define Package/dkjson/description
+       Lua JSON parser/serializer with UTF-8 support
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/dkjson/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/dkjson.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,dkjson))
diff --git a/lang/lua/json4lua/Makefile b/lang/lua/json4lua/Makefile
new file mode 100644 (file)
index 0000000..6a4f8af
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#  
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=json4lua
+PKG_VERSION:=0.9.54
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/amrhassan/json4lua/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=2498e5224b024521af7f2de9a2c2af4028cd8da4b724ffd6bd94beede2402cfe
+
+PKG_MAINTAINER:=Amr Hassan <[email protected]>
+PKG_LICENSE:=MIT
+
+LUA_MODULE_PATH:=/usr/lib/lua
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/json4lua
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=json4lua
+  URL:=https://github.com/amrhassan/json4lua
+  DEPENDS:=+lua +luasocket
+  PKGARCH:=all
+endef
+
+define Package/json4lua/description
+       JSON and JSONRPC for Lua
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/json4lua/install
+       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)/json
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/json.lua $(1)/$(LUA_MODULE_PATH)/json.lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/rpc.lua $(1)/$(LUA_MODULE_PATH)/json/rpc.lua
+endef
+
+$(eval $(call BuildPackage,json4lua))
diff --git a/lang/lua/ldbus/Makefile b/lang/lua/ldbus/Makefile
new file mode 100644 (file)
index 0000000..b5ba07b
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2006-2017 OpenWrt.org
+#
+# This is free software, licensed under the GPL 2 license.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ldbus
+PKG_SOURCE_DATE:=2019-08-15
+PKG_SOURCE_VERSION:=9e176fe851006037a643610e6d8f3a8e597d4073
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/daurnimator/ldbus
+PKG_MIRROR_HASH:=6a17564734b9cd3a9c4713777b8219c5e08252be3fd6ba9f9aecbf109d1ed899
+
+PKG_MAINTAINER:=Enrico Mioso <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=luarocks/host
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ldbus
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=ldbus Lua DBus bindings
+  URL:=https://github.com/daurnimator/ldbus
+  DEPENDS:=+dbus +lua
+endef
+
+define Package/ldbus/description
+  This package contains "ldbus": LUA bindings to interact with the DBUS
+  message bus system, and services connected to it.
+  See https://github.com/daurnimator/ldbus
+  for details.
+endef
+
+define Build/Compile
+  cd $(PKG_BUILD_DIR) && \
+  luarocks make --pack-binary-rock ldbus-scm-0.rockspec \
+    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+    LUA_PKGNAME=lua5.1 \
+    DBUS_INCDIR=$(STAGING_DIR)/usr/include/dbus-1.0/ \
+    DBUS_ARCH_INCDIR=$(STAGING_DIR)/usr/lib/dbus-1.0/include \
+    DBUS_LIBDIR=$(STAGING_DIR)/usr/lib \
+    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+    CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+    LDFLAGS="$(TARGET_LDFLAGS)"
+endef
+
+define Package/ldbus/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ldbus.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,ldbus))
diff --git a/lang/lua/linotify/Makefile b/lang/lua/linotify/Makefile
new file mode 100644 (file)
index 0000000..17be2b2
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# This is free software, licensed under your choice of the following SPDX identifiers:
+# Apache-2.0, BSD-2-Clause, CC-BY-4.0, ISC, MIT, X11 or GPL-2.0-or-later
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=linotify
+PKG_VERSION:=0.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL=https://codeload.github.com/hoelzro/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=21d005f16043397a85913a7d14a267716d6384f0228718d5de464bfc0274e338
+
+PKG_MAINTAINER:=Karl Palsson <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/linotify
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=inotify binding for lua
+  DEPENDS:=+lua
+  URL:=https://github.com/hoelzro/linotify
+endef
+
+define Package/linotify/description
+ This provides a lua binding to the inotify file system change notification system
+endef
+
+define Build/Compile
+  cd $(PKG_BUILD_DIR) && \
+  $(TARGET_CC) -o inotify.so -shared $(FPIC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) linotify.c
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/inotify.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,linotify))
diff --git a/lang/lua/lpeg/Makefile b/lang/lua/lpeg/Makefile
new file mode 100644 (file)
index 0000000..896b70b
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lpeg
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
+PKG_HASH:=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lpeg
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LPeg
+  URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
+  DEPENDS:=+lua
+endef
+
+define Package/lpeg/description
+       LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs)
+endef
+
+define Build/Configure
+endef
+
+# add make variable overrides here
+MAKE_FLAGS += \
+       COPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -O2"
+
+define Package/lpeg/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lpeg.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lpeg))
diff --git a/lang/lua/lua-argparse/Makefile b/lang/lua/lua-argparse/Makefile
new file mode 100644 (file)
index 0000000..82aeb7a
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2006-2020 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-argparse
+PKG_VERSION:=0.7.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/luarocks/argparse/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=d344e49404c3e7b3e7fa4fe6741c106f25909d9b24923cb08dcceda1f9754809
+PKG_BUILD_DIR:=$(BUILD_DIR)/argparse-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Vladimir Malyutin <[email protected]>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-argparse
+        SUBMENU:=Lua
+        SECTION:=lang
+        CATEGORY:=Languages
+        TITLE:=lua-argparse
+        URL:=https://github.com/mpeterv/argparse
+        DEPENDS:=+lua
+        PKGARCH:=all
+endef
+
+define Package/lua-argparse/description
+        Argparse is a feature-rich command line parser for Lua inspired by argparse for Python.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/lua-argparse/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/argparse.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-argparse))
diff --git a/lang/lua/lua-bencode/Makefile b/lang/lua/lua-bencode/Makefile
new file mode 100644 (file)
index 0000000..3edee23
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 20013-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-bencode
+PKG_VERSION:=2.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://bitbucket.org/wilhelmy/lua-bencode/downloads/
+PKG_HASH:=25830ff3fe342c09c65995d46c4d89ad0387cc502b1a2f70f9cca2d8c7ccafdd
+
+PKG_MAINTAINER:=Lars Gierth <[email protected]>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-bencode
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=lua-bencode
+       URL:=https://bitbucket.org/wilhelmy/lua-bencode
+       DEPENDS:=+lua
+       PKGARCH:=all
+endef
+
+define Package/lua-bencode/description
+       This is a module for the lua programming language for decoding and encoding
+       bencoded data which can be used to read and write torrent files for bittorrent.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+
+define Package/lua-bencode/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/bencode.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-bencode))
diff --git a/lang/lua/lua-bit32/Makefile b/lang/lua/lua-bit32/Makefile
new file mode 100644 (file)
index 0000000..da4ae87
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-bit32
+PKG_VERSION:=5.3.0
+PKG_RELEASE:=1
+
+
+PKG_SRC_NAME:=lua-compat-5.2
+PKG_SRC_VERSION:=0.3
+PKG_SOURCE_URL=https://codeload.github.com/keplerproject/$(PKG_SRC_NAME)/tar.gz/v$(PKG_SRC_VERSION)?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=627e842c488c1afece4383da9f9a839a7ddbc2f7fedfc456f76e3a590d4ca67f
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SRC_NAME)-$(PKG_SRC_VERSION)
+
+PKG_MAINTAINER:=Maxim Storchak <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=luarocks/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-bit32
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua 5.2 bit manipulation library
+  DEPENDS:=+lua
+endef
+
+define Package/lua-bit32/description
+  lua-bit32 is the native Lua 5.2 bit manipulation library,
+  backported to Lua 5.1
+endef
+
+TARGET_CFLAGS += \
+       -I$(STAGING_DIR)/usr/include
+
+define Build/Compile
+  cd $(PKG_BUILD_DIR) && \
+  luarocks make --pack-binary-rock bit32-scm-1.rockspec \
+    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+    LUA_PKGNAME=lua5.1 \
+       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+    CC="$(TARGET_CC)" LD="$(TARGET_CC)"
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit32.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-bit32))
diff --git a/lang/lua/lua-cjson/Makefile b/lang/lua/lua-cjson/Makefile
new file mode 100644 (file)
index 0000000..3a70707
--- /dev/null
@@ -0,0 +1,98 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-cjson
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=5
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://kyne.au/~mark/software/download/
+PKG_HASH:=51bc69cd55931e0cba2ceae39e9efa2483f4292da3a88a1ed470eda829f6c778
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+HOST_BUILD_DEPENDS:=lua/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-cjson/default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua CJSON parser
+  URL:=https://github.com/mpx/lua-cjson
+endef
+
+define Package/lua-cjson
+  $(Package/lua-cjson/default)
+  DEPENDS+=+liblua
+  VARIANT:=lua-51
+endef
+
+define Package/lua-cjson-lua5.3
+  $(Package/lua-cjson/default)
+  DEPENDS+=+liblua5.3
+  VARIANT:=lua-53
+endef
+
+define Package/lua-cjson-lua5.4
+  $(Package/lua-cjson/default)
+  DEPENDS+=+liblua5.4
+  VARIANT:=lua-54
+endef
+
+define Package/lua-cjson/default/description
+  Lua CJSON is a fast JSON encoding/parsing module for Lua.
+endef
+
+Package/lua-cjson/description = $(Package/lua-cjson/default/description)
+Package/lua-cjson-lua5.3/description = $(Package/lua-cjson/default/description)
+Package/lua-cjson-lua5.4/description = $(Package/lua-cjson/default/description)
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+CMAKE_HOST_OPTIONS += \
+       -DLUA_MATH_LIBRARY=m
+
+ifeq ($(BUILD_VARIANT),lua-53)
+  CMAKE_OPTIONS += -DUSE_LUA53=ON
+endif
+
+ifeq ($(BUILD_VARIANT),lua-54)
+  CMAKE_OPTIONS += -DUSE_LUA54=ON
+endif
+
+define Package/lua-cjson/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/cjson
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
+endef
+
+define Package/lua-cjson-lua5.3/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/local/lib/lua/5.3
+endef
+
+define Package/lua-cjson-lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/local/lib/lua/5.4
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,lua-cjson))
+$(eval $(call BuildPackage,lua-cjson-lua5.3))
+$(eval $(call BuildPackage,lua-cjson-lua5.4))
diff --git a/lang/lua/lua-cjson/patches/001-add-support-lua5-x.patch b/lang/lua/lua-cjson/patches/001-add-support-lua5-x.patch
new file mode 100644 (file)
index 0000000..253cfbd
--- /dev/null
@@ -0,0 +1,78 @@
+--- a/lua_cjson.c
++++ b/lua_cjson.c
+@@ -1227,7 +1227,10 @@ static void json_process_value(lua_State
+         lua_pushlstring(l, token->value.string, token->string_len);
+         break;;
+     case T_NUMBER:
+-        lua_pushnumber(l, token->value.number);
++        if ((lua_Integer)token->value.number == token->value.number)
++            lua_pushinteger(l, (lua_Integer)token->value.number);
++        else
++            lua_pushnumber(l, token->value.number);
+         break;;
+     case T_BOOLEAN:
+         lua_pushboolean(l, token->value.boolean);
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,8 +15,28 @@ if(NOT CMAKE_BUILD_TYPE)
+         FORCE)
+ endif()
+-find_package(Lua51 REQUIRED)
+-include_directories(${LUA_INCLUDE_DIR})
++if(USE_LUA54)
++    find_path(LUA54_INCLUDE_DIRS lua.h PATH_SUFFIXES lua5.4)
++    find_library(LUA54_LIBRARIES lua5.4)
++
++    if (NOT LUA54_INCLUDE_DIRS OR NOT LUA54_LIBRARIES)
++        message(FATAL_ERROR "Liblua 5.4 is required.")
++    endif()
++
++    include_directories(${LUA54_INCLUDE_DIRS})
++elseif(USE_LUA53)
++    find_path(LUA53_INCLUDE_DIRS lua.h PATH_SUFFIXES lua5.3)
++    find_library(LUA53_LIBRARIES lua5.3)
++
++    if (NOT LUA53_INCLUDE_DIRS OR NOT LUA53_LIBRARIES)
++        message(FATAL_ERROR "Liblua 5.3 is required.")
++    endif()
++
++    include_directories(${LUA53_INCLUDE_DIRS})
++else()
++    find_package(Lua51 REQUIRED)
++    include_directories(${LUA_INCLUDE_DIR})
++endif()
+ if(NOT USE_INTERNAL_FPCONV)
+     # Use libc number conversion routines (strtod(), sprintf())
+@@ -51,7 +71,14 @@ if(NOT HAVE_ISINF)
+ endif()
+ set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}")
+-get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
++
++if(USE_LUA54)
++    get_filename_component(_lua_lib_dir ${LUA54_LIBRARIES} PATH)
++elseif(USE_LUA53)
++    get_filename_component(_lua_lib_dir ${LUA53_LIBRARIES} PATH)
++else()
++    get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
++endif()
+ if(APPLE)
+     set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+@@ -65,7 +92,13 @@ if(WIN32)
+     # Windows sprintf()/strtod() handle NaN/inf differently. Not supported.
+     add_definitions(-DDISABLE_INVALID_NUMBERS)
+ else()
+-    set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
++    if(USE_LUA54)
++        set(_lua_module_dir "${_lua_lib_dir}/lua/5.4")
++    elseif(USE_LUA53)
++        set(_lua_module_dir "${_lua_lib_dir}/lua/5.3")
++    else()
++        set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
++    endif()
+ endif()
+ add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES})
diff --git a/lang/lua/lua-cjson/patches/900-cmake-4-compatibility.patch b/lang/lua/lua-cjson/patches/900-cmake-4-compatibility.patch
new file mode 100644 (file)
index 0000000..dd3880c
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,8 +3,8 @@
+ #       Unix: export LUA_DIR=/home/user/pkg
+ #       Windows: set LUA_DIR=c:\lua51
++cmake_minimum_required(VERSION 3.10)
+ project(lua-cjson C)
+-cmake_minimum_required(VERSION 2.6)
+ option(USE_INTERNAL_FPCONV "Use internal strtod() / g_fmt() code for performance")
+ option(MULTIPLE_THREADS "Support multi-threaded apps with internal fpconv - recommended" ON)
diff --git a/lang/lua/lua-copas/Makefile b/lang/lua/lua-copas/Makefile
new file mode 100644 (file)
index 0000000..527ec52
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-copas
+PKG_VERSION:=2.0.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=copas-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/copas/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=1469eaf987513f5a9a0bee345c040c8fa30ca6194bc75ad78171362f9904cf3e
+PKG_BUILD_DIR:=$(BUILD_DIR)/copas-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-copas
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Copas
+  URL:=https://github.com/keplerproject/copas
+  DEPENDS:=+lua
+endef
+
+define Package/lua-copas/description
+  Copas is a dispatcher based on coroutines that can be used by TCP/IP servers.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               PREFIX="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+define Package/lua-copas/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/ftp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/smtp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/http.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/limit.lua $(1)/usr/lib/lua/copas
+endef
+
+$(eval $(call BuildPackage,lua-copas))
diff --git a/lang/lua/lua-coxpcall/Makefile b/lang/lua/lua-coxpcall/Makefile
new file mode 100644 (file)
index 0000000..c9345df
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-coxpcall
+PKG_VERSION:=1.17.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=e037c1aa1d2a2b213fca144d86cd5b5cf2cd77cec6d8f52d056add7ea806f0dc
+PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=ea22f44e490430e40217f0792bf82eaeaec51903
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-coxpcall
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Coxpcall
+  URL:=https://github.com/keplerproject/coxpcall
+  DEPENDS:=+lua
+endef
+
+define Package/lua-coxpcall/description
+  Coxpcall encapsulates the protected calls with a coroutine based loop,
+  so errors can be dealed without the usual pcall/xpcall issues with coroutines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-coxpcall/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/coxpcall.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-coxpcall))
diff --git a/lang/lua/lua-coxpcall/patches/config.patch b/lang/lua/lua-coxpcall/patches/config.patch
new file mode 100644 (file)
index 0000000..b96455a
--- /dev/null
@@ -0,0 +1,4 @@
+--- /dev/null
++++ b/config
+@@ -0,0 +1 @@
++LUA_DIR ?=$(DESTDIR)/usr/lib/lua
diff --git a/lang/lua/lua-cs-bouncer/Makefile b/lang/lua/lua-cs-bouncer/Makefile
new file mode 100644 (file)
index 0000000..3f8f759
--- /dev/null
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (C) 2021-2022 Gerald Kerma
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-cs-bouncer
+PKG_SOURCE_DATE:=2022-01-18
+PKG_SOURCE_VERSION:=e0f68b1265c386715c1d6ab79fe9063c0a9e3d3a
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/$(PKG_NAME)/tar.gz/$(PKG_SOURCE_VERSION)?
+PKG_HASH:=c7e92cc9dc023ebcd84f3632d6cf0e38a7d9f5e7bba15367247753a306b89829
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Gerald Kerma <[email protected]>
+
+HOST_BUILD_DEPENDS:=lua/host
+PKG_BUILD_DEPENDS:=luarocks/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-cs-bouncer
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua Crowdsec Bouncer module
+  URL:=https://github.com/crowdsecurity/lua-cs-bouncer
+  DEPENDS:=+lua \
+        +luasec
+endef
+
+define Package/lua-cs-bouncer/description
+  Lua module to allow ip (or not) from CrowdSec API.
+endef
+
+define Build/Compile
+endef
+
+define Package/lua-cs-bouncer/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/crowdsec
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/lib/*.lua \
+               $(1)/usr/lib/lua/crowdsec/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/template.conf \
+               $(1)/usr/lib/lua/crowdsec/crowdsec.conf
+
+       $(INSTALL_DIR) $(1)/usr/lib/crowdsec/lua/plugins/crowdsec
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/nginx/config.lua \
+               $(1)/usr/lib/crowdsec/lua/plugins/crowdsec/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/nginx/crowdsec.lua \
+               $(1)/usr/lib/crowdsec/lua/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/nginx/recaptcha.lua \
+               $(1)/usr/lib/crowdsec/lua/
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/nginx/access.lua \
+               $(1)/usr/lib/crowdsec/lua/
+
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) \
+               ./files/lua-cs-bouncer.defaults \
+               $(1)/etc/uci-defaults/99_lua-cs-bouncer
+endef
+
+define Package/lua-cs-bouncer/conffiles
+/usr/lib/lua/crowdsec/crowdsec.conf
+endef
+
+$(eval $(call BuildPackage,lua-cs-bouncer))
diff --git a/lang/lua/lua-cs-bouncer/files/lua-cs-bouncer.defaults b/lang/lua/lua-cs-bouncer/files/lua-cs-bouncer.defaults
new file mode 100644 (file)
index 0000000..12e4a99
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+CONFIG=/usr/lib/lua/crowdsec/crowdsec.conf
+## Gen&ConfigApiKey
+if grep -q "{API_KEY}" "$CONFIG"; then
+       SUFFIX=`tr -dc A-Za-z0-9 </dev/urandom | head -c 8`
+       API_KEY=`/usr/bin/cscli bouncers add lua-cs-bouncer-${SUFFIX} -o raw`
+       sed -i "s,^\(\s*API_KEY\s*=\s*\).*\$,\1$API_KEY," $CONFIG
+else
+       echo API key already registered...
+fi
+
+exit 0
diff --git a/lang/lua/lua-curl-v3/Makefile b/lang/lua/lua-curl-v3/Makefile
new file mode 100644 (file)
index 0000000..0d474a7
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2021 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-curl-v3
+PKG_VERSION:=0.3.13~9f8b6dba8
+PKG_RELEASE:=2
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_URL:=https://github.com/Lua-cURL/Lua-cURLv3.git
+PKG_MIRROR_HASH:=41f9e418b203fe3bdf256e4a5517ac8dbaf5ab5026b972f603052a0c56dfcfc7
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9f8b6dba8b5ef1b26309a571ae75cda4034279e5
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-curl-v3
+    SUBMENU:=Lua
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=Lua-curl
+    DEPENDS:=+libcurl +lua
+    MAINTAINER:=Rainer Poisel <[email protected]>
+endef
+
+MAKE_FLAGS += \
+       UNAME="Linux"
+
+define Package/lua-curl-v3/description
+       Lua bindings to libcurl (Lua-cURLv3)
+endef
+
+define Package/lua-curl-v3/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lcurl.so $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/src/lua/* $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-curl-v3))
+
diff --git a/lang/lua/lua-eco/Makefile b/lang/lua/lua-eco/Makefile
new file mode 100644 (file)
index 0000000..f82953e
--- /dev/null
@@ -0,0 +1,245 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-eco
+PKG_VERSION:=3.13.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION)
+PKG_HASH:=7629312a5946774f2fa8372d46e8aa3e06a651a73a343addf0eb8aea4413cad9
+
+PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_CONFIG_DEPENDS:= \
+       LUA_ECO_OPENSSL \
+       LUA_ECO_WOLFSSL \
+       LUA_ECO_MBEDTLS
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-eco
+  TITLE:=A Lua interpreter with a built-in libev event loop
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Lua
+  URL:=https://github.com/zhaojh329/lua-eco
+  DEPENDS:=+libev +liblua5.4
+endef
+
+define Package/lua-eco/description
+  Lua-eco is a Lua interpreter with a built-in event loop for scheduling
+  lightweight coroutines automatically, enabling efficient concurrency in
+  Lua. Build high-performance, scalable applications.
+endef
+
+define Package/lua-eco/Module
+  TITLE:=$1 support for lua-eco
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Lua
+  URL:=https://github.com/zhaojh329/lua-eco
+  DEPENDS:=+lua-eco $2
+endef
+
+Package/lua-eco-log=$(call Package/lua-eco/Module,log utils)
+Package/lua-eco-base64=$(call Package/lua-eco/Module,base64)
+Package/lua-eco-sha1=$(call Package/lua-eco/Module,sha1)
+Package/lua-eco-sha256=$(call Package/lua-eco/Module,sha256)
+Package/lua-eco-md5=$(call Package/lua-eco/Module,md5)
+Package/lua-eco-hmac=$(call Package/lua-eco/Module,hmac)
+Package/lua-eco-socket=$(call Package/lua-eco/Module,socket)
+Package/lua-eco-dns=$(call Package/lua-eco/Module,dns,+lua-eco-socket)
+Package/lua-eco-ssl=$(call Package/lua-eco/Module,ssl,\
+  +LUA_ECO_OPENSSL:libopenssl +LUA_ECO_WOLFSSL:libwolfssl \
+  +LUA_ECO_MBEDTLS:libmbedtls +LUA_ECO_MBEDTLS:zlib +lua-eco-socket)
+Package/lua-eco-ubus=$(call Package/lua-eco/Module,ubus,+libubus)
+Package/lua-eco-http=$(call Package/lua-eco/Module,http/https,+lua-eco-dns +lua-eco-ssl +lua-eco-base64 +lua-eco-log)
+Package/lua-eco-mqtt=$(call Package/lua-eco/Module,mqtt,+lua-eco-socket +lua-eco-ssl)
+Package/lua-eco-websocket=$(call Package/lua-eco/Module,websocket,+lua-eco-http +lua-eco-base64 +lua-eco-sha1)
+Package/lua-eco-termios=$(call Package/lua-eco/Module,termios)
+Package/lua-eco-netlink=$(call Package/lua-eco/Module,netlink,+lua-eco-socket)
+Package/lua-eco-ip=$(call Package/lua-eco/Module,ip utils,+lua-eco-netlink)
+Package/lua-eco-nl80211=$(call Package/lua-eco/Module,nl80211,+lua-eco-netlink)
+Package/lua-eco-ssh=$(call Package/lua-eco/Module,ssh,+lua-eco-socket +libssh2)
+Package/lua-eco-packet=$(call Package/lua-eco/Module,packet,+lua-eco-nl80211)
+Package/lua-eco-uci=$(call Package/lua-eco/Module,uci,+libuci)
+Package/lua-eco-shared=$(call Package/lua-eco/Module,shared,+lua-eco-socket)
+
+define Package/lua-eco-ssl/config
+       choice
+               prompt "SSL Library"
+               default LUA_ECO_MBEDTLS
+
+               config LUA_ECO_OPENSSL
+                       bool "OpenSSL"
+
+               config LUA_ECO_WOLFSSL
+                       bool "wolfSSL"
+
+               config LUA_ECO_MBEDTLS
+                       bool "mbedTLS"
+       endchoice
+endef
+
+CMAKE_OPTIONS += \
+  -DECO_UBUS_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ubus),N,FF) \
+  -DECO_SSL_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ssl),N,FF)
+
+ifneq ($(CONFIG_PACKAGE_lua-eco-ssl),)
+  ifneq ($(CONFIG_LUA_ECO_OPENSSL),)
+    CMAKE_OPTIONS += -DUSE_OPENSSL=ON
+  else ifneq ($(CONFIG_LUA_ECO_WOLFSSL),)
+    CMAKE_OPTIONS += -DUSE_WOLFSSL=ON
+  else ifneq ($(CONFIG_LUA_ECO_MBEDTLS),)
+    CMAKE_OPTIONS += -DUSE_MBEDTLS=ON
+  endif
+endif
+
+define Package/lua-eco/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/local/lib/lua/5.4/eco/core \
+               $(1)/usr/lib $(1)/usr/local/lib/lua/5.4/eco/encoding
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/eco $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/libeco.so* $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bufio.so $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hex.lua $(1)/usr/local/lib/lua/5.4/eco/encoding
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/{time,bufio,sys,file}.so $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/{time,sys,file,sync,channel}.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-log/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/log.so $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-base64/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/encoding
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/base64.so $(1)/usr/local/lib/lua/5.4/eco/encoding
+endef
+
+define Package/lua-eco-sha1/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sha1.so $(1)/usr/local/lib/lua/5.4/eco/hash
+endef
+
+define Package/lua-eco-sha256/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sha256.so $(1)/usr/local/lib/lua/5.4/eco/hash
+endef
+
+define Package/lua-eco-md5/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/md5.so $(1)/usr/local/lib/lua/5.4/eco/hash
+endef
+
+define Package/lua-eco-hmac/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/hash
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/local/lib/lua/5.4/eco/hash
+endef
+
+define Package/lua-eco-socket/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/socket.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/socket.so $(1)/usr/local/lib/lua/5.4/eco/core
+endef
+
+define Package/lua-eco-dns/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/dns.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-ssl/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ssl.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssl.so $(1)/usr/local/lib/lua/5.4/eco/core
+endef
+
+define Package/lua-eco-ubus/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ubus.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ubus.so $(1)/usr/local/lib/lua/5.4/eco/core
+endef
+
+define Package/lua-eco-http/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/http
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/http/*.lua $(1)/usr/local/lib/lua/5.4/eco/http
+endef
+
+define Package/lua-eco-mqtt/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/mqtt.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-websocket/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/websocket.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-termios/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/termios.so $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-netlink/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/{nl,genl}.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/{nl,genl}.so $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/rtnl.so $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-ip/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ip.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-nl80211/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/nl80211.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/nl80211.so $(1)/usr/local/lib/lua/5.4/eco/core
+endef
+
+define Package/lua-eco-ssh/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco/core
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/ssh.lua $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssh.so $(1)/usr/local/lib/lua/5.4/eco/core
+endef
+
+define Package/lua-eco-packet/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/packet.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-uci/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/uci.so $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+define Package/lua-eco-shared/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4/eco
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/shared.lua $(1)/usr/local/lib/lua/5.4/eco
+endef
+
+$(eval $(call BuildPackage,lua-eco))
+$(eval $(call BuildPackage,lua-eco-log))
+$(eval $(call BuildPackage,lua-eco-base64))
+$(eval $(call BuildPackage,lua-eco-sha1))
+$(eval $(call BuildPackage,lua-eco-sha256))
+$(eval $(call BuildPackage,lua-eco-md5))
+$(eval $(call BuildPackage,lua-eco-hmac))
+$(eval $(call BuildPackage,lua-eco-socket))
+$(eval $(call BuildPackage,lua-eco-dns))
+$(eval $(call BuildPackage,lua-eco-ssl))
+$(eval $(call BuildPackage,lua-eco-ubus))
+$(eval $(call BuildPackage,lua-eco-http))
+$(eval $(call BuildPackage,lua-eco-mqtt))
+$(eval $(call BuildPackage,lua-eco-websocket))
+$(eval $(call BuildPackage,lua-eco-termios))
+$(eval $(call BuildPackage,lua-eco-netlink))
+$(eval $(call BuildPackage,lua-eco-ip))
+$(eval $(call BuildPackage,lua-eco-nl80211))
+$(eval $(call BuildPackage,lua-eco-ssh))
+$(eval $(call BuildPackage,lua-eco-packet))
+$(eval $(call BuildPackage,lua-eco-uci))
+$(eval $(call BuildPackage,lua-eco-shared))
diff --git a/lang/lua/lua-ev/Makefile b/lang/lua/lua-ev/Makefile
new file mode 100644 (file)
index 0000000..7a6a3fb
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2019 Jianhui Zhao
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-ev
+PKG_VERSION:=1.5
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/brimworks/lua-ev/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=26ac116722a241bf59daf5315ce0ffe751c1babea9a146ffc0a389f1af3facca
+
+PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-ev
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=lua-ev
+  URL:=https://github.com/brimworks/lua-ev
+  DEPENDS:=+lua +libev
+endef
+
+define Package/lua-ev/description
+  Lua integration with libev.
+endef
+
+define Package/lua-ev/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/lua/cmod/ev.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-ev))
diff --git a/lang/lua/lua-ffi/Makefile b/lang/lua/lua-ffi/Makefile
new file mode 100644 (file)
index 0000000..3edf4d4
--- /dev/null
@@ -0,0 +1,84 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-ffi
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL=https://github.com/zhaojh329/lua-ffi/releases/download/v$(PKG_VERSION)
+PKG_HASH:=85651aa772de5717b85fc6ac9bba61f0dc20155707fad8099245f97ecd301996
+
+PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-ffi/default
+  TITLE:=A portable lightweight C FFI for $(1), based on libffi
+  CATEGORY:=Languages
+  SECTION:=lang
+  SUBMENU:=Lua
+  DEPENDS:=+libffi
+  URL:=https://github.com/zhaojh329/lua-ffi
+endef
+
+define Package/lua-ffi/default/description
+  Lua-ffi is a portable lightweight C FFI for Lua, based on libffi
+  and aiming to be mostly compatible with LuaJIT FFI, but written
+  from scratch in C language.
+endef
+
+define Package/lua-ffi
+  $(call Package/lua-ffi/default,lua5.1)
+  DEPENDS+=+liblua
+  VARIANT:=lua51
+endef
+
+define Package/lua-ffi-lua5.3
+  $(call Package/lua-ffi/default,lua5.3)
+  DEPENDS+=+liblua5.3
+  VARIANT:=lua53
+endef
+
+define Package/lua-ffi-lua5.4
+  $(call Package/lua-ffi/default,lua5.4)
+  DEPENDS+=+liblua5.4
+  VARIANT:=lua54
+endef
+
+Package/lua-ffi/description = $(Package/lua-ffi/default/description)
+Package/lua-ffi-lua5.3/description = $(Package/lua-ffi/default/description)
+Package/lua-ffi-lua5.4/description = $(Package/lua-ffi/default/description)
+
+ifeq ($(BUILD_VARIANT),lua51)
+  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include"
+endif
+
+ifeq ($(BUILD_VARIANT),lua53)
+  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include/lua5.3"
+endif
+
+ifeq ($(BUILD_VARIANT),lua54)
+  CMAKE_OPTIONS += -DLUA_INCLUDE_DIR="$(STAGING_DIR)/usr/include/lua5.4"
+endif
+
+define Package/lua-ffi/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/lib/lua
+endef
+
+define Package/lua-ffi-lua5.3/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/local/lib/lua/5.3
+endef
+
+define Package/lua-ffi-lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ffi.so $(1)/usr/local/lib/lua/5.4
+endef
+
+$(eval $(call BuildPackage,lua-ffi))
+$(eval $(call BuildPackage,lua-ffi-lua5.3))
+$(eval $(call BuildPackage,lua-ffi-lua5.4))
diff --git a/lang/lua/lua-libmodbus/Makefile b/lang/lua/lua-libmodbus/Makefile
new file mode 100644 (file)
index 0000000..0527567
--- /dev/null
@@ -0,0 +1,40 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-libmodbus
+PKG_VERSION:=0.7
+PKG_RELEASE:=1
+
+PKG_SOURCE:=lua-libmodbus-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=lua-libmodbus-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://codeload.github.com/etactica/lua-libmodbus/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=70369f4c4e36421095bf00dcee36c633b4284eaa79bcfdfd230bfefb27acefda
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+PKG_MAINTAINER:=Karl Palsson <[email protected]>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-libmodbus
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=lua-libmodbus
+  URL:=https://github.com/etactica/lua-libmodbus
+  DEPENDS:=+liblua +libmodbus
+endef
+
+define Package/lua-libmodbus/description
+       lua-libmodbus is a binding to libmodbus,
+       see also http://www.libmodbus.org
+endef
+
+define Build/Configure
+endef
+
+define Package/lua-libmodbus/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/libmodbus.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-libmodbus))
diff --git a/lang/lua/lua-lsqlite3/Makefile b/lang/lua/lua-lsqlite3/Makefile
new file mode 100644 (file)
index 0000000..7a31424
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lsqlite3
+PKG_VERSION:=0.9.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=lsqlite3_fsl09y.zip
+PKG_SOURCE_URL:=http://lua.sqlite.org/index.cgi/zip/
+PKG_HASH:=d38402aa7640055d260c1246c36e6d6d31b425a25a805431f13695694466b722
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Oskari Rauta <[email protected]>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/lsqlite3-$(BUILD_VARIANT)/$(basename $(PKG_SOURCE))
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lsqlite3/default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua wrapper for the SQLite3 library
+  URL:=http://lua.sqlite.org
+  DEPENDS:=+libsqlite3
+endef
+
+define Package/lsqlite3
+  $(Package/lsqlite3/default)
+  DEPENDS+=+liblua
+  VARIANT:=lua-51
+endef
+
+define Package/lsqlite3-lua5.3
+  $(Package/lsqlite3/default)
+  DEPENDS+=+liblua5.3
+  VARIANT:=lua-53
+endef
+
+define Package/lsqlite3/default/description
+ LuaSQLite3 is a thin wrapper around the public domain SQLite3 database engine.
+endef
+
+Package/lsqlite3/description = $(Package/lsqlite3/default/description)
+Package/lsqlite3-lua5.3/description = $(Package/lsqlite3/default/description)
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
+TARGET_LDFLAGS += -lsqlite3 -lpthread
+
+ifeq ($(BUILD_VARIANT),lua-53)
+  TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/lua5.3
+endif
+
+define Build/Compile
+       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
+               -c $(PKG_BUILD_DIR)/lsqlite3.c \
+               -o $(PKG_BUILD_DIR)/lsqlite3.o \
+               -DLSQLITE_VERSION=\"$(PKG_VERSION)\"
+       $(TARGET_CC) $(TARGET_LDFLAGS) -shared \
+               $(PKG_BUILD_DIR)/lsqlite3.o \
+               -o $(PKG_BUILD_DIR)/lsqlite3.so
+endef
+
+define Package/lsqlite3/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/lua/
+endef
+
+define Package/lsqlite3-lua5.3/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
+       $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/local/lib/lua/5.3
+endef
+
+$(eval $(call BuildPackage,lsqlite3))
+$(eval $(call BuildPackage,lsqlite3-lua5.3))
diff --git a/lang/lua/lua-lzlib/Makefile b/lang/lua/lua-lzlib/Makefile
new file mode 100644 (file)
index 0000000..bf84a51
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-lzlib
+PKG_VERSION:=0.4.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
+PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-lzlib
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua zlib binding
+  URL:=http://github.com/LuaDist/lzlib
+  DEPENDS:= +lua +zlib
+endef
+
+define Package/lua-lzlib/description
+       A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package. 
+endef
+
+MAKE_FLAGS += \
+       LUA="$(STAGING_DIR)/usr" \
+       OFLAGS="$(TARGET_CFLAGS)" \
+
+define Package/lua-lzlib/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-lzlib))
diff --git a/lang/lua/lua-lzlib/patches/001-allow_optim_flags.patch b/lang/lua/lua-lzlib/patches/001-allow_optim_flags.patch
new file mode 100644 (file)
index 0000000..78f981d
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -14,7 +14,8 @@ LUABIN= $(LUA)/bin
+ ZLIB=../zlib-1.2.3
+ # no need to change anything below here
+-CFLAGS= $(INCS) $(DEFS) $(WARN) -O0 -fPIC
++CFLAGS= $(INCS) $(DEFS) $(WARN) $(OFLAGS) -fPIC
++OFLAGS= -O0
+ WARN= -g -Werror -Wall -pedantic #-ansi
+ INCS= -I$(LUAINC) -I$(ZLIB)
+ LIBS= -L$(ZLIB) -lz -L$(LUALIB) -L$(LUABIN) #-llua51
diff --git a/lang/lua/lua-md5/Makefile b/lang/lua/lua-md5/Makefile
new file mode 100644 (file)
index 0000000..f4bb3e1
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-md5
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=675b8ba144d14cbe66abfd360d9a8861a18d5b69966768d6cdc78ca3c9fe0baf
+PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=2a98633d7587a4900cfa7cbed340f377f4acd930
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-md5
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MD5
+  URL:=https://github.com/keplerproject/md5
+  DEPENDS:=+lua
+endef
+
+define Package/lua-md5/description
+  MD5 offers basic cryptographic facilities for Lua
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               clean
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               LIB_OPTION="-shared" \
+               CC="$(TARGET_CROSS)gcc" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               all
+endef
+
+define Build/Install
+       mkdir -p $(PKG_INSTALL_DIR)/usr/lib/lua
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-md5/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/md5
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
+endef
+
+$(eval $(call BuildPackage,lua-md5))
diff --git a/lang/lua/lua-md5/patches/config.patch b/lang/lua/lua-md5/patches/config.patch
new file mode 100644 (file)
index 0000000..4c95037
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/config
++++ b/config
+@@ -1,16 +1,16 @@
+ # Installation directories
+ # Default prefix
+-PREFIX = /usr/local
++PREFIX = /usr
+ # Lua version
+ LUA_SYS_VER ?= 5.2
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR= $(PREFIX)/lib/lua/$(LUA_SYS_VER)
++LUA_LIBDIR= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR= $(PREFIX)/share/lua/$(LUA_SYS_VER)
++LUA_DIR= $(PREFIX)/share/lua
+ # Lua includes directory
+ LUA_INC= $(PREFIX)/include
diff --git a/lang/lua/lua-md5/patches/makefile.patch b/lang/lua/lua-md5/patches/makefile.patch
new file mode 100644 (file)
index 0000000..0f0f709
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ # $Id: Makefile,v 1.7 2007/10/11 00:02:56 carregal Exp $
+-CONFIG= ./config
++CFLAGS+= -fPIC
+ include $(CONFIG)
diff --git a/lang/lua/lua-mobdebug/Makefile b/lang/lua/lua-mobdebug/Makefile
new file mode 100644 (file)
index 0000000..b1c387d
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-mobdebug
+PKG_VERSION:=0.70
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/pkulchenko/MobDebug/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=35ec131a0ecc74dbe1cc50582ed977120a4ef6d9f815ce07367fdb945cfee370
+PKG_BUILD_DIR:=$(BUILD_DIR)/MobDebug-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-mobdebug
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MobDebug
+  URL:=https://github.com/pkulchenko/MobDebug
+  DEPENDS:=+lua
+  PKGARCH:=all
+endef
+
+define Package/lua-mobdebug/description
+  MobDebug is a remote debugger for Lua (including Lua 5.1, Lua 5.2, Lua 5.3, and LuaJIT 2.x).
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lua-mobdebug/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/mobdebug.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-mobdebug))
diff --git a/lang/lua/lua-mosquitto/Makefile b/lang/lua/lua-mosquitto/Makefile
new file mode 100644 (file)
index 0000000..4e0aaac
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2013-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-mosquitto
+PKG_VERSION:=0.4.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=d6bc828ea05f9a1ff3241f575a6ce699e577f9b79277182699e8fa03ac094ac9
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-mosquitto
+    SUBMENU:=Lua
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=Lua-mosquitto
+    DEPENDS:=+libmosquitto +lua
+    MAINTAINER:=Karl Palsson <[email protected]>
+endef
+
+define Package/lua-mosquitto/description
+       Lua bindings to libmosquitto
+endef
+
+define Package/lua-mosquitto/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-mosquitto))
diff --git a/lang/lua/lua-openssl/Makefile b/lang/lua/lua-openssl/Makefile
new file mode 100644 (file)
index 0000000..ddacdef
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2016 Amnon Paz <[email protected]>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-openssl
+PKG_SOURCE_VERSION:=0.10.0-0
+PKG_VERSION:=$(subst -,.,$(PKG_SOURCE_VERSION))
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
+PKG_MIRROR_HASH:=e3c6173321132e2ce69cdedd8638acdc970a3fb1c0c3677d4edd9fe39e84853f
+
+PKG_MAINTAINER:=Amnon Paz <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-openssl
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua openSSL binding
+  URL:=http://github.com/zhaozg/lua-openssl
+  DEPENDS:=+lua +libopenssl +librt
+endef
+
+define Package/lua-openssl/description
+    A free, MIT-licensed OpenSSL binding for Lua.
+endef
+
+define Package/lua-openssl/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/openssl.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-openssl))
diff --git a/lang/lua/lua-openssl/patches/010-no-luajit.patch b/lang/lua/lua-openssl/patches/010-no-luajit.patch
new file mode 100644 (file)
index 0000000..5530968
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,10 +12,7 @@ endif()
+ include(GNUInstallDirs)
+-find_package(LuaJIT)
+-if(NOT LUAJIT_FOUND)
+-    find_package(Lua REQUIRED)
+-endif()
++find_package(Lua REQUIRED)
+ find_package(OpenSSL REQUIRED)
+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
diff --git a/lang/lua/lua-penlight/Makefile b/lang/lua/lua-penlight/Makefile
new file mode 100644 (file)
index 0000000..34d96e6
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-penlight
+PKG_VERSION:=1.13.1
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/lunarmodules/Penlight/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=530380e1a377df519c2e589f47823f79701f8e0e67f6bbd994e18d09a470b680
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.md
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-penlight
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Penlight
+  URL:=http://lunarmodules.github.io/Penlight/manual/01-introduction.md.html
+  DEPENDS:=+luafilesystem
+  MAINTAINER:=Karl Palsson <[email protected]>
+endef
+
+define Package/lua-penlight/description
+  It is often said of Lua that it does not include batteries.
+  Penlight is the batteries.
+endef
+
+define Build/Compile
+       echo "Nothing to compile, pure lua package"
+endef
+
+define Package/lua-penlight/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/lua/pl $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-penlight))
diff --git a/lang/lua/lua-rings/Makefile b/lang/lua/lua-rings/Makefile
new file mode 100644 (file)
index 0000000..53fe67b
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-rings
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7026ce5898d37a4175b7afad693d59ff1fff1a84adafcabfafd065956a03616c
+PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rings
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Rings
+  URL:=http://keplerproject.github.io/rings/
+  DEPENDS:=+lua
+endef
+
+define Package/lua-rings/description
+  Rings is a library which provides a way to create new Lua states from within Lua.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Package/lua-rings/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rings.so $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/stable.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-rings))
diff --git a/lang/lua/lua-rings/patches/config.patch b/lang/lua/lua-rings/patches/config.patch
new file mode 100644 (file)
index 0000000..0551378
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/config
++++ b/config
+@@ -1,15 +1,15 @@
+ # Installation directories
+ # Default prefix
+-PREFIX ?= /usr/local
++PREFIX ?= /usr
+ DESTDIR ?= /
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR ?= $(PREFIX)/lib/lua/5.1
++LUA_LIBDIR ?= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR ?= $(PREFIX)/share/lua/5.1
++LUA_DIR ?= $(PREFIX)/lib/lua
+ # Lua includes directory
+ LUA_INC ?= $(PREFIX)/include
+@@ -24,6 +24,5 @@ LIBNAME ?= $T.so.$V
+ WARN ?= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith -pedantic
+ INCS ?= -I$(LUA_INC)
+ CFLAGS ?= $(WARN) $(INCS)
+-CC ?= gcc
+ # $Id: config,v 1.7 2007/10/29 22:51:39 carregal Exp $
diff --git a/lang/lua/lua-rings/patches/makefile.patch b/lang/lua/lua-rings/patches/makefile.patch
new file mode 100644 (file)
index 0000000..d639ef9
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -3,6 +3,8 @@
+ T= rings
+ CONFIG= ./config
++CFLAGS+= -fPIC
++
+ include $(CONFIG)
+ SRCS= src/rings.c
diff --git a/lang/lua/lua-rs232/Makefile b/lang/lua/lua-rs232/Makefile
new file mode 100644 (file)
index 0000000..925ee69
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-rs232
+PKG_SOURCE_DATE:=2019-11-20
+PKG_SOURCE_VERSION:=c106c94d1a5a84e8582c936528303528608776c2
+PKG_RELEASE:=3
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/srdgame/librs232
+PKG_MIRROR_HASH:=d507ce004a9b02b8d8a31d0c348eb9c481f1030153c941131aeff0dd3046a419
+
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=lua/host
+PKG_BUILD_FLAGS:=gc-sections
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rs232
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua Serial Library
+  URL:=https://github.com/srdgame/librs232
+  DEPENDS:= +lua
+endef
+
+define Package/lua-rs232/description
+  multiplatform library for serial communications over RS-232
+endef
+
+TARGET_LDFLAGS += -Wl,--as-needed
+MAKE_FLAGS += luadir='$$$${prefix}/lib/lua' luaexecdir='$$$${exec_prefix}/lib/lua'
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/librs232
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/librs232/rs232* $(1)/usr/include/librs232
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librs232.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/lua-rs232/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-rs232))
diff --git a/lang/lua/lua-rs232/patches/010-gcc13.patch b/lang/lua/lua-rs232/patches/010-gcc13.patch
new file mode 100644 (file)
index 0000000..32da137
--- /dev/null
@@ -0,0 +1,56 @@
+From 3467c3c354263b066ad47bddfe6eb869c0111e0d Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <[email protected]>
+Date: Tue, 24 Jan 2023 10:19:16 +0100
+Subject: [PATCH] Fix rs232_set_* prototypes mismatch
+
+Fixes compilation error on gcc 13 (excerpt):
+ rs232_posix.c:490:1: error: conflicting types for 'rs232_set_baud' \
+   due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
+   enum rs232_baud_e)' [-Werror=enum-int-mismatch]
+  490 | rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud)
+      | ^~~~~~~~~~~~~~
+ In file included from rs232_posix.c:39:
+ ../include/librs232/rs232.h:203:24: note: previous declaration of \
+   'rs232_set_baud' with type 'unsigned int(struct rs232_port_t *, unsigned int)'
+  203 | RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
+      |                        ^~~~~~~~~~~~~~
+
+ rs232_posix.c:591:1: error: conflicting types for 'rs232_set_dtr' \
+  due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
+  enum rs232_dtr_e)' [-Werror=enum-int-mismatch]
+  591 | rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state)
+      | ^~~~~~~~~~~~~
+ In file included from rs232_posix.c:39:
+  ../include/librs232/rs232.h:208:24: note: previous declaration of 'rs232_set_dtr' \
+  with type 'unsigned int(struct rs232_port_t *, unsigned int)'
+  208 | RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
+      |                        ^~~~~~~~~~~~~
+
+Signed-off-by: Damian Wrobel <[email protected]>
+---
+ include/librs232/rs232.h | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/include/librs232/rs232.h
++++ b/include/librs232/rs232.h
+@@ -200,13 +200,13 @@ RS232_LIB unsigned int rs232_port_open(s
+ RS232_LIB unsigned int rs232_close(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_flush(struct rs232_port_t *p);
+ RS232_LIB void rs232_set_device(struct rs232_port_t *p, const char *device);
+-RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
+-RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, unsigned int stop);
+-RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, unsigned int data);
+-RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, unsigned int parity);
+-RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, unsigned int flow);
+-RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
+-RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, unsigned int rts);
++RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud);
++RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, enum rs232_stop_e stop);
++RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, enum rs232_data_e data);
++RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, enum rs232_parity_e parity);
++RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, enum rs232_flow_e flow);
++RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state);
++RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, enum rs232_rts_e state);
+ RS232_LIB const char * rs232_get_device(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_get_baud(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_get_stop(struct rs232_port_t *p);
diff --git a/lang/lua/lua-rs232/patches/100-remove-build-timestamps.patch b/lang/lua/lua-rs232/patches/100-remove-build-timestamps.patch
new file mode 100644 (file)
index 0000000..4299cdf
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/bindings/lua/luars232.c
++++ b/bindings/lua/luars232.c
+@@ -31,7 +31,6 @@
+ #include "librs232/rs232.h"
+-#define MODULE_TIMESTAMP __DATE__ " " __TIME__
+ #define MODULE_NAMESPACE "luars232"
+ #define MODULE_VERSION "1.0.3"
+ #define MODULE_BUILD "$Id: luars232.c 15 2011-02-23 09:02:20Z sp $"
+@@ -553,9 +552,6 @@ RS232_LIB int luaopen_luars232(lua_State
+       lua_pushstring(L, MODULE_BUILD);
+       lua_setfield(L, -2, "_BUILD");
+-      lua_pushstring(L, MODULE_TIMESTAMP);
+-      lua_setfield(L, -2, "_TIMESTAMP");
+-
+       lua_pushstring(L, MODULE_COPYRIGHT);
+       lua_setfield(L, -2, "_COPYRIGHT");
diff --git a/lang/lua/lua-sha2/Makefile b/lang/lua/lua-sha2/Makefile
new file mode 100644 (file)
index 0000000..e76a5a2
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 20013-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-sha2
+PKG_VERSION:=0.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=79e65bd7cb1b8ef64e125c9e57f40b7d38678599587c1894ce57838814403945
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-sha2
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=Lua binding for Aaron Gifford's SHA-2 implementation
+       URL:=https://code.google.com/p/sha2/
+       MAINTAINER:=Lars Gierth <[email protected]>
+       DEPENDS:=+lua
+endef
+
+define Package/lua-sha2/description
+       Lua Binding for the SHA-2 (SHA-256/384/512) BSD-licensed C implementation by Aaron Gifford.
+       Also contains a HMAC implementation in Lua.
+endef
+
+TARGET_CFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
+TARGET_LDFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
+
+define Build/Configure
+endef
+
+define Package/lua-sha2/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/hmac
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/sha2.so $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/sha2.lua $(1)/usr/lib/lua/hmac
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/md5.lua $(1)/usr/lib/lua/hmac
+endef
+
+$(eval $(call BuildPackage,lua-sha2))
diff --git a/lang/lua/lua-sha2/patches/001-makefile.patch b/lang/lua/lua-sha2/patches/001-makefile.patch
new file mode 100644 (file)
index 0000000..e395044
--- /dev/null
@@ -0,0 +1,14 @@
+From: Lars Gierth <[email protected]>
+Date: Tue, 2 Sep 2014 00:05:39 +0200
+
+    Add rump Makefile
+
+new file mode 100644
+index 0000000..f081d38
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,4 @@
++all: sha2.o sha2lib.o
++      $(CC) -shared -o sha2.so sha2.o sha2lib.o
++
++.PHONY: all
diff --git a/lang/lua/lua-struct/Makefile b/lang/lua/lua-struct/Makefile
new file mode 100644 (file)
index 0000000..f24131f
--- /dev/null
@@ -0,0 +1,42 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-struct
+PKG_VERSION:=0.9.2
+PKG_RELEASE:=1
+
+PKG_VERSION_TAG:=$(PKG_VERSION)-1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION_TAG).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/iryont/$(PKG_NAME)/tar.gz/$(PKG_VERSION_TAG)?
+PKG_HASH:=30d4e3584e27caa504745fdf5e191f2469ae284dc51271292654856905a4603d
+
+PKG_MAINTAINER:=jasle <[email protected]>
+PKG_LICENSE:=MIT/X11
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION_TAG)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-struct
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Implementation of binary packing/unpacking in pure lua
+  URL:=https://github.com/iryont/lua-struct
+endef
+
+define Package/lua-struct/desription
+       lua-struct is a pure lua Implementation for packing and unpacking 
+       binary data. 
+endef
+
+define Build/Compile
+       echo "Nothing to compile, pure lua package"
+endef
+
+define Package/lua-struct/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/struct.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-struct))
+
diff --git a/lang/lua/lua-wsapi/Makefile b/lang/lua/lua-wsapi/Makefile
new file mode 100644 (file)
index 0000000..5a1c99b
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-wsapi
+PKG_VERSION:=1.7
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/wsapi/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=48dc7aba0fd2e96a3e5ef51045b5d923964f6ae299de761aa0467031ad44e987
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/wsapi-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-wsapi/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua WSAPI
+  URL:=https://keplerproject.github.io/wsapi/
+  DEPENDS:= +lua
+  PKGARCH:=all
+endef
+
+define Package/lua-wsapi/Default/description
+  WSAPI is an API that abstracts the web server from Lua web applications
+endef
+
+
+define Package/lua-wsapi-base
+$(call Package/lua-wsapi/Default)
+  TITLE+= base
+  DEPENDS+= +luafilesystem
+  VARIANT:=base
+endef
+
+define Package/lua-wsapi-base/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the basic stuff.
+endef
+
+define Package/lua-wsapi-xavante
+$(call Package/lua-wsapi/Default)
+  TITLE+= xavante
+  DEPENDS+= +lua-wsapi-base +lua-xavante
+  VARIANT:=xavante
+endef
+
+define Package/lua-wsapi-xavante/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the Xavante stuff.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-wsapi-base/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi.cgi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/{common,request,response,util,cgi,sapi,ringer,mock}.lua $(1)/usr/lib/lua/wsapi
+endef
+
+define Package/lua-wsapi-xavante/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/xavante.lua $(1)/usr/lib/lua/wsapi
+endef
+
+
+$(eval $(call BuildPackage,lua-wsapi-base))
+$(eval $(call BuildPackage,lua-wsapi-xavante))
diff --git a/lang/lua/lua-xavante/Makefile b/lang/lua/lua-xavante/Makefile
new file mode 100644 (file)
index 0000000..9b870aa
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-xavante
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/xavante/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=0e4f49dd96cb092cd5d80cc66a5204dcb22a14f80897a121f2f0d1dceb1c7ba5
+PKG_BUILD_DIR:=$(BUILD_DIR)/xavante-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-xavante
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Xavante Web Server
+  URL:=https://keplerproject.github.io/xavante/
+  DEPENDS:= +lua
+  PKGARCH:=all
+endef
+
+define Package/lua-xavante/description
+  Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture based on URI mapped handlers.
+endef
+
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-xavante/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/sajax/sajax.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/xavante.lua $(1)/usr/lib/lua
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/xavante
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/{cgiluahandler,encoding,filehandler,httpd,mime,patternhandler,redirecthandler,vhostshandler,indexhandler,urlhandler,ruleshandler}.lua $(1)/usr/lib/lua/xavante
+endef
+
+$(eval $(call BuildPackage,lua-xavante))
diff --git a/lang/lua/lua5.4/Makefile b/lang/lua/lua5.4/Makefile
new file mode 100644 (file)
index 0000000..3db0e30
--- /dev/null
@@ -0,0 +1,165 @@
+#
+# Copyright (C) 2006-2023 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua
+PKG_VERSION:=5.4.7
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.lua.org/ftp/ \
+       https://www.tecgraf.puc-rio.br/lua/ftp/
+PKG_HASH:=9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30
+PKG_BUILD_PARALLEL:=1
+
+PKG_MAINTAINER:=Christian Marangi <[email protected]>
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+PKG_CPE_ID:=cpe:/a:lua:lua
+
+HOST_PATCH_DIR := ./patches-host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/lua5.4/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua programming language (version 5.4)
+  URL:=https://www.lua.org/
+endef
+
+define Package/lua5.4/Default/description
+  Lua is a powerful, efficient, lightweight, embeddable scripting language. It
+  supports procedural programming, object-oriented programming, functional
+  programming, data-driven programming, and data description.
+endef
+
+define Package/liblua5.4
+$(call Package/lua5.4/Default)
+  SUBMENU:=
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (libraries)
+  ABI_VERSION:=5.4
+endef
+
+define Package/liblua5.4/description
+$(call Package/lua5.4/Default/description)
+ This package contains the Lua shared libraries, needed by other programs.
+endef
+
+define Package/lua5.4
+$(call Package/lua5.4/Default)
+  DEPENDS:=+liblua5.4
+  TITLE+= (interpreter)
+endef
+
+define Package/lua5.4/description
+$(call Package/lua5.4/Default/description)
+  This package contains the Lua language interpreter.
+endef
+
+define Package/luac5.4
+$(call Package/lua5.4/Default)
+  DEPENDS:=+liblua5.4
+  TITLE+= (compiler)
+endef
+
+define Package/luac5.4/description
+$(call Package/lua5.4/Default/description)
+  This package contains the Lua language compiler.
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       mv $(PKG_BUILD_DIR)/doc/lua.1 $(PKG_BUILD_DIR)/doc/lua5.4.1
+       mv $(PKG_BUILD_DIR)/doc/luac.1 $(PKG_BUILD_DIR)/doc/luac5.4.1
+endef
+
+TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
+
+define Build/Compile
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CC="$(TARGET_CROSS)gcc" \
+               AR="$(TARGET_CROSS)ar rcu" \
+               RANLIB="$(TARGET_CROSS)ranlib" \
+               INSTALL_ROOT=/usr \
+               CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+               PKG_VERSION=$(PKG_VERSION) \
+               linux
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+define Host/Prepare
+       $(call Host/Prepare/Default)
+       mv $(HOST_BUILD_DIR)/doc/lua.1 $(HOST_BUILD_DIR)/doc/lua5.4.1
+       mv $(HOST_BUILD_DIR)/doc/luac.1 $(HOST_BUILD_DIR)/doc/luac5.4.1
+endef
+
+define Host/Configure
+       $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
+endef
+
+ifeq ($(HOST_OS),Darwin)
+       LUA_OS:=macosx
+else
+       ifeq ($(HOST_OS),FreeBSD)
+               LUA_OS:=freebsd
+       else
+               LUA_OS:=linux
+       endif
+endif
+
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               CC="$(HOSTCC) $(HOST_FPIC) -std=gnu99" \
+               $(LUA_OS)
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/lua5.4 $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua{,lib,conf}.h $(1)/usr/include/lua5.4/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua.hpp $(1)/usr/include/lua5.4/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lauxlib.h $(1)/usr/include/lua5.4/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.{a,so*} $(1)/usr/lib/
+       $(LN) liblua5.4.so.0.0.0 $(1)/usr/lib/liblualib5.4.so
+endef
+
+define Package/liblua5.4/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.so* $(1)/usr/lib/
+endef
+
+define Package/lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.4 $(1)/usr/bin/
+endef
+
+define Package/luac5.4/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.4 $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,liblua5.4))
+$(eval $(call BuildPackage,lua5.4))
+$(eval $(call BuildPackage,luac5.4))
+$(eval $(call HostBuild))
diff --git a/lang/lua/lua5.4/patches-host/001-include-version-number.patch b/lang/lua/lua5.4/patches-host/001-include-version-number.patch
new file mode 100644 (file)
index 0000000..d3d8b94
--- /dev/null
@@ -0,0 +1,65 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <[email protected]>
+---
+
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ PLAT= guess
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+ INSTALL_TOP= /usr/local
+ 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_LMOD= $(INSTALL_TOP)/share/lua/$V
+@@ -39,10 +39,10 @@ RM= rm -f
+ 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.a
++TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+ V= 5.4
+@@ -52,7 +52,7 @@ R= $V.7
+ all:  $(PLAT)
+ $(PLATS) help test clean:
+-      @cd src && $(MAKE) $@
++      @cd src && $(MAKE) $@ V=$V
+ install: dummy
+       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -32,15 +32,15 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+-LUA_A=        liblua.a
++LUA_A=        liblua$V.a
+ 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)
diff --git a/lang/lua/lua5.4/patches-host/100-no_readline.patch b/lang/lua/lua5.4/patches-host/100-no_readline.patch
new file mode 100644 (file)
index 0000000..64567dd
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -126,7 +126,7 @@ c89:
+       @echo ''
+ FreeBSD NetBSD OpenBSD freebsd:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
+ generic: $(ALL)
+@@ -136,13 +136,13 @@ ios:
+ Linux linux:  linux-noreadline
+ linux-noreadline:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
+ linux-readline:
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
+ Darwin macos macosx:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
+ mingw:
+       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
diff --git a/lang/lua/lua5.4/patches/001-include-version-number.patch b/lang/lua/lua5.4/patches/001-include-version-number.patch
new file mode 100644 (file)
index 0000000..d3d8b94
--- /dev/null
@@ -0,0 +1,65 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <[email protected]>
+---
+
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ PLAT= guess
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+ INSTALL_TOP= /usr/local
+ 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_LMOD= $(INSTALL_TOP)/share/lua/$V
+@@ -39,10 +39,10 @@ RM= rm -f
+ 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.a
++TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+ V= 5.4
+@@ -52,7 +52,7 @@ R= $V.7
+ all:  $(PLAT)
+ $(PLATS) help test clean:
+-      @cd src && $(MAKE) $@
++      @cd src && $(MAKE) $@ V=$V
+ install: dummy
+       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -32,15 +32,15 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+-LUA_A=        liblua.a
++LUA_A=        liblua$V.a
+ 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)
diff --git a/lang/lua/lua5.4/patches/020-shared_liblua.patch b/lang/lua/lua5.4/patches/020-shared_liblua.patch
new file mode 100644 (file)
index 0000000..615cda1
--- /dev/null
@@ -0,0 +1,115 @@
+--- a/Makefile
++++ b/Makefile
+@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic
+ # What to install.
+ TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua$V.a
++TO_LIB= liblua$V.a liblua$V.so.0.0.0
+ TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+@@ -59,6 +59,9 @@ install: dummy
+       cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+       cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+       cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0.0
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so
+       cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ uninstall:
+--- a/src/ldebug.h
++++ b/src/ldebug.h
+@@ -36,7 +36,7 @@
+ #endif
+-LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
++LUA_API int luaG_getfuncline (const Proto *f, int pc);
+ LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
+                                                     StkId *pos);
+ LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
+--- a/src/lstring.h
++++ b/src/lstring.h
+@@ -50,7 +50,7 @@ LUAI_FUNC void luaS_init (lua_State *L);
+ LUAI_FUNC void luaS_remove (lua_State *L, TString *ts);
+ LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue);
+ LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
+-LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
++LUA_API TString *luaS_new (lua_State *L, const char *str);
+ LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l);
+--- a/src/lundump.h
++++ b/src/lundump.h
+@@ -29,7 +29,7 @@
+ LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
+ /* dump one chunk; from ldump.c */
+-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
++LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
+                          void* data, int strip);
+ #endif
+--- a/src/lzio.h
++++ b/src/lzio.h
+@@ -44,7 +44,7 @@ typedef struct Mbuffer {
+ #define luaZ_freebuffer(L, buff)      luaZ_resizebuffer(L, buff, 0)
+-LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
++LUA_API void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
+                                         void *data);
+ LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n);       /* read next n bytes */
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -33,6 +33,7 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+ LUA_A=        liblua$V.a
++LUA_SO=       liblua$V.so.0.0.0
+ 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)
+@@ -44,8 +45,9 @@ 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_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
+ ALL_A= $(LUA_A)
++ALL_SO= $(LUA_SO)
+ # Targets start here.
+ default: $(PLAT)
+@@ -56,14 +58,25 @@ o: $(ALL_O)
+ a:    $(ALL_A)
++so:   $(ALL_SO)
++
+ $(LUA_A): $(BASE_O)
+       $(AR) $@ $(BASE_O)
+       $(RANLIB) $@
+-$(LUA_T): $(LUA_O) $(LUA_A)
+-      $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++$(LUA_SO): $(CORE_O) $(LIB_O)
++      $(CC) -o $@ -Wl,-Bsymbolic-functions -shared -Wl,-soname="$@" $?
++      ln -fs $@ liblua$V.so.0.0
++      ln -fs $@ liblua$V.so.0
++      ln -fs $@ liblua$V.so
++
++$(LUA_T): $(LUA_O) $(LUA_SO)
++      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUA_O) $(LIBS)
++
++$(LUAC_T): $(LUAC_O) $(LUA_SO)
++      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUAC_O) $(LIBS)
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++$(LUAC_T)-host: $(LUAC_O) $(LUA_A)
+       $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ test:
diff --git a/lang/lua/lua5.4/patches/100-no_readline.patch b/lang/lua/lua5.4/patches/100-no_readline.patch
new file mode 100644 (file)
index 0000000..64567dd
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -126,7 +126,7 @@ c89:
+       @echo ''
+ FreeBSD NetBSD OpenBSD freebsd:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
+ generic: $(ALL)
+@@ -136,13 +136,13 @@ ios:
+ Linux linux:  linux-noreadline
+ linux-noreadline:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
+ linux-readline:
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
+ Darwin macos macosx:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
+ mingw:
+       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
diff --git a/lang/lua/luabitop/Makefile b/lang/lua/luabitop/Makefile
new file mode 100644 (file)
index 0000000..f9f7e17
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luabitop
+PKG_VERSION:=1.0.3
+PKG_RELEASE:=1
+
+_BASENAME:=LuaBitOp
+
+PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://bitop.luajit.org/download/
+PKG_HASH:=d514a3d2cefa76c8d11c1b9ec740d5fae316a9c9764e1e12ddea21e4982fab4b
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luabitop
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luabitop
+  URL:=http://bitop.luajit.org/
+  DEPENDS:=+liblua
+endef
+
+define Package/luabitop/description
+Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers.
+endef
+
+define Build/Configure
+endef
+
+
+TARGET_CFLAGS += $(FPIC) -DLUA_USE_LINUX -DLUA_NUMBER_DOUBLE
+
+define Build/Compile
+       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) -std=gnu99 $(FPIC) -DLUA_USE_LINUX -shared -o $(PKG_BUILD_DIR)/bit.so $(PKG_BUILD_DIR)/bit.c
+endef
+
+define Package/luabitop/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,luabitop))
diff --git a/lang/lua/luaexpat/Makefile b/lang/lua/luaexpat/Makefile
new file mode 100644 (file)
index 0000000..0894971
--- /dev/null
@@ -0,0 +1,61 @@
+# 
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luaexpat
+PKG_VERSION:=1.5.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/lunarmodules/luaexpat
+PKG_MIRROR_HASH:=d479e41ea28b71ede214754d0cde87e6582022fcdd3981c928b41491062835c8
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENCE
+PKG_CPE_ID:=cpe:/a:matthewwild:luaexpat
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luaexpat
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaExpat
+  URL:=http://matthewwild.co.uk/projects/luaexpat/
+  MAINTAINER:=W. Michael Petullo <[email protected]>
+  DEPENDS:=+lua +libexpat
+endef
+
+define Package/luaexpat/description
+  LuaExpat is a SAX XML parser based on the Expat library.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(CP) files/compat-5.1r5 $(PKG_BUILD_DIR)/compat-5.1r5
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       EXPAT_INC="-I$(STAGING_DIR)/usr/include/" \
+       LUA_INC="-I$(STAGING_DIR)/usr/include/" \
+       LUA_LIBDIR="$(STAGING_DIR)/usr/lib/" \
+       COMPAT_DIR="$(PKG_BUILD_DIR)/compat-5.1r5" \
+       LDFLAGS="-shared $(TARGET_LDFLAGS)" \
+       CC="$(TARGET_CC) $(TARGET_CFLAGS) $(FPIC) -std=c99" \
+       LD="$(TARGET_CROSS)ld -shared"
+endef
+
+define Package/luaexpat/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp.so $(1)/usr/lib/lua/lxp.so
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lxp
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/lxp
+endef
+
+$(eval $(call BuildPackage,luaexpat))
diff --git a/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.c b/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.c
new file mode 100644 (file)
index 0000000..6fdb8b7
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+** Compat-5.1
+** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
+** $Id: compat-5.1.c,v 1.13 2006/02/20 21:12:47 carregal Exp $
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include "lua.h"
+#include "lauxlib.h"
+#include "compat-5.1.h"
+
+static void getfield(lua_State *L, int idx, const char *name) {
+    const char *end = strchr(name, '.');
+    lua_pushvalue(L, idx);
+    while (end) {
+        lua_pushlstring(L, name, end - name);
+        lua_gettable(L, -2);
+        lua_remove(L, -2);
+        if (lua_isnil(L, -1)) return;
+        name = end+1;
+        end = strchr(name, '.');
+    }
+    lua_pushstring(L, name);
+    lua_gettable(L, -2);
+    lua_remove(L, -2);
+}
+
+static void setfield(lua_State *L, int idx, const char *name) {
+    const char *end = strchr(name, '.');
+    lua_pushvalue(L, idx);
+    while (end) {
+        lua_pushlstring(L, name, end - name);
+        lua_gettable(L, -2);
+        /* create table if not found */
+        if (lua_isnil(L, -1)) {
+            lua_pop(L, 1);
+            lua_newtable(L);
+            lua_pushlstring(L, name, end - name);
+            lua_pushvalue(L, -2);
+            lua_settable(L, -4);
+        }
+        lua_remove(L, -2);
+        name = end+1;
+        end = strchr(name, '.');
+    }
+    lua_pushstring(L, name);
+    lua_pushvalue(L, -3);
+    lua_settable(L, -3);
+    lua_pop(L, 2);
+}
+
+LUALIB_API void luaL_module(lua_State *L, const char *libname,
+                              const luaL_reg *l, int nup) {
+  if (libname) {
+    getfield(L, LUA_GLOBALSINDEX, libname);  /* check whether lib already exists */
+    if (lua_isnil(L, -1)) { 
+      int env, ns;
+      lua_pop(L, 1); /* get rid of nil */
+      lua_pushliteral(L, "require");
+      lua_gettable(L, LUA_GLOBALSINDEX); /* look for require */
+      lua_getfenv(L, -1); /* getfenv(require) */
+      lua_remove(L, -2); /* remove function require */
+      env = lua_gettop(L);
+
+      lua_newtable(L); /* create namespace for lib */
+      ns = lua_gettop(L);
+      getfield(L, env, "package.loaded"); /* get package.loaded table */
+      if (lua_isnil(L, -1)) { /* create package.loaded table */
+          lua_pop(L, 1); /* remove previous result */
+          lua_newtable(L);
+          lua_pushvalue(L, -1);
+          setfield(L, env, "package.loaded");
+      }
+      else if (!lua_istable(L, -1))
+        luaL_error(L, "name conflict for library `%s'", libname);
+      lua_pushstring(L, libname);
+      lua_pushvalue(L, ns); 
+      lua_settable(L, -3); /* package.loaded[libname] = ns */
+      lua_pop(L, 1); /* get rid of package.loaded table */
+      lua_pushvalue(L, ns); /* copy namespace */
+      setfield(L, LUA_GLOBALSINDEX, libname);
+      lua_remove (L, env); /* remove env */
+    }
+    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
+  }
+  for (; l->name; l++) {
+    int i;
+    lua_pushstring(L, l->name);
+    for (i=0; i<nup; i++)  /* copy upvalues to the top */
+      lua_pushvalue(L, -(nup+1));
+    lua_pushcclosure(L, l->func, nup);
+    lua_settable(L, -(nup+3));
+  }
+  lua_pop(L, nup);  /* remove upvalues */
+}
+
diff --git a/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.h b/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.h
new file mode 100644 (file)
index 0000000..97570d9
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+** Compat-5.1
+** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat/)
+** $Id: compat-5.1.h,v 1.8 2006/02/20 21:12:47 carregal Exp $
+*/
+
+#ifndef COMPAT_H
+
+LUALIB_API void luaL_module(lua_State *L, const char *libname,
+                                       const luaL_reg *l, int nup);
+#define luaL_openlib luaL_module
+
+#endif
diff --git a/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.lua b/lang/lua/luaexpat/files/compat-5.1r5/compat-5.1.lua
new file mode 100644 (file)
index 0000000..0938d56
--- /dev/null
@@ -0,0 +1,267 @@
+--
+-- Compat-5.1
+-- Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
+-- According to Lua 5.1
+-- $Id: compat-5.1.lua,v 1.22 2006/02/20 21:12:47 carregal Exp $
+--
+
+_COMPAT51 = "Compat-5.1 R5"
+
+local LUA_DIRSEP = '/'
+local LUA_OFSEP = '_'
+local OLD_LUA_OFSEP = ''
+local POF = 'luaopen_'
+local LUA_PATH_MARK = '?'
+local LUA_IGMARK = ':'
+
+local assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type = assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type
+local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub
+
+--
+-- avoid overwriting the package table if it's already there
+--
+package = package or {}
+local _PACKAGE = package
+
+package.path = LUA_PATH or os.getenv("LUA_PATH") or
+             ("./?.lua;" ..
+              "/usr/local/share/lua/5.0/?.lua;" ..
+              "/usr/local/share/lua/5.0/?/?.lua;" ..
+              "/usr/local/share/lua/5.0/?/init.lua" )
+package.cpath = LUA_CPATH or os.getenv("LUA_CPATH") or
+             "./?.so;" ..
+             "./l?.so;" ..
+             "/usr/local/lib/lua/5.0/?.so;" ..
+             "/usr/local/lib/lua/5.0/l?.so"
+
+--
+-- make sure require works with standard libraries
+--
+package.loaded = package.loaded or {}
+package.loaded.debug = debug
+package.loaded.string = string
+package.loaded.math = math
+package.loaded.io = io
+package.loaded.os = os
+package.loaded.table = table 
+package.loaded.base = _G
+package.loaded.coroutine = coroutine
+local _LOADED = package.loaded
+
+--
+-- avoid overwriting the package.preload table if it's already there
+--
+package.preload = package.preload or {}
+local _PRELOAD = package.preload
+
+
+--
+-- looks for a file `name' in given path
+--
+local function findfile (name, pname)
+       name = gsub (name, "%.", LUA_DIRSEP)
+       local path = _PACKAGE[pname]
+       assert (type(path) == "string", format ("package.%s must be a string", pname))
+       for c in gfind (path, "[^;]+") do
+               c = gsub (c, "%"..LUA_PATH_MARK, name)
+               local f = io.open (c)
+               if f then
+                       f:close ()
+                       return c
+               end
+       end
+       return nil -- not found
+end
+
+
+--
+-- check whether library is already loaded
+--
+local function loader_preload (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       assert (type(_PRELOAD) == "table", "`package.preload' must be a table")
+       return _PRELOAD[name]
+end
+
+
+--
+-- Lua library loader
+--
+local function loader_Lua (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local filename = findfile (name, "path")
+       if not filename then
+               return false
+       end
+       local f, err = loadfile (filename)
+       if not f then
+               error (format ("error loading module `%s' (%s)", name, err))
+       end
+       return f
+end
+
+
+local function mkfuncname (name)
+       name = gsub (name, "^.*%"..LUA_IGMARK, "")
+       name = gsub (name, "%.", LUA_OFSEP)
+       return POF..name
+end
+
+local function old_mkfuncname (name)
+       --name = gsub (name, "^.*%"..LUA_IGMARK, "")
+       name = gsub (name, "%.", OLD_LUA_OFSEP)
+       return POF..name
+end
+
+--
+-- C library loader
+--
+local function loader_C (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local filename = findfile (name, "cpath")
+       if not filename then
+               return false
+       end
+       local funcname = mkfuncname (name)
+       local f, err = loadlib (filename, funcname)
+       if not f then
+               funcname = old_mkfuncname (name)
+               f, err = loadlib (filename, funcname)
+               if not f then
+                       error (format ("error loading module `%s' (%s)", name, err))
+               end
+       end
+       return f
+end
+
+
+local function loader_Croot (name)
+       local p = gsub (name, "^([^.]*).-$", "%1")
+       if p == "" then
+               return
+       end
+       local filename = findfile (p, "cpath")
+       if not filename then
+               return
+       end
+       local funcname = mkfuncname (name)
+       local f, err, where = loadlib (filename, funcname)
+       if f then
+               return f
+       elseif where ~= "init" then
+               error (format ("error loading module `%s' (%s)", name, err))
+       end
+end
+
+-- create `loaders' table
+package.loaders = package.loaders or { loader_preload, loader_Lua, loader_C, loader_Croot, }
+local _LOADERS = package.loaders
+
+
+--
+-- iterate over available loaders
+--
+local function load (name, loaders)
+       -- iterate over available loaders
+       assert (type (loaders) == "table", "`package.loaders' must be a table")
+       for i, loader in ipairs (loaders) do
+               local f = loader (name)
+               if f then
+                       return f
+               end
+       end
+       error (format ("module `%s' not found", name))
+end
+
+-- sentinel
+local sentinel = function () end
+
+--
+-- new require
+--
+function _G.require (modname)
+       assert (type(modname) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local p = _LOADED[modname]
+       if p then -- is it there?
+               if p == sentinel then
+                       error (format ("loop or previous error loading module '%s'", modname))
+               end
+               return p -- package is already loaded
+       end
+       local init = load (modname, _LOADERS)
+       _LOADED[modname] = sentinel
+       local actual_arg = _G.arg
+       _G.arg = { modname }
+       local res = init (modname)
+       if res then
+               _LOADED[modname] = res
+       end
+       _G.arg = actual_arg
+       if _LOADED[modname] == sentinel then
+               _LOADED[modname] = true
+       end
+       return _LOADED[modname]
+end
+
+
+-- findtable
+local function findtable (t, f)
+       assert (type(f)=="string", "not a valid field name ("..tostring(f)..")")
+       local ff = f.."."
+       local ok, e, w = find (ff, '(.-)%.', 1)
+       while ok do
+               local nt = rawget (t, w)
+               if not nt then
+                       nt = {}
+                       t[w] = nt
+               elseif type(t) ~= "table" then
+                       return sub (f, e+1)
+               end
+               t = nt
+               ok, e, w = find (ff, '(.-)%.', e+1)
+       end
+       return t
+end
+
+--
+-- new package.seeall function
+--
+function _PACKAGE.seeall (module)
+       local t = type(module)
+       assert (t == "table", "bad argument #1 to package.seeall (table expected, got "..t..")")
+       local meta = getmetatable (module)
+       if not meta then
+               meta = {}
+               setmetatable (module, meta)
+       end
+       meta.__index = _G
+end
+
+
+--
+-- new module function
+--
+function _G.module (modname, ...)
+       local ns = _LOADED[modname]
+       if type(ns) ~= "table" then
+               ns = findtable (_G, modname)
+               if not ns then
+                       error (string.format ("name conflict for module '%s'", modname))
+               end
+               _LOADED[modname] = ns
+       end
+       if not ns._NAME then
+               ns._NAME = modname
+               ns._M = ns
+               ns._PACKAGE = gsub (modname, "[^.]*$", "")
+       end
+       setfenv (2, ns)
+       for i, f in ipairs (arg) do
+               f (ns)
+       end
+end
diff --git a/lang/lua/luafilesystem/Makefile b/lang/lua/luafilesystem/Makefile
new file mode 100644 (file)
index 0000000..a59f451
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2008-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luafilesystem
+PKG_VERSION:=1.8.0
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_MIRROR_HASH:=69c676dd811fc77e205b1b8064017536fade1be47e50ba785c243a5d7540cdf6
+PKG_SOURCE_URL:=https://github.com/keplerproject/luafilesystem.git
+PKG_SOURCE_VERSION:=v$(subst .,_,$(PKG_VERSION))
+PKG_SOURCE_PROTO:=git
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luafilesystem
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaFileSystem
+  URL:=http://keplerproject.github.com/luafilesystem/
+  MAINTAINER:=W. Michael Petullo <[email protected]>
+  DEPENDS:=+liblua
+endef
+
+define Package/luafilesystem/description
+ This package contains the LuaFileSystem library, a set of portable
+ functions for directory creation, listing and deletion and for file
+ locking.
+endef
+
+define Build/Configure
+endef
+
+TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS)
+
+TARGET_LDFLAGS += -llua
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \
+               LDFLAGS="$(TARGET_LDFLAGS)"
+       $(TARGET_CROSS)ar r $(PKG_BUILD_DIR)/src/luafilesystem.a $(PKG_BUILD_DIR)/src/lfs.o
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lfs.h $(STAGING_DIR)/usr/include
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(STAGING_DIR)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/luafilesystem.a $(STAGING_DIR)/usr/lib/lua
+endef
+
+define Package/luafilesystem/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(1)/usr/lib/lua/lfs.so
+endef
+
+$(eval $(call BuildPackage,luafilesystem))
diff --git a/lang/lua/luajit/Makefile b/lang/lua/luajit/Makefile
new file mode 100644 (file)
index 0000000..538db73
--- /dev/null
@@ -0,0 +1,98 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luajit
+PKG_VERSION:=2.1.0
+PKG_REAL_VERSION:=$(PKG_VERSION)-beta3
+PKG_RELEASE:=8
+
+PKG_SOURCE:=LuaJIT-$(PKG_REAL_VERSION).tar.gz
+PKG_SOURCE_URL:=https://luajit.org/download
+PKG_HASH:=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
+PKG_BUILD_DIR:=$(BUILD_DIR)/LuaJIT-$(PKG_REAL_VERSION)
+
+PKG_MAINTAINER:=Morteza Milani <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+PKG_CPE_ID:=cpe:/a:luajit:luajit
+
+PKG_BUILD_FLAGS:=no-mips16
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/luajit
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=LuaJIT
+ URL:=https://www.luajit.org
+ DEPENDS:=@HAS_LUAJIT_ARCH
+endef
+
+define Package/luajit/description
+ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
+endef
+
+define Package/luajit/config
+config HAS_LUAJIT_ARCH
+       bool
+       default y if i386||x86_64||arm||armeb||aarch64||powerpc||mips||mipsel||mips64
+endef
+
+ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
+  ifeq ($(CONFIG_ARCH_64BIT),)
+    HOST_BITS := -m32
+  endif
+endif
+
+define Build/Compile
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
+               CROSS="$(TARGET_CROSS)" \
+               DPREFIX=$(PKG_INSTALL_DIR)/usr \
+               PREFIX=/usr \
+               TARGET_SYS=Linux \
+               TARGET_CFLAGS="$(TARGET_CFLAGS)" \
+               BUILDMODE=dynamic
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DPREFIX=$(PKG_INSTALL_DIR)/usr \
+               PREFIX=/usr \
+               TARGET_SYS=Linux \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
+endef
+
+define Package/luajit/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(1)/usr/bin/$(PKG_NAME)
+endef
+
+define Host/Compile
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               TARGET_CFLAGS="$(HOST_CFLAGS)" \
+               TARGET_LDFLAGS="$(HOST_LDFLAGS)"
+endef
+
+define Host/Install
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               install
+       $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-$(PKG_REAL_VERSION) $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild,luajit))
+$(eval $(call BuildPackage,luajit))
diff --git a/lang/lua/luajit/patches/010-lua-path.patch b/lang/lua/luajit/patches/010-lua-path.patch
new file mode 100644 (file)
index 0000000..f752002
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -35,8 +35,8 @@
+ #ifndef LUA_LMULTILIB
+ #define LUA_LMULTILIB "lib"
+ #endif
+-#define LUA_LROOT     "/usr/local"
+-#define LUA_LUADIR    "/lua/5.1/"
++#define LUA_LROOT     "/usr"
++#define LUA_LUADIR    "/lua/"
+ #define LUA_LJDIR     "/luajit-2.1.0-beta3/"
+ #ifdef LUA_ROOT
diff --git a/lang/lua/luajit/patches/020-clang.patch b/lang/lua/luajit/patches/020-clang.patch
new file mode 100644 (file)
index 0000000..e0a5374
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -391,9 +391,6 @@
+ #endif
+ #endif
+ #elif !LJ_TARGET_PS3
+-#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
+-#error "Need at least GCC 4.3 or newer"
+-#endif
+ #endif
+ #endif
diff --git a/lang/lua/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch b/lang/lua/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch
new file mode 100644 (file)
index 0000000..70f664c
--- /dev/null
@@ -0,0 +1,26 @@
+commit 18c9cf7d3788a8f7408df45df92fc4ae3bcc0d80
+Author: Mike Pall <mike>
+Date:   Sat Jan 25 17:37:12 2020 +0100
+
+    Fix POSIX install with missing or incompatible ldconfig.
+
+--- a/Makefile
++++ b/Makefile
+@@ -75,7 +75,7 @@ SYMLINK= ln -sf
+ INSTALL_X= install -m 0755
+ INSTALL_F= install -m 0644
+ UNINSTALL= $(RM)
+-LDCONFIG= ldconfig -n
++LDCONFIG= ldconfig -n 2>/dev/null
+ SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
+             -e "s|^multilib=.*|multilib=$(MULTILIB)|"
+@@ -121,7 +121,7 @@ install: $(INSTALL_DEP)
+       $(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)
+       cd src && test -f $(FILE_SO) && \
+         $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \
+-        $(LDCONFIG) $(INSTALL_LIB) && \
++        ( $(LDCONFIG) $(INSTALL_LIB) || : ) && \
+         $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \
+         $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :
+       cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)
diff --git a/lang/lua/luajit/patches/040-softfloat-ppc.patch b/lang/lua/luajit/patches/040-softfloat-ppc.patch
new file mode 100644 (file)
index 0000000..c424b9e
--- /dev/null
@@ -0,0 +1,2742 @@
+From fd37da0d586c331b0008fbfd653a9659344fe76f Mon Sep 17 00:00:00 2001
+From: Mike Pall <mike>
+Date: Wed, 26 Jul 2017 09:52:19 +0200
+Subject: [PATCH] PPC: Add soft-float support to interpreter.
+
+Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
+Sponsored by Cisco Systems, Inc.
+---
+ src/host/buildvm_asm.c |    2 +-
+ src/lj_arch.h          |   29 +-
+ src/lj_ccall.c         |   38 +-
+ src/lj_ccall.h         |    4 +-
+ src/lj_ccallback.c     |   30 +-
+ src/lj_frame.h         |    2 +-
+ src/lj_ircall.h        |    2 +-
+ src/vm_ppc.dasc        | 1249 +++++++++++++++++++++++++++++++++-------
+ 8 files changed, 1101 insertions(+), 255 deletions(-)
+
+--- a/src/host/buildvm_asm.c
++++ b/src/host/buildvm_asm.c
+@@ -338,7 +338,7 @@ void emit_asm(BuildCtx *ctx)
+ #if !(LJ_TARGET_PS3 || LJ_TARGET_PSVITA)
+     fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX "progbits\n");
+ #endif
+-#if LJ_TARGET_PPC && !LJ_TARGET_PS3
++#if LJ_TARGET_PPC && !LJ_TARGET_PS3 && !LJ_ABI_SOFTFP
+     /* Hard-float ABI. */
+     fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n");
+ #endif
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -254,6 +254,29 @@
+ #else
+ #define LJ_ARCH_BITS          32
+ #define LJ_ARCH_NAME          "ppc"
++
++#if !defined(LJ_ARCH_HASFPU)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#define LJ_ARCH_HASFPU                0
++#else
++#define LJ_ARCH_HASFPU                1
++#endif
++#endif
++
++#if !defined(LJ_ABI_SOFTFP)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#define LJ_ABI_SOFTFP         1
++#else
++#define LJ_ABI_SOFTFP         0
++#endif
++#endif
++#endif
++
++#if LJ_ABI_SOFTFP
++#define LJ_ARCH_NOJIT         1  /* NYI */
++#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
++#else
++#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+ #endif
+ #define LJ_TARGET_PPC         1
+@@ -262,7 +285,6 @@
+ #define LJ_TARGET_MASKSHIFT   0
+ #define LJ_TARGET_MASKROT     1
+ #define LJ_TARGET_UNIFYROT    1       /* Want only IR_BROL. */
+-#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+ #if LJ_TARGET_CONSOLE
+ #define LJ_ARCH_PPC32ON64     1
+@@ -415,16 +437,13 @@
+ #error "No support for ILP32 model on ARM64"
+ #endif
+ #elif LJ_TARGET_PPC
+-#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
+-#error "No support for PowerPC CPUs without double-precision FPU"
+-#endif
+ #if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
+ #error "No support for little-endian PPC32"
+ #endif
+ #if LJ_ARCH_PPC64
+ #error "No support for PowerPC 64 bit mode (yet)"
+ #endif
+-#ifdef __NO_FPRS__
++#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
+ #error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
+ #endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_ccall.c
++++ b/src/lj_ccall.c
+@@ -387,6 +387,24 @@
+ #define CCALL_HANDLE_COMPLEXARG \
+   /* Pass complex by value in 2 or 4 GPRs. */
++#define CCALL_HANDLE_GPR \
++  /* Try to pass argument in GPRs. */ \
++  if (n > 1) { \
++    lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
++    if (ctype_isinteger(d->info) || ctype_isfp(d->info)) \
++      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
++    else if (ngpr + n > maxgpr) \
++      ngpr = maxgpr;  /* Prevent reordering. */ \
++  } \
++  if (ngpr + n <= maxgpr) { \
++    dp = &cc->gpr[ngpr]; \
++    ngpr += n; \
++    goto done; \
++  } \
++
++#if LJ_ABI_SOFTFP
++#define CCALL_HANDLE_REGARG  CCALL_HANDLE_GPR
++#else
+ #define CCALL_HANDLE_REGARG \
+   if (isfp) {  /* Try to pass argument in FPRs. */ \
+     if (nfpr + 1 <= CCALL_NARG_FPR) { \
+@@ -395,24 +413,16 @@
+       d = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */ \
+       goto done; \
+     } \
+-  } else {  /* Try to pass argument in GPRs. */ \
+-    if (n > 1) { \
+-      lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
+-      if (ctype_isinteger(d->info)) \
+-      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
+-      else if (ngpr + n > maxgpr) \
+-      ngpr = maxgpr;  /* Prevent reordering. */ \
+-    } \
+-    if (ngpr + n <= maxgpr) { \
+-      dp = &cc->gpr[ngpr]; \
+-      ngpr += n; \
+-      goto done; \
+-    } \
++  } else { \
++    CCALL_HANDLE_GPR \
+   }
++#endif
++#if !LJ_ABI_SOFTFP
+ #define CCALL_HANDLE_RET \
+   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
+     ctr = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */
++#endif
+ #elif LJ_TARGET_MIPS32
+ /* -- MIPS o32 calling conventions ---------------------------------------- */
+@@ -1080,7 +1090,7 @@ static int ccall_set_args(lua_State *L,
+   }
+   if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG);  /* Too few arguments. */
+-#if LJ_TARGET_X64 || LJ_TARGET_PPC
++#if LJ_TARGET_X64 || (LJ_TARGET_PPC && !LJ_ABI_SOFTFP)
+   cc->nfpr = nfpr;  /* Required for vararg functions. */
+ #endif
+   cc->nsp = nsp;
+--- a/src/lj_ccall.h
++++ b/src/lj_ccall.h
+@@ -86,9 +86,9 @@ typedef union FPRArg {
+ #elif LJ_TARGET_PPC
+ #define CCALL_NARG_GPR                8
+-#define CCALL_NARG_FPR                8
++#define CCALL_NARG_FPR                (LJ_ABI_SOFTFP ? 0 : 8)
+ #define CCALL_NRET_GPR                4       /* For complex double. */
+-#define CCALL_NRET_FPR                1
++#define CCALL_NRET_FPR                (LJ_ABI_SOFTFP ? 0 : 1)
+ #define CCALL_SPS_EXTRA               4
+ #define CCALL_SPS_FREE                0
+--- a/src/lj_ccallback.c
++++ b/src/lj_ccallback.c
+@@ -419,6 +419,23 @@ void lj_ccallback_mcode_free(CTState *ct
+ #elif LJ_TARGET_PPC
++#define CALLBACK_HANDLE_GPR \
++  if (n > 1) { \
++    lua_assert(((LJ_ABI_SOFTFP && ctype_isnum(cta->info)) ||  /* double. */ \
++              ctype_isinteger(cta->info)) && n == 2);  /* int64_t. */ \
++    ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
++  } \
++  if (ngpr + n <= maxgpr) { \
++    sp = &cts->cb.gpr[ngpr]; \
++    ngpr += n; \
++    goto done; \
++  }
++
++#if LJ_ABI_SOFTFP
++#define CALLBACK_HANDLE_REGARG \
++  CALLBACK_HANDLE_GPR \
++  UNUSED(isfp);
++#else
+ #define CALLBACK_HANDLE_REGARG \
+   if (isfp) { \
+     if (nfpr + 1 <= CCALL_NARG_FPR) { \
+@@ -427,20 +444,15 @@ void lj_ccallback_mcode_free(CTState *ct
+       goto done; \
+     } \
+   } else {  /* Try to pass argument in GPRs. */ \
+-    if (n > 1) { \
+-      lua_assert(ctype_isinteger(cta->info) && n == 2);  /* int64_t. */ \
+-      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
+-    } \
+-    if (ngpr + n <= maxgpr) { \
+-      sp = &cts->cb.gpr[ngpr]; \
+-      ngpr += n; \
+-      goto done; \
+-    } \
++    CALLBACK_HANDLE_GPR \
+   }
++#endif
++#if !LJ_ABI_SOFTFP
+ #define CALLBACK_HANDLE_RET \
+   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
+     *(double *)dp = *(float *)dp;  /* FPRs always hold doubles. */
++#endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_frame.h
++++ b/src/lj_frame.h
+@@ -226,7 +226,7 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CAL
+ #define CFRAME_OFS_L          36
+ #define CFRAME_OFS_PC         32
+ #define CFRAME_OFS_MULTRES    28
+-#define CFRAME_SIZE           272
++#define CFRAME_SIZE           (LJ_ARCH_HASFPU ? 272 : 128)
+ #define CFRAME_SHIFT_MULTRES  3
+ #endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_ircall.h
++++ b/src/lj_ircall.h
+@@ -272,7 +272,7 @@ LJ_DATA const CCallInfo lj_ir_callinfo[I
+ #define fp64_f2l __aeabi_f2lz
+ #define fp64_f2ul __aeabi_f2ulz
+ #endif
+-#elif LJ_TARGET_MIPS
++#elif LJ_TARGET_MIPS || LJ_TARGET_PPC
+ #define softfp_add __adddf3
+ #define softfp_sub __subdf3
+ #define softfp_mul __muldf3
+--- a/src/vm_ppc.dasc
++++ b/src/vm_ppc.dasc
+@@ -103,6 +103,18 @@
+ |// Fixed register assignments for the interpreter.
+ |// Don't use: r1 = sp, r2 and r13 = reserved (TOC, TLS or SDATA)
+ |
++|.macro .FPU, a, b
++|.if FPU
++|  a, b
++|.endif
++|.endmacro
++|
++|.macro .FPU, a, b, c
++|.if FPU
++|  a, b, c
++|.endif
++|.endmacro
++|
+ |// The following must be C callee-save (but BASE is often refetched).
+ |.define BASE,                r14     // Base of current Lua stack frame.
+ |.define KBASE,               r15     // Constants of current Lua function.
+@@ -116,8 +128,10 @@
+ |.define TISNUM,      r22
+ |.define TISNIL,      r23
+ |.define ZERO,                r24
++|.if FPU
+ |.define TOBIT,               f30     // 2^52 + 2^51.
+ |.define TONUM,               f31     // 2^52 + 2^51 + 2^31.
++|.endif
+ |
+ |// The following temporaries are not saved across C calls, except for RA.
+ |.define RA,          r20     // Callee-save.
+@@ -133,6 +147,7 @@
+ |
+ |// Saved temporaries.
+ |.define SAVE0,               r21
++|.define SAVE1,               r25
+ |
+ |// Calling conventions.
+ |.define CARG1,               r3
+@@ -141,8 +156,10 @@
+ |.define CARG4,               r6      // Overlaps TMP3.
+ |.define CARG5,               r7      // Overlaps INS.
+ |
++|.if FPU
+ |.define FARG1,               f1
+ |.define FARG2,               f2
++|.endif
+ |
+ |.define CRET1,               r3
+ |.define CRET2,               r4
+@@ -213,10 +230,16 @@
+ |.endif
+ |.else
+ |
++|.if FPU
+ |.define SAVE_LR,     276(sp)
+ |.define CFRAME_SPACE,        272     // Delta for sp.
+ |// Back chain for sp:        272(sp) <-- sp entering interpreter
+ |.define SAVE_FPR_,   128     // .. 128+18*8: 64 bit FPR saves.
++|.else
++|.define SAVE_LR,     132(sp)
++|.define CFRAME_SPACE,        128     // Delta for sp.
++|// Back chain for sp:        128(sp) <-- sp entering interpreter
++|.endif
+ |.define SAVE_GPR_,   56      // .. 56+18*4: 32 bit GPR saves.
+ |.define SAVE_CR,     52(sp)  // 32 bit CR save.
+ |.define SAVE_ERRF,   48(sp)  // 32 bit C frame info.
+@@ -226,16 +249,25 @@
+ |.define SAVE_PC,     32(sp)
+ |.define SAVE_MULTRES,        28(sp)
+ |.define UNUSED1,     24(sp)
++|.if FPU
+ |.define TMPD_LO,     20(sp)
+ |.define TMPD_HI,     16(sp)
+ |.define TONUM_LO,    12(sp)
+ |.define TONUM_HI,    8(sp)
++|.else
++|.define SFSAVE_4,    20(sp)
++|.define SFSAVE_3,    16(sp)
++|.define SFSAVE_2,    12(sp)
++|.define SFSAVE_1,    8(sp)
++|.endif
+ |// Next frame lr:    4(sp)
+ |// Back chain for sp:        0(sp)   <-- sp while in interpreter
+ |
++|.if FPU
+ |.define TMPD_BLO,    23(sp)
+ |.define TMPD,                TMPD_HI
+ |.define TONUM_D,     TONUM_HI
++|.endif
+ |
+ |.endif
+ |
+@@ -245,7 +277,7 @@
+ |.else
+ |  stw r..reg, SAVE_GPR_+(reg-14)*4(sp)
+ |.endif
+-|  stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
++|  .FPU stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
+ |.endmacro
+ |.macro rest_, reg
+ |.if GPR64
+@@ -253,7 +285,7 @@
+ |.else
+ |  lwz r..reg, SAVE_GPR_+(reg-14)*4(sp)
+ |.endif
+-|  lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
++|  .FPU lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
+ |.endmacro
+ |
+ |.macro saveregs
+@@ -323,6 +355,7 @@
+ |// Trap for not-yet-implemented parts.
+ |.macro NYI; tw 4, sp, sp; .endmacro
+ |
++|.if FPU
+ |// int/FP conversions.
+ |.macro tonum_i, freg, reg
+ |  xoris reg, reg, 0x8000
+@@ -346,6 +379,7 @@
+ |.macro toint, reg, freg
+ |  toint reg, freg, freg
+ |.endmacro
++|.endif
+ |
+ |//-----------------------------------------------------------------------
+ |
+@@ -533,9 +567,19 @@ static void build_subroutines(BuildCtx *
+   |  beq >2
+   |1:
+   |  addic. TMP1, TMP1, -8
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz CARG1, 0(RA)
++  |   lwz CARG2, 4(RA)
++  |.endif
+   |    addi RA, RA, 8
++  |.if FPU
+   |   stfd f0, 0(BASE)
++  |.else
++  |   stw CARG1, 0(BASE)
++  |   stw CARG2, 4(BASE)
++  |.endif
+   |    addi BASE, BASE, 8
+   |  bney <1
+   |
+@@ -613,23 +657,23 @@ static void build_subroutines(BuildCtx *
+   |  .toc ld TOCREG, SAVE_TOC
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |  lp BASE, L->base
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |   lwz DISPATCH, L->glref          // Setup pointer to dispatch table.
+   |     li ZERO, 0
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |  li TMP1, LJ_TFALSE
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
+   |     li TISNIL, LJ_TNIL
+   |    li_vmstate INTERP
+-  |     lfs TOBIT, TMPD
++  |     .FPU lfs TOBIT, TMPD
+   |  lwz PC, FRAME_PC(BASE)           // Fetch PC of previous frame.
+   |  la RA, -8(BASE)                  // Results start at BASE-8.
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |   addi DISPATCH, DISPATCH, GG_G2DISP
+   |  stw TMP1, 0(RA)                  // Prepend false to error message.
+   |  li RD, 16                                // 2 results: false + error message.
+   |    st_vmstate
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |  b ->vm_returnc
+   |
+   |//-----------------------------------------------------------------------
+@@ -690,22 +734,22 @@ static void build_subroutines(BuildCtx *
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |   lp TMP1, L->top
+   |  lwz PC, FRAME_PC(BASE)
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |    stb CARG3, L->status
+-  |     stw TMP3, TMPD
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     lfs TOBIT, TMPD
++  |     .FPU stw TMP3, TMPD
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU lfs TOBIT, TMPD
+   |   sub RD, TMP1, BASE
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |   addi RD, RD, 8
+-  |     stw TMP0, TONUM_HI
++  |     .FPU stw TMP0, TONUM_HI
+   |    li_vmstate INTERP
+   |     li ZERO, 0
+   |    st_vmstate
+   |  andix. TMP0, PC, FRAME_TYPE
+   |   mr MULTRES, RD
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |     li TISNIL, LJ_TNIL
+   |  beq ->BC_RET_Z
+   |  b ->vm_return
+@@ -739,19 +783,19 @@ static void build_subroutines(BuildCtx *
+   |  lp TMP2, L->base                 // TMP2 = old base (used in vmeta_call).
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |   lp TMP1, L->top
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |  add PC, PC, BASE
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |     li ZERO, 0
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     lfs TOBIT, TMPD
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU lfs TOBIT, TMPD
+   |  sub PC, PC, TMP2                 // PC = frame delta + frame type
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |   sub NARGS8:RC, TMP1, BASE
+-  |     stw TMP0, TONUM_HI
++  |     .FPU stw TMP0, TONUM_HI
+   |    li_vmstate INTERP
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |     li TISNIL, LJ_TNIL
+   |    st_vmstate
+   |
+@@ -839,15 +883,30 @@ static void build_subroutines(BuildCtx *
+   |  lwz INS, -4(PC)
+   |   subi CARG2, RB, 16
+   |  decode_RB8 SAVE0, INS
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz TMP2, 0(RA)
++  |   lwz TMP3, 4(RA)
++  |.endif
+   |  add TMP1, BASE, SAVE0
+   |   stp BASE, L->base
+   |  cmplw TMP1, CARG2
+   |   sub CARG3, CARG2, TMP1
+   |  decode_RA8 RA, INS
++  |.if FPU
+   |   stfd f0, 0(CARG2)
++  |.else
++  |   stw TMP2, 0(CARG2)
++  |   stw TMP3, 4(CARG2)
++  |.endif
+   |  bney ->BC_CAT_Z
++  |.if FPU
+   |   stfdx f0, BASE, RA
++  |.else
++  |   stwux TMP2, RA, BASE
++  |   stw TMP3, 4(RA)
++  |.endif
+   |  b ->cont_nop
+   |
+   |//-- Table indexing metamethods -----------------------------------------
+@@ -900,9 +959,19 @@ static void build_subroutines(BuildCtx *
+   |  // Returns TValue * (finished) or NULL (metamethod).
+   |  cmplwi CRET1, 0
+   |  beq >3
++  |.if FPU
+   |   lfd f0, 0(CRET1)
++  |.else
++  |   lwz TMP0, 0(CRET1)
++  |   lwz TMP1, 4(CRET1)
++  |.endif
+   |  ins_next1
++  |.if FPU
+   |   stfdx f0, BASE, RA
++  |.else
++  |   stwux TMP0, RA, BASE
++  |   stw TMP1, 4(RA)
++  |.endif
+   |  ins_next2
+   |
+   |3:  // Call __index metamethod.
+@@ -920,7 +989,12 @@ static void build_subroutines(BuildCtx *
+   |  // Returns cTValue * or NULL.
+   |  cmplwi CRET1, 0
+   |  beq >1
++  |.if FPU
+   |  lfd f14, 0(CRET1)
++  |.else
++  |  lwz SAVE0, 0(CRET1)
++  |  lwz SAVE1, 4(CRET1)
++  |.endif
+   |  b ->BC_TGETR_Z
+   |1:
+   |  stwx TISNIL, BASE, RA
+@@ -975,11 +1049,21 @@ static void build_subroutines(BuildCtx *
+   |  bl extern lj_meta_tset           // (lua_State *L, TValue *o, TValue *k)
+   |  // Returns TValue * (finished) or NULL (metamethod).
+   |  cmplwi CRET1, 0
++  |.if FPU
+   |   lfdx f0, BASE, RA
++  |.else
++  |   lwzux TMP2, RA, BASE
++  |   lwz TMP3, 4(RA)
++  |.endif
+   |  beq >3
+   |  // NOBARRIER: lj_meta_tset ensures the table is not black.
+   |  ins_next1
++  |.if FPU
+   |   stfd f0, 0(CRET1)
++  |.else
++  |   stw TMP2, 0(CRET1)
++  |   stw TMP3, 4(CRET1)
++  |.endif
+   |  ins_next2
+   |
+   |3:  // Call __newindex metamethod.
+@@ -990,7 +1074,12 @@ static void build_subroutines(BuildCtx *
+   |   add PC, TMP1, BASE
+   |  lwz LFUNC:RB, FRAME_FUNC(BASE)   // Guaranteed to be a function here.
+   |   li NARGS8:RC, 24                        // 3 args for func(t, k, v)
++  |.if FPU
+   |  stfd f0, 16(BASE)                        // Copy value to third argument.
++  |.else
++  |  stw TMP2, 16(BASE)
++  |  stw TMP3, 20(BASE)
++  |.endif
+   |  b ->vm_call_dispatch_f
+   |
+   |->vmeta_tsetr:
+@@ -998,7 +1087,12 @@ static void build_subroutines(BuildCtx *
+   |  stw PC, SAVE_PC
+   |  bl extern lj_tab_setinth  // (lua_State *L, GCtab *t, int32_t key)
+   |  // Returns TValue *.
++  |.if FPU
+   |  stfd f14, 0(CRET1)
++  |.else
++  |  stw SAVE0, 0(CRET1)
++  |  stw SAVE1, 4(CRET1)
++  |.endif
+   |  b ->cont_nop
+   |
+   |//-- Comparison metamethods ---------------------------------------------
+@@ -1037,9 +1131,19 @@ static void build_subroutines(BuildCtx *
+   |
+   |->cont_ra:                         // RA = resultptr
+   |  lwz INS, -4(PC)
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz CARG1, 0(RA)
++  |   lwz CARG2, 4(RA)
++  |.endif
+   |  decode_RA8 TMP1, INS
++  |.if FPU
+   |   stfdx f0, BASE, TMP1
++  |.else
++  |   stwux CARG1, TMP1, BASE
++  |   stw CARG2, 4(TMP1)
++  |.endif
+   |  b ->cont_nop
+   |
+   |->cont_condt:                      // RA = resultptr
+@@ -1245,22 +1349,32 @@ static void build_subroutines(BuildCtx *
+   |.macro .ffunc_n, name
+   |->ff_ .. name:
+   |  cmplwi NARGS8:RC, 8
+-  |   lwz CARG3, 0(BASE)
++  |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |.endif
+   |  blt ->fff_fallback
+-  |  checknum CARG3; bge ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
+   |.endmacro
+   |
+   |.macro .ffunc_nn, name
+   |->ff_ .. name:
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG3, 0(BASE)
++  |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
+-  |   lwz CARG4, 8(BASE)
++  |   lwz CARG3, 8(BASE)
+   |    lfd FARG2, 8(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |   lwz CARG3, 8(BASE)
++  |    lwz CARG4, 12(BASE)
++  |.endif
+   |  blt ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
+   |  checknum CARG3; bge ->fff_fallback
+-  |  checknum CARG4; bge ->fff_fallback
+   |.endmacro
+   |
+   |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1.
+@@ -1281,14 +1395,21 @@ static void build_subroutines(BuildCtx *
+   |  bge cr1, ->fff_fallback
+   |   stw CARG3, 0(RA)
+   |  addi RD, NARGS8:RC, 8            // Compute (nresults+1)*8.
++  |  addi TMP1, BASE, 8
++  |  add TMP2, RA, NARGS8:RC
+   |   stw CARG1, 4(RA)
+   |  beq ->fff_res                    // Done if exactly 1 argument.
+-  |  li TMP1, 8
+-  |  subi RC, RC, 8
+   |1:
+-  |  cmplw TMP1, RC
+-  |   lfdx f0, BASE, TMP1
+-  |   stfdx f0, RA, TMP1
++  |  cmplw TMP1, TMP2
++  |.if FPU
++  |   lfd f0, 0(TMP1)
++  |   stfd f0, 0(TMP1)
++  |.else
++  |   lwz CARG1, 0(TMP1)
++  |   lwz CARG2, 4(TMP1)
++  |   stw CARG1, -8(TMP1)
++  |   stw CARG2, -4(TMP1)
++  |.endif
+   |    addi TMP1, TMP1, 8
+   |  bney <1
+   |  b ->fff_res
+@@ -1303,8 +1424,14 @@ static void build_subroutines(BuildCtx *
+   |  orc TMP1, TMP2, TMP0
+   |  addi TMP1, TMP1, ~LJ_TISNUM+1
+   |  slwi TMP1, TMP1, 3
++  |.if FPU
+   |   la TMP2, CFUNC:RB->upvalue
+   |  lfdx FARG1, TMP2, TMP1
++  |.else
++  |  add TMP1, CFUNC:RB, TMP1
++  |  lwz CARG1, CFUNC:TMP1->upvalue[0].u32.hi
++  |  lwz CARG2, CFUNC:TMP1->upvalue[0].u32.lo
++  |.endif
+   |  b ->fff_resn
+   |
+   |//-- Base library: getters and setters ---------------------------------
+@@ -1382,7 +1509,12 @@ static void build_subroutines(BuildCtx *
+   |   mr CARG1, L
+   |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)
+   |  // Returns cTValue *.
++  |.if FPU
+   |  lfd FARG1, 0(CRET1)
++  |.else
++  |  lwz CARG2, 4(CRET1)
++  |  lwz CARG1, 0(CRET1)      // Caveat: CARG1 == CRET1.
++  |.endif
+   |  b ->fff_resn
+   |
+   |//-- Base library: conversions ------------------------------------------
+@@ -1391,7 +1523,11 @@ static void build_subroutines(BuildCtx *
+   |  // Only handles the number case inline (without a base argument).
+   |  cmplwi NARGS8:RC, 8
+   |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |.endif
+   |  bne ->fff_fallback                       // Exactly one argument.
+   |   checknum CARG1; bgt ->fff_fallback
+   |  b ->fff_resn
+@@ -1442,12 +1578,23 @@ static void build_subroutines(BuildCtx *
+   |  cmplwi CRET1, 0
+   |   li CARG3, LJ_TNIL
+   |  beq ->fff_restv                  // End of traversal: return nil.
+-  |  lfd f0, 8(BASE)                  // Copy key and value to results.
+   |   la RA, -8(BASE)
++  |.if FPU
++  |  lfd f0, 8(BASE)                  // Copy key and value to results.
+   |  lfd f1, 16(BASE)
+   |  stfd f0, 0(RA)
+-  |   li RD, (2+1)*8
+   |  stfd f1, 8(RA)
++  |.else
++  |  lwz CARG1, 8(BASE)
++  |  lwz CARG2, 12(BASE)
++  |  lwz CARG3, 16(BASE)
++  |  lwz CARG4, 20(BASE)
++  |  stw CARG1, 0(RA)
++  |  stw CARG2, 4(RA)
++  |  stw CARG3, 8(RA)
++  |  stw CARG4, 12(RA)
++  |.endif
++  |   li RD, (2+1)*8
+   |  b ->fff_res
+   |
+   |.ffunc_1 pairs
+@@ -1456,17 +1603,32 @@ static void build_subroutines(BuildCtx *
+   |  bne ->fff_fallback
+ #if LJ_52
+   |   lwz TAB:TMP2, TAB:CARG1->metatable
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |   cmplwi TAB:TMP2, 0
+   |  la RA, -8(BASE)
+   |   bne ->fff_fallback
+ #else
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |  la RA, -8(BASE)
+ #endif
+   |   stw TISNIL, 8(BASE)
+   |  li RD, (3+1)*8
++  |.if FPU
+   |  stfd f0, 0(RA)
++  |.else
++  |  stw TMP0, 0(RA)
++  |  stw TMP1, 4(RA)
++  |.endif
+   |  b ->fff_res
+   |
+   |.ffunc ipairs_aux
+@@ -1512,14 +1674,24 @@ static void build_subroutines(BuildCtx *
+   |  stfd FARG2, 0(RA)
+   |.endif
+   |  ble >2                           // Not in array part?
++  |.if FPU
+   |  lwzx TMP2, TMP1, TMP3
+   |  lfdx f0, TMP1, TMP3
++  |.else
++  |  lwzux TMP2, TMP1, TMP3
++  |  lwz TMP3, 4(TMP1)
++  |.endif
+   |1:
+   |  checknil TMP2
+   |   li RD, (0+1)*8
+   |  beq ->fff_res                    // End of iteration, return 0 results.
+   |   li RD, (2+1)*8
++  |.if FPU
+   |  stfd f0, 8(RA)
++  |.else
++  |  stw TMP2, 8(RA)
++  |  stw TMP3, 12(RA)
++  |.endif
+   |  b ->fff_res
+   |2:  // Check for empty hash part first. Otherwise call C function.
+   |  lwz TMP0, TAB:CARG1->hmask
+@@ -1533,7 +1705,11 @@ static void build_subroutines(BuildCtx *
+   |   li RD, (0+1)*8
+   |  beq ->fff_res
+   |  lwz TMP2, 0(CRET1)
++  |.if FPU
+   |  lfd f0, 0(CRET1)
++  |.else
++  |  lwz TMP3, 4(CRET1)
++  |.endif
+   |  b <1
+   |
+   |.ffunc_1 ipairs
+@@ -1542,12 +1718,22 @@ static void build_subroutines(BuildCtx *
+   |  bne ->fff_fallback
+ #if LJ_52
+   |   lwz TAB:TMP2, TAB:CARG1->metatable
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |   cmplwi TAB:TMP2, 0
+   |  la RA, -8(BASE)
+   |   bne ->fff_fallback
+ #else
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |  la RA, -8(BASE)
+ #endif
+   |.if DUALNUM
+@@ -1557,7 +1743,12 @@ static void build_subroutines(BuildCtx *
+   |.endif
+   |   stw ZERO, 12(BASE)
+   |  li RD, (3+1)*8
++  |.if FPU
+   |  stfd f0, 0(RA)
++  |.else
++  |  stw TMP0, 0(RA)
++  |  stw TMP1, 4(RA)
++  |.endif
+   |  b ->fff_res
+   |
+   |//-- Base library: catch errors ----------------------------------------
+@@ -1576,19 +1767,32 @@ static void build_subroutines(BuildCtx *
+   |
+   |.ffunc xpcall
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG4, 8(BASE)
++  |   lwz CARG3, 8(BASE)
++  |.if FPU
+   |    lfd FARG2, 8(BASE)
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG1, 0(BASE)
++  |    lwz CARG2, 4(BASE)
++  |    lwz CARG4, 12(BASE)
++  |.endif
+   |  blt ->fff_fallback
+   |  lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH)
+   |   mr TMP2, BASE
+-  |  checkfunc CARG4; bne ->fff_fallback  // Traceback must be a function.
++  |  checkfunc CARG3; bne ->fff_fallback  // Traceback must be a function.
+   |   la BASE, 16(BASE)
+   |  // Remember active hook before pcall.
+   |  rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31
++  |.if FPU
+   |    stfd FARG2, 0(TMP2)            // Swap function and traceback.
+-  |  subi NARGS8:RC, NARGS8:RC, 16
+   |    stfd FARG1, 8(TMP2)
++  |.else
++  |    stw CARG3, 0(TMP2)
++  |    stw CARG4, 4(TMP2)
++  |    stw CARG1, 8(TMP2)
++  |    stw CARG2, 12(TMP2)
++  |.endif
++  |  subi NARGS8:RC, NARGS8:RC, 16
+   |  addi PC, TMP1, 16+FRAME_PCALL
+   |  b ->vm_call_dispatch
+   |
+@@ -1631,9 +1835,21 @@ static void build_subroutines(BuildCtx *
+   |  stp BASE, L->top
+   |2:  // Move args to coroutine.
+   |  cmpw TMP1, NARGS8:RC
++  |.if FPU
+   |   lfdx f0, BASE, TMP1
++  |.else
++  |   add CARG3, BASE, TMP1
++  |   lwz TMP2, 0(CARG3)
++  |   lwz TMP3, 4(CARG3)
++  |.endif
+   |  beq >3
++  |.if FPU
+   |   stfdx f0, CARG2, TMP1
++  |.else
++  |   add CARG3, CARG2, TMP1
++  |   stw TMP2, 0(CARG3)
++  |   stw TMP3, 4(CARG3)
++  |.endif
+   |  addi TMP1, TMP1, 8
+   |  b <2
+   |3:
+@@ -1664,8 +1880,17 @@ static void build_subroutines(BuildCtx *
+   |   stp TMP2, L:SAVE0->top          // Clear coroutine stack.
+   |5:  // Move results from coroutine.
+   |  cmplw TMP1, TMP3
++  |.if FPU
+   |   lfdx f0, TMP2, TMP1
+   |   stfdx f0, BASE, TMP1
++  |.else
++  |   add CARG3, TMP2, TMP1
++  |   lwz CARG1, 0(CARG3)
++  |   lwz CARG2, 4(CARG3)
++  |   add CARG3, BASE, TMP1
++  |   stw CARG1, 0(CARG3)
++  |   stw CARG2, 4(CARG3)
++  |.endif
+   |    addi TMP1, TMP1, 8
+   |  bne <5
+   |6:
+@@ -1690,12 +1915,22 @@ static void build_subroutines(BuildCtx *
+   |  andix. TMP0, PC, FRAME_TYPE
+   |  la TMP3, -8(TMP3)
+   |   li TMP1, LJ_TFALSE
++  |.if FPU
+   |  lfd f0, 0(TMP3)
++  |.else
++  |  lwz CARG1, 0(TMP3)
++  |  lwz CARG2, 4(TMP3)
++  |.endif
+   |   stp TMP3, L:SAVE0->top          // Remove error from coroutine stack.
+   |    li RD, (2+1)*8
+   |   stw TMP1, -8(BASE)              // Prepend false to results.
+   |    la RA, -8(BASE)
++  |.if FPU
+   |  stfd f0, 0(BASE)                 // Copy error message.
++  |.else
++  |  stw CARG1, 0(BASE)                       // Copy error message.
++  |  stw CARG2, 4(BASE)
++  |.endif
+   |  b <7
+   |.else
+   |  mr CARG1, L
+@@ -1874,7 +2109,12 @@ static void build_subroutines(BuildCtx *
+   |  lus CARG1, 0x8000                        // -(2^31).
+   |  beqy ->fff_resi
+   |5:
++  |.if FPU
+   |  lfd FARG1, 0(BASE)
++  |.else
++  |  lwz CARG1, 0(BASE)
++  |  lwz CARG2, 4(BASE)
++  |.endif
+   |  blex func
+   |  b ->fff_resn
+   |.endmacro
+@@ -1898,10 +2138,14 @@ static void build_subroutines(BuildCtx *
+   |
+   |.ffunc math_log
+   |  cmplwi NARGS8:RC, 8
+-  |   lwz CARG3, 0(BASE)
+-  |    lfd FARG1, 0(BASE)
++  |   lwz CARG1, 0(BASE)
+   |  bne ->fff_fallback                       // Need exactly 1 argument.
+-  |  checknum CARG3; bge ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
++  |.if FPU
++  |  lfd FARG1, 0(BASE)
++  |.else
++  |  lwz CARG2, 4(BASE)
++  |.endif
+   |  blex log
+   |  b ->fff_resn
+   |
+@@ -1923,17 +2167,24 @@ static void build_subroutines(BuildCtx *
+   |.if DUALNUM
+   |.ffunc math_ldexp
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG3, 0(BASE)
++  |   lwz TMP0, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
+-  |   lwz CARG4, 8(BASE)
++  |.else
++  |    lwz CARG1, 0(BASE)
++  |    lwz CARG2, 4(BASE)
++  |.endif
++  |   lwz TMP1, 8(BASE)
+   |.if GPR64
+   |    lwz CARG2, 12(BASE)
+-  |.else
++  |.elif FPU
+   |    lwz CARG1, 12(BASE)
++  |.else
++  |    lwz CARG3, 12(BASE)
+   |.endif
+   |  blt ->fff_fallback
+-  |  checknum CARG3; bge ->fff_fallback
+-  |  checknum CARG4; bne ->fff_fallback
++  |  checknum TMP0; bge ->fff_fallback
++  |  checknum TMP1; bne ->fff_fallback
+   |.else
+   |.ffunc_nn math_ldexp
+   |.if GPR64
+@@ -1948,8 +2199,10 @@ static void build_subroutines(BuildCtx *
+   |.ffunc_n math_frexp
+   |.if GPR64
+   |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)
+-  |.else
++  |.elif FPU
+   |  la CARG1, DISPATCH_GL(tmptv)(DISPATCH)
++  |.else
++  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)
+   |.endif
+   |   lwz PC, FRAME_PC(BASE)
+   |  blex frexp
+@@ -1958,7 +2211,12 @@ static void build_subroutines(BuildCtx *
+   |.if not DUALNUM
+   |   tonum_i FARG2, TMP1
+   |.endif
++  |.if FPU
+   |  stfd FARG1, 0(RA)
++  |.else
++  |  stw CRET1, 0(RA)
++  |  stw CRET2, 4(RA)
++  |.endif
+   |  li RD, (2+1)*8
+   |.if DUALNUM
+   |   stw TISNUM, 8(RA)
+@@ -1971,13 +2229,20 @@ static void build_subroutines(BuildCtx *
+   |.ffunc_n math_modf
+   |.if GPR64
+   |  la CARG2, -8(BASE)
+-  |.else
++  |.elif FPU
+   |  la CARG1, -8(BASE)
++  |.else
++  |  la CARG3, -8(BASE)
+   |.endif
+   |   lwz PC, FRAME_PC(BASE)
+   |  blex modf
+   |   la RA, -8(BASE)
++  |.if FPU
+   |  stfd FARG1, 0(BASE)
++  |.else
++  |  stw CRET1, 0(BASE)
++  |  stw CRET2, 4(BASE)
++  |.endif
+   |  li RD, (2+1)*8
+   |  b ->fff_res
+   |
+@@ -1985,13 +2250,13 @@ static void build_subroutines(BuildCtx *
+   |.if DUALNUM
+   |  .ffunc_1 name
+   |  checknum CARG3
+-  |   addi TMP1, BASE, 8
+-  |   add TMP2, BASE, NARGS8:RC
++  |   addi SAVE0, BASE, 8
++  |   add SAVE1, BASE, NARGS8:RC
+   |  bne >4
+   |1:  // Handle integers.
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
+-  |  lwz CARG2, 4(TMP1)
++  |  lwz CARG4, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
++  |  lwz CARG2, 4(SAVE0)
+   |   bge cr1, ->fff_resi
+   |  checknum CARG4
+   |   xoris TMP0, CARG1, 0x8000
+@@ -2008,36 +2273,76 @@ static void build_subroutines(BuildCtx *
+   |.if GPR64
+   |  rldicl CARG1, CARG1, 0, 32
+   |.endif
+-  |   addi TMP1, TMP1, 8
++  |   addi SAVE0, SAVE0, 8
+   |  b <1
+   |3:
+   |  bge ->fff_fallback
+   |  // Convert intermediate result to number and continue below.
++  |.if FPU
+   |  tonum_i FARG1, CARG1
+-  |  lfd FARG2, 0(TMP1)
++  |  lfd FARG2, 0(SAVE0)
++  |.else
++  |  mr CARG2, CARG1
++  |  bl ->vm_sfi2d_1
++  |  lwz CARG3, 0(SAVE0)
++  |  lwz CARG4, 4(SAVE0)
++  |.endif
+   |  b >6
+   |4:
++  |.if FPU
+   |   lfd FARG1, 0(BASE)
++  |.else
++  |   lwz CARG1, 0(BASE)
++  |   lwz CARG2, 4(BASE)
++  |.endif
+   |  bge ->fff_fallback
+   |5:  // Handle numbers.
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
+-  |  lfd FARG2, 0(TMP1)
++  |  lwz CARG3, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
++  |.if FPU
++  |  lfd FARG2, 0(SAVE0)
++  |.else
++  |  lwz CARG4, 4(SAVE0)
++  |.endif
+   |   bge cr1, ->fff_resn
+-  |  checknum CARG4; bge >7
++  |  checknum CARG3; bge >7
+   |6:
++  |   addi SAVE0, SAVE0, 8
++  |.if FPU
+   |  fsub f0, FARG1, FARG2
+-  |   addi TMP1, TMP1, 8
+   |.if ismax
+   |  fsel FARG1, f0, FARG1, FARG2
+   |.else
+   |  fsel FARG1, f0, FARG2, FARG1
+   |.endif
++  |.else
++  |  stw CARG1, SFSAVE_1
++  |  stw CARG2, SFSAVE_2
++  |  stw CARG3, SFSAVE_3
++  |  stw CARG4, SFSAVE_4
++  |  blex __ledf2
++  |  cmpwi CRET1, 0
++  |.if ismax
++  |  blt >8
++  |.else
++  |  bge >8
++  |.endif
++  |  lwz CARG1, SFSAVE_1
++  |  lwz CARG2, SFSAVE_2
++  |  b <5
++  |8:
++  |  lwz CARG1, SFSAVE_3
++  |  lwz CARG2, SFSAVE_4
++  |.endif
+   |  b <5
+   |7:  // Convert integer to number and continue above.
+-  |   lwz CARG2, 4(TMP1)
++  |   lwz CARG3, 4(SAVE0)
+   |  bne ->fff_fallback
+-  |  tonum_i FARG2, CARG2
++  |.if FPU
++  |  tonum_i FARG2, CARG3
++  |.else
++  |  bl ->vm_sfi2d_2
++  |.endif
+   |  b <6
+   |.else
+   |  .ffunc_n name
+@@ -2237,28 +2542,37 @@ static void build_subroutines(BuildCtx *
+   |
+   |.macro .ffunc_bit_op, name, ins
+   |  .ffunc_bit name
+-  |  addi TMP1, BASE, 8
+-  |  add TMP2, BASE, NARGS8:RC
++  |  addi SAVE0, BASE, 8
++  |  add SAVE1, BASE, NARGS8:RC
+   |1:
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
++  |  lwz CARG4, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
+   |.if DUALNUM
+-  |  lwz CARG2, 4(TMP1)
++  |  lwz CARG2, 4(SAVE0)
+   |.else
+-  |  lfd FARG1, 0(TMP1)
++  |  lfd FARG1, 0(SAVE0)
+   |.endif
+   |   bgey cr1, ->fff_resi
+   |  checknum CARG4
+   |.if DUALNUM
++  |.if FPU
+   |  bnel ->fff_bitop_fb
+   |.else
++  |  beq >3
++  |  stw CARG1, SFSAVE_1
++  |  bl ->fff_bitop_fb
++  |  mr CARG2, CARG1
++  |  lwz CARG1, SFSAVE_1
++  |3:
++  |.endif
++  |.else
+   |  fadd FARG1, FARG1, TOBIT
+   |  bge ->fff_fallback
+   |  stfd FARG1, TMPD
+   |  lwz CARG2, TMPD_LO
+   |.endif
+   |  ins CARG1, CARG1, CARG2
+-  |   addi TMP1, TMP1, 8
++  |   addi SAVE0, SAVE0, 8
+   |  b <1
+   |.endmacro
+   |
+@@ -2280,7 +2594,14 @@ static void build_subroutines(BuildCtx *
+   |.macro .ffunc_bit_sh, name, ins, shmod
+   |.if DUALNUM
+   |  .ffunc_2 bit_..name
++  |.if FPU
+   |  checknum CARG3; bnel ->fff_tobit_fb
++  |.else
++  |  checknum CARG3; beq >1
++  |  bl ->fff_tobit_fb
++  |  lwz CARG2, 12(BASE)      // Conversion polluted CARG2.
++  |1:
++  |.endif
+   |  // Note: no inline conversion from number for 2nd argument!
+   |  checknum CARG4; bne ->fff_fallback
+   |.else
+@@ -2317,27 +2638,77 @@ static void build_subroutines(BuildCtx *
+   |->fff_resn:
+   |  lwz PC, FRAME_PC(BASE)
+   |  la RA, -8(BASE)
++  |.if FPU
+   |  stfd FARG1, -8(BASE)
++  |.else
++  |  stw CARG1, -8(BASE)
++  |  stw CARG2, -4(BASE)
++  |.endif
+   |  b ->fff_res1
+   |
+   |// Fallback FP number to bit conversion.
+   |->fff_tobit_fb:
+   |.if DUALNUM
++  |.if FPU
+   |  lfd FARG1, 0(BASE)
+   |  bgt ->fff_fallback
+   |  fadd FARG1, FARG1, TOBIT
+   |  stfd FARG1, TMPD
+   |  lwz CARG1, TMPD_LO
+   |  blr
++  |.else
++  |  bgt ->fff_fallback
++  |  mr CARG2, CARG1
++  |  mr CARG1, CARG3
++  |// Modifies: CARG1, CARG2, TMP0, TMP1, TMP2.
++  |->vm_tobit:
++  |  slwi TMP2, CARG1, 1
++  |  addis TMP2, TMP2, 0x0020
++  |  cmpwi TMP2, 0
++  |  bge >2
++  |   li TMP1, 0x3e0
++  |  srawi TMP2, TMP2, 21
++  |   not TMP1, TMP1
++  |  sub. TMP2, TMP1, TMP2
++  |    cmpwi cr7, CARG1, 0
++  |  blt >1
++  |   slwi TMP1, CARG1, 11
++  |    srwi TMP0, CARG2, 21
++  |   oris TMP1, TMP1, 0x8000
++  |   or TMP1, TMP1, TMP0
++  |   srw CARG1, TMP1, TMP2
++  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
++  |   neg CARG1, CARG1
++  |  blr
++  |1:
++  |  addi TMP2, TMP2, 21
++  |  srw TMP1, CARG2, TMP2
++  |   slwi CARG2, CARG1, 12
++  |  subfic TMP2, TMP2, 20
++  |   slw TMP0, CARG2, TMP2
++  |   or CARG1, TMP1, TMP0
++  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
++  |   neg CARG1, CARG1
++  |  blr
++  |2:
++  |  li CARG1, 0
++  |  blr
++  |.endif
+   |.endif
+   |->fff_bitop_fb:
+   |.if DUALNUM
+-  |  lfd FARG1, 0(TMP1)
++  |.if FPU
++  |  lfd FARG1, 0(SAVE0)
+   |  bgt ->fff_fallback
+   |  fadd FARG1, FARG1, TOBIT
+   |  stfd FARG1, TMPD
+   |  lwz CARG2, TMPD_LO
+   |  blr
++  |.else
++  |  bgt ->fff_fallback
++  |  mr CARG1, CARG4
++  |  b ->vm_tobit
++  |.endif
+   |.endif
+   |
+   |//-----------------------------------------------------------------------
+@@ -2530,10 +2901,21 @@ static void build_subroutines(BuildCtx *
+   |  decode_RA8 RC, INS                       // Call base.
+   |   beq >2
+   |1:  // Move results down.
++  |.if FPU
+   |  lfd f0, 0(RA)
++  |.else
++  |  lwz CARG1, 0(RA)
++  |  lwz CARG2, 4(RA)
++  |.endif
+   |   addic. TMP1, TMP1, -8
+   |    addi RA, RA, 8
++  |.if FPU
+   |  stfdx f0, BASE, RC
++  |.else
++  |  add CARG3, BASE, RC
++  |  stw CARG1, 0(CARG3)
++  |  stw CARG2, 4(CARG3)
++  |.endif
+   |    addi RC, RC, 8
+   |   bne <1
+   |2:
+@@ -2586,10 +2968,12 @@ static void build_subroutines(BuildCtx *
+   |//-----------------------------------------------------------------------
+   |
+   |.macro savex_, a, b, c, d
++  |.if FPU
+   |  stfd f..a, 16+a*8(sp)
+   |  stfd f..b, 16+b*8(sp)
+   |  stfd f..c, 16+c*8(sp)
+   |  stfd f..d, 16+d*8(sp)
++  |.endif
+   |.endmacro
+   |
+   |->vm_exit_handler:
+@@ -2661,16 +3045,16 @@ static void build_subroutines(BuildCtx *
+   |  lwz KBASE, PC2PROTO(k)(TMP1)
+   |  // Setup type comparison constants.
+   |  li TISNUM, LJ_TISNUM
+-  |  lus TMP3, 0x59c0                 // TOBIT = 2^52 + 2^51 (float).
+-  |  stw TMP3, TMPD
++  |  .FPU lus TMP3, 0x59c0            // TOBIT = 2^52 + 2^51 (float).
++  |  .FPU stw TMP3, TMPD
+   |  li ZERO, 0
+-  |  ori TMP3, TMP3, 0x0004           // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |  lfs TOBIT, TMPD
+-  |  stw TMP3, TMPD
+-  |  lus TMP0, 0x4338                 // Hiword of 2^52 + 2^51 (double)
++  |  .FPU ori TMP3, TMP3, 0x0004      // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |  .FPU lfs TOBIT, TMPD
++  |  .FPU stw TMP3, TMPD
++  |  .FPU lus TMP0, 0x4338                    // Hiword of 2^52 + 2^51 (double)
+   |    li TISNIL, LJ_TNIL
+-  |  stw TMP0, TONUM_HI
+-  |  lfs TONUM, TMPD
++  |  .FPU stw TMP0, TONUM_HI
++  |  .FPU lfs TONUM, TMPD
+   |  // Modified copy of ins_next which handles function header dispatch, too.
+   |  lwz INS, 0(PC)
+   |   addi PC, PC, 4
+@@ -2715,7 +3099,35 @@ static void build_subroutines(BuildCtx *
+   |//-- Math helper functions ----------------------------------------------
+   |//-----------------------------------------------------------------------
+   |
+-  |// NYI: Use internal implementations of floor, ceil, trunc.
++  |// NYI: Use internal implementations of floor, ceil, trunc, sfcmp.
++  |
++  |.macro sfi2d, AHI, ALO
++  |.if not FPU
++  |  mr. AHI, ALO
++  |  bclr 12, 2                               // Handle zero first.
++  |  srawi TMP0, ALO, 31
++  |  xor TMP1, ALO, TMP0
++  |  sub TMP1, TMP1, TMP0             // Absolute value in TMP1.
++  |  cntlzw AHI, TMP1
++  |  andix. TMP0, TMP0, 0x800         // Mask sign bit.
++  |  slw TMP1, TMP1, AHI              // Align mantissa left with leading 1.
++  |  subfic AHI, AHI, 0x3ff+31-1      // Exponent -1 in AHI.
++  |  slwi ALO, TMP1, 21
++  |  or AHI, AHI, TMP0                        // Sign | Exponent.
++  |  srwi TMP1, TMP1, 11
++  |  slwi AHI, AHI, 20                        // Align left.
++  |  add AHI, AHI, TMP1                       // Add mantissa, increment exponent.
++  |  blr
++  |.endif
++  |.endmacro
++  |
++  |// Input: CARG2. Output: CARG1, CARG2. Temporaries: TMP0, TMP1.
++  |->vm_sfi2d_1:
++  |  sfi2d CARG1, CARG2
++  |
++  |// Input: CARG4. Output: CARG3, CARG4. Temporaries: TMP0, TMP1.
++  |->vm_sfi2d_2:
++  |  sfi2d CARG3, CARG4
+   |
+   |->vm_modi:
+   |  divwo. TMP0, CARG1, CARG2
+@@ -2783,21 +3195,21 @@ static void build_subroutines(BuildCtx *
+   |   addi DISPATCH, r12, GG_G2DISP
+   |  stw r11, CTSTATE->cb.slot
+   |  stw r3, CTSTATE->cb.gpr[0]
+-  |   stfd f1, CTSTATE->cb.fpr[0]
++  |   .FPU stfd f1, CTSTATE->cb.fpr[0]
+   |  stw r4, CTSTATE->cb.gpr[1]
+-  |   stfd f2, CTSTATE->cb.fpr[1]
++  |   .FPU stfd f2, CTSTATE->cb.fpr[1]
+   |  stw r5, CTSTATE->cb.gpr[2]
+-  |   stfd f3, CTSTATE->cb.fpr[2]
++  |   .FPU stfd f3, CTSTATE->cb.fpr[2]
+   |  stw r6, CTSTATE->cb.gpr[3]
+-  |   stfd f4, CTSTATE->cb.fpr[3]
++  |   .FPU stfd f4, CTSTATE->cb.fpr[3]
+   |  stw r7, CTSTATE->cb.gpr[4]
+-  |   stfd f5, CTSTATE->cb.fpr[4]
++  |   .FPU stfd f5, CTSTATE->cb.fpr[4]
+   |  stw r8, CTSTATE->cb.gpr[5]
+-  |   stfd f6, CTSTATE->cb.fpr[5]
++  |   .FPU stfd f6, CTSTATE->cb.fpr[5]
+   |  stw r9, CTSTATE->cb.gpr[6]
+-  |   stfd f7, CTSTATE->cb.fpr[6]
++  |   .FPU stfd f7, CTSTATE->cb.fpr[6]
+   |  stw r10, CTSTATE->cb.gpr[7]
+-  |   stfd f8, CTSTATE->cb.fpr[7]
++  |   .FPU stfd f8, CTSTATE->cb.fpr[7]
+   |  addi TMP0, sp, CFRAME_SPACE+8
+   |  stw TMP0, CTSTATE->cb.stack
+   |   mr CARG1, CTSTATE
+@@ -2808,21 +3220,21 @@ static void build_subroutines(BuildCtx *
+   |  lp BASE, L:CRET1->base
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |  lp RC, L:CRET1->top
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |     li ZERO, 0
+   |   mr L, CRET1
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     stw TMP0, TONUM_HI
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU stw TMP0, TONUM_HI
+   |     li TISNIL, LJ_TNIL
+   |    li_vmstate INTERP
+-  |     lfs TOBIT, TMPD
+-  |     stw TMP3, TMPD
++  |     .FPU lfs TOBIT, TMPD
++  |     .FPU stw TMP3, TMPD
+   |  sub RC, RC, BASE
+   |    st_vmstate
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |  ins_callt
+   |.endif
+   |
+@@ -2836,7 +3248,7 @@ static void build_subroutines(BuildCtx *
+   |  mr CARG2, RA
+   |  bl extern lj_ccallback_leave     // (CTState *cts, TValue *o)
+   |  lwz CRET1, CTSTATE->cb.gpr[0]
+-  |  lfd FARG1, CTSTATE->cb.fpr[0]
++  |  .FPU lfd FARG1, CTSTATE->cb.fpr[0]
+   |  lwz CRET2, CTSTATE->cb.gpr[1]
+   |  b ->vm_leave_unw
+   |.endif
+@@ -2870,14 +3282,14 @@ static void build_subroutines(BuildCtx *
+   |  bge <1
+   |2:
+   |  bney cr1, >3
+-  |  lfd f1, CCSTATE->fpr[0]
+-  |  lfd f2, CCSTATE->fpr[1]
+-  |  lfd f3, CCSTATE->fpr[2]
+-  |  lfd f4, CCSTATE->fpr[3]
+-  |  lfd f5, CCSTATE->fpr[4]
+-  |  lfd f6, CCSTATE->fpr[5]
+-  |  lfd f7, CCSTATE->fpr[6]
+-  |  lfd f8, CCSTATE->fpr[7]
++  |  .FPU lfd f1, CCSTATE->fpr[0]
++  |  .FPU lfd f2, CCSTATE->fpr[1]
++  |  .FPU lfd f3, CCSTATE->fpr[2]
++  |  .FPU lfd f4, CCSTATE->fpr[3]
++  |  .FPU lfd f5, CCSTATE->fpr[4]
++  |  .FPU lfd f6, CCSTATE->fpr[5]
++  |  .FPU lfd f7, CCSTATE->fpr[6]
++  |  .FPU lfd f8, CCSTATE->fpr[7]
+   |3:
+   |   lp TMP0, CCSTATE->func
+   |  lwz CARG2, CCSTATE->gpr[1]
+@@ -2894,7 +3306,7 @@ static void build_subroutines(BuildCtx *
+   |  lwz TMP2, -4(r14)
+   |   lwz TMP0, 4(r14)
+   |  stw CARG1, CCSTATE:TMP1->gpr[0]
+-  |  stfd FARG1, CCSTATE:TMP1->fpr[0]
++  |  .FPU stfd FARG1, CCSTATE:TMP1->fpr[0]
+   |  stw CARG2, CCSTATE:TMP1->gpr[1]
+   |   mtlr TMP0
+   |  stw CARG3, CCSTATE:TMP1->gpr[2]
+@@ -2923,19 +3335,19 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
+     |  // RA = src1*8, RD = src2*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, BASE
++    |  lwzux CARG3, RD, BASE
+     |    lwz TMP2, -4(PC)
+-    |  checknum cr0, TMP0
+-    |   lwz CARG3, 4(RD)
++    |  checknum cr0, CARG1
++    |   lwz CARG4, 4(RD)
+     |    decode_RD4 TMP2, TMP2
+-    |  checknum cr1, TMP1
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  checknum cr1, CARG3
++    |    addis SAVE0, TMP2, -(BCBIAS_J*4 >> 16)
+     |  bne cr0, >7
+     |  bne cr1, >8
+-    |   cmpw CARG2, CARG3
++    |   cmpw CARG2, CARG4
+     if (op == BC_ISLT) {
+       |  bge >2
+     } else if (op == BC_ISGE) {
+@@ -2946,28 +3358,41 @@ static void build_ins(BuildCtx *ctx, BCO
+       |  ble >2
+     }
+     |1:
+-    |  add PC, PC, TMP2
++    |  add PC, PC, SAVE0
+     |2:
+     |  ins_next
+     |
+     |7:  // RA is not an integer.
+     |  bgt cr0, ->vmeta_comp
+     |  // RA is a number.
+-    |   lfd f0, 0(RA)
++    |   .FPU lfd f0, 0(RA)
+     |  bgt cr1, ->vmeta_comp
+     |  blt cr1, >4
+     |  // RA is a number, RD is an integer.
+-    |  tonum_i f1, CARG3
++    |.if FPU
++    |  tonum_i f1, CARG4
++    |.else
++    |  bl ->vm_sfi2d_2
++    |.endif
+     |  b >5
+     |
+     |8: // RA is an integer, RD is not an integer.
+     |  bgt cr1, ->vmeta_comp
+     |  // RA is an integer, RD is a number.
++    |.if FPU
+     |  tonum_i f0, CARG2
++    |.else
++    |  bl ->vm_sfi2d_1
++    |.endif
+     |4:
+-    |  lfd f1, 0(RD)
++    |  .FPU lfd f1, 0(RD)
+     |5:
++    |.if FPU
+     |  fcmpu cr0, f0, f1
++    |.else
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |.endif
+     if (op == BC_ISLT) {
+       |  bge <2
+     } else if (op == BC_ISGE) {
+@@ -3015,42 +3440,42 @@ static void build_ins(BuildCtx *ctx, BCO
+     vk = op == BC_ISEQV;
+     |  // RA = src1*8, RD = src2*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, BASE
+-    |  checknum cr0, TMP0
+-    |    lwz TMP2, -4(PC)
+-    |  checknum cr1, TMP1
+-    |    decode_RD4 TMP2, TMP2
+-    |   lwz CARG3, 4(RD)
++    |  lwzux CARG3, RD, BASE
++    |  checknum cr0, CARG1
++    |    lwz SAVE0, -4(PC)
++    |  checknum cr1, CARG3
++    |    decode_RD4 SAVE0, SAVE0
++    |   lwz CARG4, 4(RD)
+     |  cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     if (vk) {
+       |  ble cr7, ->BC_ISEQN_Z
+     } else {
+       |  ble cr7, ->BC_ISNEN_Z
+     }
+     |.else
+-    |  lwzux TMP0, RA, BASE
+-    |   lwz TMP2, 0(PC)
++    |  lwzux CARG1, RA, BASE
++    |   lwz SAVE0, 0(PC)
+     |    lfd f0, 0(RA)
+     |   addi PC, PC, 4
+-    |  lwzux TMP1, RD, BASE
+-    |  checknum cr0, TMP0
+-    |   decode_RD4 TMP2, TMP2
++    |  lwzux CARG3, RD, BASE
++    |  checknum cr0, CARG1
++    |   decode_RD4 SAVE0, SAVE0
+     |    lfd f1, 0(RD)
+-    |  checknum cr1, TMP1
+-    |   addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  checknum cr1, CARG3
++    |   addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     |  bge cr0, >5
+     |  bge cr1, >5
+     |  fcmpu cr0, f0, f1
+     if (vk) {
+       |  bne >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+     } else {
+       |  beq >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+     }
+     |1:
+     |  ins_next
+@@ -3058,36 +3483,36 @@ static void build_ins(BuildCtx *ctx, BCO
+     |5:  // Either or both types are not numbers.
+     |.if not DUALNUM
+     |    lwz CARG2, 4(RA)
+-    |    lwz CARG3, 4(RD)
++    |    lwz CARG4, 4(RD)
+     |.endif
+     |.if FFI
+-    |  cmpwi cr7, TMP0, LJ_TCDATA
+-    |  cmpwi cr5, TMP1, LJ_TCDATA
++    |  cmpwi cr7, CARG1, LJ_TCDATA
++    |  cmpwi cr5, CARG3, LJ_TCDATA
+     |.endif
+-    |   not TMP3, TMP0
+-    |  cmplw TMP0, TMP1
+-    |   cmplwi cr1, TMP3, ~LJ_TISPRI          // Primitive?
++    |   not TMP2, CARG1
++    |  cmplw CARG1, CARG3
++    |   cmplwi cr1, TMP2, ~LJ_TISPRI          // Primitive?
+     |.if FFI
+     |  cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq
+     |.endif
+-    |   cmplwi cr6, TMP3, ~LJ_TISTABUD                // Table or userdata?
++    |   cmplwi cr6, TMP2, ~LJ_TISTABUD                // Table or userdata?
+     |.if FFI
+     |  beq cr7, ->vmeta_equal_cd
+     |.endif
+-    |    cmplw cr5, CARG2, CARG3
++    |    cmplw cr5, CARG2, CARG4
+     |  crandc 4*cr0+gt, 4*cr0+eq, 4*cr1+gt    // 2: Same type and primitive.
+     |  crorc 4*cr0+lt, 4*cr5+eq, 4*cr0+eq     // 1: Same tv or different type.
+     |  crand 4*cr0+eq, 4*cr0+eq, 4*cr5+eq     // 0: Same type and same tv.
+-    |   mr SAVE0, PC
++    |   mr SAVE1, PC
+     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr0+gt      // 0 or 2.
+     |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+gt      // 1 or 2.
+     if (vk) {
+       |  bne cr0, >6
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |6:
+     } else {
+       |  beq cr0, >6
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |6:
+     }
+     |.if DUALNUM
+@@ -3102,6 +3527,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     |
+     |  // Different tables or userdatas. Need to check __eq metamethod.
+     |  // Field metatable must be at same offset for GCtab and GCudata!
++    |   mr CARG3, CARG4
+     |  lwz TAB:TMP2, TAB:CARG2->metatable
+     |   li CARG4, 1-vk                        // ne = 0 or 1.
+     |  cmplwi TAB:TMP2, 0
+@@ -3109,7 +3535,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lbz TMP2, TAB:TMP2->nomm
+     |  andix. TMP2, TMP2, 1<<MM_eq
+     |  bne <1                         // Or 'no __eq' flag set?
+-    |  mr PC, SAVE0                   // Restore old PC.
++    |  mr PC, SAVE1                   // Restore old PC.
+     |  b ->vmeta_equal                        // Handle __eq metamethod.
+     break;
+@@ -3150,16 +3576,16 @@ static void build_ins(BuildCtx *ctx, BCO
+     vk = op == BC_ISEQN;
+     |  // RA = src*8, RD = num_const*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, KBASE
+-    |  checknum cr0, TMP0
+-    |    lwz TMP2, -4(PC)
+-    |  checknum cr1, TMP1
+-    |    decode_RD4 TMP2, TMP2
+-    |   lwz CARG3, 4(RD)
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  lwzux CARG3, RD, KBASE
++    |  checknum cr0, CARG1
++    |    lwz SAVE0, -4(PC)
++    |  checknum cr1, CARG3
++    |    decode_RD4 SAVE0, SAVE0
++    |   lwz CARG4, 4(RD)
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     if (vk) {
+       |->BC_ISEQN_Z:
+     } else {
+@@ -3167,7 +3593,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     }
+     |  bne cr0, >7
+     |  bne cr1, >8
+-    |   cmpw CARG2, CARG3
++    |   cmpw CARG2, CARG4
+     |4:
+     |.else
+     if (vk) {
+@@ -3175,20 +3601,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     } else {
+       |->BC_ISNEN_Z:  // Dummy label.
+     }
+-    |  lwzx TMP0, BASE, RA
++    |  lwzx CARG1, BASE, RA
+     |    addi PC, PC, 4
+     |   lfdx f0, BASE, RA
+-    |    lwz TMP2, -4(PC)
++    |    lwz SAVE0, -4(PC)
+     |  lfdx f1, KBASE, RD
+-    |    decode_RD4 TMP2, TMP2
+-    |  checknum TMP0
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |    decode_RD4 SAVE0, SAVE0
++    |  checknum CARG1
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     |  bge >3
+     |  fcmpu cr0, f0, f1
+     |.endif
+     if (vk) {
+       |  bne >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |1:
+       |.if not FFI
+       |3:
+@@ -3199,13 +3625,13 @@ static void build_ins(BuildCtx *ctx, BCO
+       |.if not FFI
+       |3:
+       |.endif
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |2:
+     }
+     |  ins_next
+     |.if FFI
+     |3:
+-    |  cmpwi TMP0, LJ_TCDATA
++    |  cmpwi CARG1, LJ_TCDATA
+     |  beq ->vmeta_equal_cd
+     |  b <1
+     |.endif
+@@ -3213,18 +3639,31 @@ static void build_ins(BuildCtx *ctx, BCO
+     |7:  // RA is not an integer.
+     |  bge cr0, <3
+     |  // RA is a number.
+-    |   lfd f0, 0(RA)
++    |   .FPU lfd f0, 0(RA)
+     |  blt cr1, >1
+     |  // RA is a number, RD is an integer.
+-    |  tonum_i f1, CARG3
++    |.if FPU
++    |  tonum_i f1, CARG4
++    |.else
++    |  bl ->vm_sfi2d_2
++    |.endif
+     |  b >2
+     |
+     |8: // RA is an integer, RD is a number.
++    |.if FPU
+     |  tonum_i f0, CARG2
++    |.else
++    |  bl ->vm_sfi2d_1
++    |.endif
+     |1:
+-    |  lfd f1, 0(RD)
++    |  .FPU lfd f1, 0(RD)
+     |2:
++    |.if FPU
+     |  fcmpu cr0, f0, f1
++    |.else
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |.endif
+     |  b <4
+     |.endif
+     break;
+@@ -3279,7 +3718,12 @@ static void build_ins(BuildCtx *ctx, BCO
+       |  add PC, PC, TMP2
+     } else {
+       |  li TMP1, LJ_TFALSE
++      |.if FPU
+       |   lfdx f0, BASE, RD
++      |.else
++      |   lwzux CARG1, RD, BASE
++      |   lwz CARG2, 4(RD)
++      |.endif
+       |  cmplw TMP0, TMP1
+       if (op == BC_ISTC) {
+       |  bge >1
+@@ -3288,7 +3732,12 @@ static void build_ins(BuildCtx *ctx, BCO
+       }
+       |  addis PC, PC, -(BCBIAS_J*4 >> 16)
+       |  decode_RD4 TMP2, INS
++      |.if FPU
+       |   stfdx f0, BASE, RA
++      |.else
++      |   stwux CARG1, RA, BASE
++      |   stw CARG2, 4(RA)
++      |.endif
+       |  add PC, PC, TMP2
+       |1:
+     }
+@@ -3323,8 +3772,15 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_MOV:
+     |  // RA = dst*8, RD = src*8
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, BASE, RD
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, RD, BASE
++    |  lwz TMP1, 4(RD)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_NOT:
+@@ -3426,44 +3882,65 @@ static void build_ins(BuildCtx *ctx, BCO
+     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
+     ||switch (vk) {
+     ||case 0:
+-    |   lwzx TMP1, BASE, RB
++    |   lwzx CARG1, BASE, RB
+     |   .if DUALNUM
+-    |     lwzx TMP2, KBASE, RC
++    |     lwzx CARG3, KBASE, RC
+     |   .endif
++    |   .if FPU
+     |    lfdx f14, BASE, RB
+     |    lfdx f15, KBASE, RC
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, KBASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
+     |   .if DUALNUM
+-    |     checknum cr0, TMP1
+-    |     checknum cr1, TMP2
++    |     checknum cr0, CARG1
++    |     checknum cr1, CARG3
+     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |     bge ->vmeta_arith_vn
+     |   .else
+-    |     checknum TMP1; bge ->vmeta_arith_vn
++    |     checknum CARG1; bge ->vmeta_arith_vn
+     |   .endif
+     ||  break;
+     ||case 1:
+-    |   lwzx TMP1, BASE, RB
++    |   lwzx CARG1, BASE, RB
+     |   .if DUALNUM
+-    |     lwzx TMP2, KBASE, RC
++    |     lwzx CARG3, KBASE, RC
+     |   .endif
++    |   .if FPU
+     |    lfdx f15, BASE, RB
+     |    lfdx f14, KBASE, RC
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, KBASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
+     |   .if DUALNUM
+-    |     checknum cr0, TMP1
+-    |     checknum cr1, TMP2
++    |     checknum cr0, CARG1
++    |     checknum cr1, CARG3
+     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |     bge ->vmeta_arith_nv
+     |   .else
+-    |     checknum TMP1; bge ->vmeta_arith_nv
++    |     checknum CARG1; bge ->vmeta_arith_nv
+     |   .endif
+     ||  break;
+     ||default:
+-    |   lwzx TMP1, BASE, RB
+-    |   lwzx TMP2, BASE, RC
++    |   lwzx CARG1, BASE, RB
++    |   lwzx CARG3, BASE, RC
++    |   .if FPU
+     |    lfdx f14, BASE, RB
+     |    lfdx f15, BASE, RC
+-    |   checknum cr0, TMP1
+-    |   checknum cr1, TMP2
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, BASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
++    |   checknum cr0, CARG1
++    |   checknum cr1, CARG3
+     |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |   bge ->vmeta_arith_vv
+     ||  break;
+@@ -3497,48 +3974,78 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  fsub a, b, a                   // b - floor(b/c)*c
+     |.endmacro
+     |
++    |.macro sfpmod
++    |->BC_MODVN_Z:
++    |  stw CARG1, SFSAVE_1
++    |  stw CARG2, SFSAVE_2
++    |  mr SAVE0, CARG3
++    |  mr SAVE1, CARG4
++    |  blex __divdf3
++    |  blex floor
++    |  mr CARG3, SAVE0
++    |  mr CARG4, SAVE1
++    |  blex __muldf3
++    |  mr CARG3, CRET1
++    |  mr CARG4, CRET2
++    |  lwz CARG1, SFSAVE_1
++    |  lwz CARG2, SFSAVE_2
++    |  blex __subdf3
++    |.endmacro
++    |
+     |.macro ins_arithfp, fpins
+     |  ins_arithpre
+     |.if "fpins" == "fpmod_"
+     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
+-    |.else
++    |.elif FPU
+     |  fpins f0, f14, f15
+     |  ins_next1
+     |  stfdx f0, BASE, RA
+     |  ins_next2
++    |.else
++    |  blex __divdf3                  // Only soft-float div uses this macro.
++    |  ins_next1
++    |  stwux CRET1, RA, BASE
++    |  stw CRET2, 4(RA)
++    |  ins_next2
+     |.endif
+     |.endmacro
+     |
+-    |.macro ins_arithdn, intins, fpins
++    |.macro ins_arithdn, intins, fpins, fpcall
+     |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8
+     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
+     ||switch (vk) {
+     ||case 0:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, KBASE
+-    |    lwz CARG1, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG2, 4(RC)
++    |   lwzux CARG1, RB, BASE
++    |   lwzux CARG3, RC, KBASE
++    |    lwz CARG2, 4(RB)
++    |   checknum cr0, CARG1
++    |    lwz CARG4, 4(RC)
++    |   checknum cr1, CARG3
+     ||  break;
+     ||case 1:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, KBASE
+-    |    lwz CARG2, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG1, 4(RC)
++    |   lwzux CARG3, RB, BASE
++    |   lwzux CARG1, RC, KBASE
++    |    lwz CARG4, 4(RB)
++    |   checknum cr0, CARG3
++    |    lwz CARG2, 4(RC)
++    |   checknum cr1, CARG1
+     ||  break;
+     ||default:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, BASE
+-    |    lwz CARG1, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG2, 4(RC)
++    |   lwzux CARG1, RB, BASE
++    |   lwzux CARG3, RC, BASE
++    |    lwz CARG2, 4(RB)
++    |   checknum cr0, CARG1
++    |    lwz CARG4, 4(RC)
++    |   checknum cr1, CARG3
+     ||  break;
+     ||}
+-    |  checknum cr1, TMP2
+     |  bne >5
+     |  bne cr1, >5
+-    |  intins CARG1, CARG1, CARG2
++    |.if "intins" == "intmod"
++    |  mr CARG1, CARG2
++    |  mr CARG2, CARG4
++    |.endif
++    |  intins CARG1, CARG2, CARG4
+     |  bso >4
+     |1:
+     |  ins_next1
+@@ -3550,29 +4057,40 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  checkov TMP0, <1                       // Ignore unrelated overflow.
+     |  ins_arithfallback b
+     |5:  // FP variant.
++    |.if FPU
+     ||if (vk == 1) {
+     |  lfd f15, 0(RB)
+-    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  lfd f14, 0(RC)
+     ||} else {
+     |  lfd f14, 0(RB)
+-    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  lfd f15, 0(RC)
+     ||}
++    |.endif
++    |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |   ins_arithfallback bge
+     |.if "fpins" == "fpmod_"
+     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
+     |.else
++    |.if FPU
+     |  fpins f0, f14, f15
+-    |  ins_next1
+     |  stfdx f0, BASE, RA
++    |.else
++    |.if "fpcall" == "sfpmod"
++    |  sfpmod
++    |.else
++    |  blex fpcall
++    |.endif
++    |  stwux CRET1, RA, BASE
++    |  stw CRET2, 4(RA)
++    |.endif
++    |  ins_next1
+     |  b <2
+     |.endif
+     |.endmacro
+     |
+-    |.macro ins_arith, intins, fpins
++    |.macro ins_arith, intins, fpins, fpcall
+     |.if DUALNUM
+-    |  ins_arithdn intins, fpins
++    |  ins_arithdn intins, fpins, fpcall
+     |.else
+     |  ins_arithfp fpins
+     |.endif
+@@ -3587,9 +4105,9 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  addo. TMP0, TMP0, TMP3
+     |  add y, a, b
+     |.endmacro
+-    |  ins_arith addo32., fadd
++    |  ins_arith addo32., fadd, __adddf3
+     |.else
+-    |  ins_arith addo., fadd
++    |  ins_arith addo., fadd, __adddf3
+     |.endif
+     break;
+   case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
+@@ -3601,36 +4119,48 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  subo. TMP0, TMP0, TMP3
+     |  sub y, a, b
+     |.endmacro
+-    |  ins_arith subo32., fsub
++    |  ins_arith subo32., fsub, __subdf3
+     |.else
+-    |  ins_arith subo., fsub
++    |  ins_arith subo., fsub, __subdf3
+     |.endif
+     break;
+   case BC_MULVN: case BC_MULNV: case BC_MULVV:
+-    |  ins_arith mullwo., fmul
++    |  ins_arith mullwo., fmul, __muldf3
+     break;
+   case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
+     |  ins_arithfp fdiv
+     break;
+   case BC_MODVN:
+-    |  ins_arith intmod, fpmod
++    |  ins_arith intmod, fpmod, sfpmod
+     break;
+   case BC_MODNV: case BC_MODVV:
+-    |  ins_arith intmod, fpmod_
++    |  ins_arith intmod, fpmod_, sfpmod
+     break;
+   case BC_POW:
+     |  // NYI: (partial) integer arithmetic.
+-    |  lwzx TMP1, BASE, RB
++    |  lwzx CARG1, BASE, RB
++    |  lwzx CARG3, BASE, RC
++    |.if FPU
+     |   lfdx FARG1, BASE, RB
+-    |  lwzx TMP2, BASE, RC
+     |   lfdx FARG2, BASE, RC
+-    |  checknum cr0, TMP1
+-    |  checknum cr1, TMP2
++    |.else
++    |   add TMP1, BASE, RB
++    |   add TMP2, BASE, RC
++    |   lwz CARG2, 4(TMP1)
++    |   lwz CARG4, 4(TMP2)
++    |.endif
++    |  checknum cr0, CARG1
++    |  checknum cr1, CARG3
+     |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  bge ->vmeta_arith_vv
+     |  blex pow
+     |  ins_next1
++    |.if FPU
+     |  stfdx FARG1, BASE, RA
++    |.else
++    |  stwux CARG1, RA, BASE
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -3650,8 +4180,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   lp BASE, L->base
+     |  bne ->vmeta_binop
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, BASE, SAVE0           // Copy result from RB to RA.
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, SAVE0, BASE
++    |  lwz TMP1, 4(SAVE0)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -3714,8 +4251,15 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_KNUM:
+     |  // RA = dst*8, RD = num_const*8
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, KBASE, RD
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, RD, KBASE
++    |  lwz TMP1, 4(RD)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_KPRI:
+@@ -3748,8 +4292,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwzx UPVAL:RB, LFUNC:RB, RD
+     |  ins_next1
+     |  lwz TMP1, UPVAL:RB->v
++    |.if FPU
+     |  lfd f0, 0(TMP1)
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwz TMP2, 0(TMP1)
++    |  lwz TMP3, 4(TMP1)
++    |  stwux TMP2, RA, BASE
++    |  stw TMP3, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_USETV:
+@@ -3757,14 +4308,24 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+     |    srwi RA, RA, 1
+     |    addi RA, RA, offsetof(GCfuncL, uvptr)
++    |.if FPU
+     |   lfdux f0, RD, BASE
++    |.else
++    |   lwzux CARG1, RD, BASE
++    |   lwz CARG3, 4(RD)
++    |.endif
+     |  lwzx UPVAL:RB, LFUNC:RB, RA
+     |  lbz TMP3, UPVAL:RB->marked
+     |   lwz CARG2, UPVAL:RB->v
+     |  andix. TMP3, TMP3, LJ_GC_BLACK // isblack(uv)
+     |    lbz TMP0, UPVAL:RB->closed
+     |   lwz TMP2, 0(RD)
++    |.if FPU
+     |   stfd f0, 0(CARG2)
++    |.else
++    |   stw CARG1, 0(CARG2)
++    |   stw CARG3, 4(CARG2)
++    |.endif
+     |    cmplwi cr1, TMP0, 0
+     |   lwz TMP1, 4(RD)
+     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
+@@ -3820,11 +4381,21 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+     |   srwi RA, RA, 1
+     |   addi RA, RA, offsetof(GCfuncL, uvptr)
++    |.if FPU
+     |    lfdx f0, KBASE, RD
++    |.else
++    |    lwzux TMP2, RD, KBASE
++    |    lwz TMP3, 4(RD)
++    |.endif
+     |  lwzx UPVAL:RB, LFUNC:RB, RA
+     |  ins_next1
+     |  lwz TMP1, UPVAL:RB->v
++    |.if FPU
+     |  stfd f0, 0(TMP1)
++    |.else
++    |  stw TMP2, 0(TMP1)
++    |  stw TMP3, 4(TMP1)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_USETP:
+@@ -3972,11 +4543,21 @@ static void build_ins(BuildCtx *ctx, BCO
+     |.endif
+     |  ble ->vmeta_tgetv              // Integer key and in array part?
+     |  lwzx TMP0, TMP1, TMP2
++    |.if FPU
+     |   lfdx f14, TMP1, TMP2
++    |.else
++    |   lwzux SAVE0, TMP1, TMP2
++    |   lwz SAVE1, 4(TMP1)
++    |.endif
+     |  checknil TMP0; beq >2
+     |1:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, BASE, RA
++    |.else
++    |   stwux SAVE0, RA, BASE
++    |   stw SAVE1, 4(RA)
++    |.endif
+     |  ins_next2
+     |
+     |2:  // Check for __index if table value is nil.
+@@ -4052,12 +4633,22 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz TMP1, TAB:RB->asize
+     |   lwz TMP2, TAB:RB->array
+     |  cmplw TMP0, TMP1; bge ->vmeta_tgetb
++    |.if FPU
+     |  lwzx TMP1, TMP2, RC
+     |   lfdx f0, TMP2, RC
++    |.else
++    |  lwzux TMP1, TMP2, RC
++    |   lwz TMP3, 4(TMP2)
++    |.endif
+     |  checknil TMP1; beq >5
+     |1:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f0, BASE, RA
++    |.else
++    |   stwux TMP1, RA, BASE
++    |   stw TMP3, 4(RA)
++    |.endif
+     |  ins_next2
+     |
+     |5:  // Check for __index if table value is nil.
+@@ -4087,10 +4678,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  cmplw TMP0, CARG2
+     |   slwi TMP2, CARG2, 3
+     |  ble ->vmeta_tgetr              // In array part?
++    |.if FPU
+     |   lfdx f14, TMP1, TMP2
++    |.else
++    |   lwzux SAVE0, TMP2, TMP1
++    |   lwz SAVE1, 4(TMP2)
++    |.endif
+     |->BC_TGETR_Z:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, BASE, RA
++    |.else
++    |   stwux SAVE0, RA, BASE
++    |   stw SAVE1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -4131,11 +4732,22 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  ble ->vmeta_tsetv              // Integer key and in array part?
+     |   lwzx TMP2, TMP1, TMP0
+     |  lbz TMP3, TAB:RB->marked
++    |.if FPU
+     |    lfdx f14, BASE, RA
++    |.else
++    |    add SAVE1, BASE, RA
++    |    lwz SAVE0, 0(SAVE1)
++    |    lwz SAVE1, 4(SAVE1)
++    |.endif
+     |   checknil TMP2; beq >3
+     |1:
+     |  andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |    stfdx f14, TMP1, TMP0
++    |.else
++    |    stwux SAVE0, TMP1, TMP0
++    |    stw SAVE1, 4(TMP1)
++    |.endif
+     |  bne >7
+     |2:
+     |  ins_next
+@@ -4176,7 +4788,13 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz NODE:TMP2, TAB:RB->node
+     |    stb ZERO, TAB:RB->nomm               // Clear metamethod cache.
+     |  and TMP1, TMP1, TMP0           // idx = str->hash & tab->hmask
++    |.if FPU
+     |    lfdx f14, BASE, RA
++    |.else
++    |    add CARG2, BASE, RA
++    |    lwz SAVE0, 0(CARG2)
++    |    lwz SAVE1, 4(CARG2)
++    |.endif
+     |  slwi TMP0, TMP1, 5
+     |  slwi TMP1, TMP1, 3
+     |  sub TMP1, TMP0, TMP1
+@@ -4192,7 +4810,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |    checknil CARG2; beq >4               // Key found, but nil value?
+     |2:
+     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |    stfd f14, NODE:TMP2->val
++    |.else
++    |    stw SAVE0, NODE:TMP2->val.u32.hi
++    |    stw SAVE1, NODE:TMP2->val.u32.lo
++    |.endif
+     |  bne >7
+     |3:
+     |  ins_next
+@@ -4231,7 +4854,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  bl extern lj_tab_newkey                // (lua_State *L, GCtab *t, TValue *k)
+     |  // Returns TValue *.
+     |  lp BASE, L->base
++    |.if FPU
+     |  stfd f14, 0(CRET1)
++    |.else
++    |  stw SAVE0, 0(CRET1)
++    |  stw SAVE1, 4(CRET1)
++    |.endif
+     |  b <3                           // No 2nd write barrier needed.
+     |
+     |7:  // Possible table write barrier for the value. Skip valiswhite check.
+@@ -4248,13 +4876,24 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   lwz TMP2, TAB:RB->array
+     |    lbz TMP3, TAB:RB->marked
+     |  cmplw TMP0, TMP1
++    |.if FPU
+     |   lfdx f14, BASE, RA
++    |.else
++    |   add CARG2, BASE, RA
++    |   lwz SAVE0, 0(CARG2)
++    |   lwz SAVE1, 4(CARG2)
++    |.endif
+     |  bge ->vmeta_tsetb
+     |  lwzx TMP1, TMP2, RC
+     |  checknil TMP1; beq >5
+     |1:
+     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |   stfdx f14, TMP2, RC
++    |.else
++    |   stwux SAVE0, RC, TMP2
++    |   stw SAVE1, 4(RC)
++    |.endif
+     |  bne >7
+     |2:
+     |  ins_next
+@@ -4294,10 +4933,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |2:
+     |  cmplw TMP0, CARG3
+     |   slwi TMP2, CARG3, 3
++    |.if FPU
+     |   lfdx f14, BASE, RA
++    |.else
++    |  lwzux SAVE0, RA, BASE
++    |  lwz SAVE1, 4(RA)
++    |.endif
+     |  ble ->vmeta_tsetr              // In array part?
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, TMP1, TMP2
++    |.else
++    |   stwux SAVE0, TMP1, TMP2
++    |   stw SAVE1, 4(TMP1)
++    |.endif
+     |  ins_next2
+     |
+     |7:  // Possible table write barrier for the value. Skip valiswhite check.
+@@ -4327,10 +4976,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   add TMP1, TMP1, TMP0
+     |    andix. TMP0, TMP3, LJ_GC_BLACK       // isblack(table)
+     |3:  // Copy result slots to table.
++    |.if FPU
+     |   lfd f0, 0(RA)
++    |.else
++    |   lwz SAVE0, 0(RA)
++    |   lwz SAVE1, 4(RA)
++    |.endif
+     |  addi RA, RA, 8
+     |  cmpw cr1, RA, TMP2
++    |.if FPU
+     |   stfd f0, 0(TMP1)
++    |.else
++    |   stw SAVE0, 0(TMP1)
++    |   stw SAVE1, 4(TMP1)
++    |.endif
+     |    addi TMP1, TMP1, 8
+     |  blt cr1, <3
+     |  bne >7
+@@ -4397,9 +5056,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |    beq cr1, >3
+     |2:
+     |  addi TMP3, TMP2, 8
++    |.if FPU
+     |   lfdx f0, RA, TMP2
++    |.else
++    |   add CARG3, RA, TMP2
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmplw cr1, TMP3, NARGS8:RC
++    |.if FPU
+     |   stfdx f0, BASE, TMP2
++    |.else
++    |   stwux CARG1, TMP2, BASE
++    |   stw CARG2, 4(TMP2)
++    |.endif
+     |  mr TMP2, TMP3
+     |  bne cr1, <2
+     |3:
+@@ -4432,14 +5102,28 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  add BASE, BASE, RA
+     |  lwz TMP1, -24(BASE)
+     |   lwz LFUNC:RB, -20(BASE)
++    |.if FPU
+     |    lfd f1, -8(BASE)
+     |    lfd f0, -16(BASE)
++    |.else
++    |    lwz CARG1, -8(BASE)
++    |    lwz CARG2, -4(BASE)
++    |    lwz CARG3, -16(BASE)
++    |    lwz CARG4, -12(BASE)
++    |.endif
+     |  stw TMP1, 0(BASE)              // Copy callable.
+     |   stw LFUNC:RB, 4(BASE)
+     |  checkfunc TMP1
+-    |    stfd f1, 16(BASE)            // Copy control var.
+     |     li NARGS8:RC, 16            // Iterators get 2 arguments.
++    |.if FPU
++    |    stfd f1, 16(BASE)            // Copy control var.
+     |    stfdu f0, 8(BASE)            // Copy state.
++    |.else
++    |    stw CARG1, 16(BASE)          // Copy control var.
++    |    stw CARG2, 20(BASE)
++    |    stwu CARG3, 8(BASE)          // Copy state.
++    |    stw CARG4, 4(BASE)
++    |.endif
+     |  bne ->vmeta_call
+     |  ins_call
+     break;
+@@ -4460,7 +5144,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   slwi TMP3, RC, 3
+     |  bge >5                         // Index points after array part?
+     |  lwzx TMP2, TMP1, TMP3
++    |.if FPU
+     |   lfdx f0, TMP1, TMP3
++    |.else
++    |   lwzux CARG1, TMP3, TMP1
++    |   lwz CARG2, 4(TMP3)
++    |.endif
+     |  checknil TMP2
+     |     lwz INS, -4(PC)
+     |  beq >4
+@@ -4472,7 +5161,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |.endif
+     |    addi RC, RC, 1
+     |     addis TMP3, PC, -(BCBIAS_J*4 >> 16)
++    |.if FPU
+     |  stfd f0, 8(RA)
++    |.else
++    |  stw CARG1, 8(RA)
++    |  stw CARG2, 12(RA)
++    |.endif
+     |     decode_RD4 TMP1, INS
+     |    stw RC, -4(RA)                       // Update control var.
+     |     add PC, TMP1, TMP3
+@@ -4497,17 +5191,38 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   slwi RB, RC, 3
+     |   sub TMP3, TMP3, RB
+     |  lwzx RB, TMP2, TMP3
++    |.if FPU
+     |  lfdx f0, TMP2, TMP3
++    |.else
++    |  add CARG3, TMP2, TMP3
++    |  lwz CARG1, 0(CARG3)
++    |  lwz CARG2, 4(CARG3)
++    |.endif
+     |   add NODE:TMP3, TMP2, TMP3
+     |  checknil RB
+     |     lwz INS, -4(PC)
+     |  beq >7
++    |.if FPU
+     |   lfd f1, NODE:TMP3->key
++    |.else
++    |   lwz CARG3, NODE:TMP3->key.u32.hi
++    |   lwz CARG4, NODE:TMP3->key.u32.lo
++    |.endif
+     |     addis TMP2, PC, -(BCBIAS_J*4 >> 16)
++    |.if FPU
+     |  stfd f0, 8(RA)
++    |.else
++    |  stw CARG1, 8(RA)
++    |  stw CARG2, 12(RA)
++    |.endif
+     |    add RC, RC, TMP0
+     |     decode_RD4 TMP1, INS
++    |.if FPU
+     |   stfd f1, 0(RA)
++    |.else
++    |   stw CARG3, 0(RA)
++    |   stw CARG4, 4(RA)
++    |.endif
+     |    addi RC, RC, 1
+     |     add PC, TMP1, TMP2
+     |    stw RC, -4(RA)                       // Update control var.
+@@ -4573,9 +5288,19 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   subi TMP2, TMP2, 16
+     |   ble >2                                // No vararg slots?
+     |1:  // Copy vararg slots to destination slots.
++    |.if FPU
+     |  lfd f0, 0(RC)
++    |.else
++    |  lwz CARG1, 0(RC)
++    |  lwz CARG2, 4(RC)
++    |.endif
+     |   addi RC, RC, 8
++    |.if FPU
+     |  stfd f0, 0(RA)
++    |.else
++    |  stw CARG1, 0(RA)
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  cmplw RA, TMP2
+     |   cmplw cr1, RC, TMP3
+     |  bge >3                         // All destination slots filled?
+@@ -4598,9 +5323,19 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   addi MULTRES, TMP1, 8
+     |  bgt >7
+     |6:
++    |.if FPU
+     |  lfd f0, 0(RC)
++    |.else
++    |  lwz CARG1, 0(RC)
++    |  lwz CARG2, 4(RC)
++    |.endif
+     |   addi RC, RC, 8
++    |.if FPU
+     |  stfd f0, 0(RA)
++    |.else
++    |  stw CARG1, 0(RA)
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  cmplw RC, TMP3
+     |   addi RA, RA, 8
+     |  blt <6                         // More vararg slots?
+@@ -4651,14 +5386,38 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   li TMP1, 0
+     |2:
+     |  addi TMP3, TMP1, 8
++    |.if FPU
+     |   lfdx f0, RA, TMP1
++    |.else
++    |   add CARG3, RA, TMP1
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmpw TMP3, RC
++    |.if FPU
+     |   stfdx f0, TMP2, TMP1
++    |.else
++    |   add CARG3, TMP2, TMP1
++    |   stw CARG1, 0(CARG3)
++    |   stw CARG2, 4(CARG3)
++    |.endif
+     |  beq >3
+     |  addi TMP1, TMP3, 8
++    |.if FPU
+     |   lfdx f1, RA, TMP3
++    |.else
++    |   add CARG3, RA, TMP3
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmpw TMP1, RC
++    |.if FPU
+     |   stfdx f1, TMP2, TMP3
++    |.else
++    |   add CARG3, TMP2, TMP3
++    |   stw CARG1, 0(CARG3)
++    |   stw CARG2, 4(CARG3)
++    |.endif
+     |  bne <2
+     |3:
+     |5:
+@@ -4700,8 +5459,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   subi TMP2, BASE, 8
+     |  decode_RB8 RB, INS
+     if (op == BC_RET1) {
++      |.if FPU
+       |  lfd f0, 0(RA)
+       |  stfd f0, 0(TMP2)
++      |.else
++      |  lwz CARG1, 0(RA)
++      |  lwz CARG2, 4(RA)
++      |  stw CARG1, 0(TMP2)
++      |  stw CARG2, 4(TMP2)
++      |.endif
+     }
+     |5:
+     |  cmplw RB, RD
+@@ -4762,11 +5528,11 @@ static void build_ins(BuildCtx *ctx, BCO
+       |4:
+       |  stw CARG1, FORL_IDX*8+4(RA)
+     } else {
+-      |  lwz TMP3, FORL_STEP*8(RA)
++      |  lwz SAVE0, FORL_STEP*8(RA)
+       |   lwz CARG3, FORL_STEP*8+4(RA)
+       |  lwz TMP2, FORL_STOP*8(RA)
+       |   lwz CARG2, FORL_STOP*8+4(RA)
+-      |  cmplw cr7, TMP3, TISNUM
++      |  cmplw cr7, SAVE0, TISNUM
+       |  cmplw cr1, TMP2, TISNUM
+       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq
+       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
+@@ -4809,41 +5575,80 @@ static void build_ins(BuildCtx *ctx, BCO
+     if (vk) {
+       |.if DUALNUM
+       |9:  // FP loop.
++      |.if FPU
+       |  lfd f1, FORL_IDX*8(RA)
+       |.else
++      |  lwz CARG1, FORL_IDX*8(RA)
++      |  lwz CARG2, FORL_IDX*8+4(RA)
++      |.endif
++      |.else
+       |  lfdux f1, RA, BASE
+       |.endif
++      |.if FPU
+       |  lfd f3, FORL_STEP*8(RA)
+       |  lfd f2, FORL_STOP*8(RA)
+-      |   lwz TMP3, FORL_STEP*8(RA)
+       |  fadd f1, f1, f3
+       |  stfd f1, FORL_IDX*8(RA)
++      |.else
++      |  lwz CARG3, FORL_STEP*8(RA)
++      |  lwz CARG4, FORL_STEP*8+4(RA)
++      |  mr SAVE1, RD
++      |  blex __adddf3
++      |  mr RD, SAVE1
++      |  stw CRET1, FORL_IDX*8(RA)
++      |  stw CRET2, FORL_IDX*8+4(RA)
++      |  lwz CARG3, FORL_STOP*8(RA)
++      |  lwz CARG4, FORL_STOP*8+4(RA)
++      |.endif
++      |   lwz SAVE0, FORL_STEP*8(RA)
+     } else {
+       |.if DUALNUM
+       |9:  // FP loop.
+       |.else
+       |  lwzux TMP1, RA, BASE
+-      |  lwz TMP3, FORL_STEP*8(RA)
++      |  lwz SAVE0, FORL_STEP*8(RA)
+       |  lwz TMP2, FORL_STOP*8(RA)
+       |  cmplw cr0, TMP1, TISNUM
+-      |  cmplw cr7, TMP3, TISNUM
++      |  cmplw cr7, SAVE0, TISNUM
+       |  cmplw cr1, TMP2, TISNUM
+       |.endif
++      |.if FPU
+       |   lfd f1, FORL_IDX*8(RA)
++      |.else
++      |   lwz CARG1, FORL_IDX*8(RA)
++      |   lwz CARG2, FORL_IDX*8+4(RA)
++      |.endif
+       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt
+       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
++      |.if FPU
+       |   lfd f2, FORL_STOP*8(RA)
++      |.else
++      |   lwz CARG3, FORL_STOP*8(RA)
++      |   lwz CARG4, FORL_STOP*8+4(RA)
++      |.endif
+       |  bge ->vmeta_for
+     }
+-    |  cmpwi cr6, TMP3, 0
++    |  cmpwi cr6, SAVE0, 0
+     if (op != BC_JFORL) {
+       |  srwi RD, RD, 1
+     }
++    |.if FPU
+     |   stfd f1, FORL_EXT*8(RA)
++    |.else
++    |   stw CARG1, FORL_EXT*8(RA)
++    |   stw CARG2, FORL_EXT*8+4(RA)
++    |.endif
+     if (op != BC_JFORL) {
+       |  add RD, PC, RD
+     }
++    |.if FPU
+     |  fcmpu cr0, f1, f2
++    |.else
++    |  mr SAVE1, RD
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |  mr RD, SAVE1
++    |.endif
+     if (op == BC_JFORI) {
+       |  addis PC, RD, -(BCBIAS_J*4 >> 16)
+     }
diff --git a/lang/lua/luajit/patches/050-ppc-softfloat.patch b/lang/lua/luajit/patches/050-ppc-softfloat.patch
new file mode 100644 (file)
index 0000000..68215bb
--- /dev/null
@@ -0,0 +1,744 @@
+From 71b7bc88341945f13f3951e2bb5fd247b639ff7a Mon Sep 17 00:00:00 2001
+From: Mike Pall <mike>
+Date: Sun, 3 Sep 2017 23:20:53 +0200
+Subject: [PATCH] PPC: Add soft-float support to JIT compiler backend.
+
+Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
+Sponsored by Cisco Systems, Inc.
+---
+ src/lj_arch.h    |   1 -
+ src/lj_asm_ppc.h | 321 ++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 278 insertions(+), 44 deletions(-)
+
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -273,7 +273,6 @@
+ #endif
+ #if LJ_ABI_SOFTFP
+-#define LJ_ARCH_NOJIT         1  /* NYI */
+ #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
+ #else
+ #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+--- a/src/lj_asm_ppc.h
++++ b/src/lj_asm_ppc.h
+@@ -226,6 +226,7 @@ static void asm_fusexrefx(ASMState *as,
+   emit_tab(as, pi, rt, left, right);
+ }
++#if !LJ_SOFTFP
+ /* Fuse to multiply-add/sub instruction. */
+ static int asm_fusemadd(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pir)
+ {
+@@ -245,6 +246,7 @@ static int asm_fusemadd(ASMState *as, IR
+   }
+   return 0;
+ }
++#endif
+ /* -- Calls --------------------------------------------------------------- */
+@@ -253,13 +255,17 @@ static void asm_gencall(ASMState *as, co
+ {
+   uint32_t n, nargs = CCI_XNARGS(ci);
+   int32_t ofs = 8;
+-  Reg gpr = REGARG_FIRSTGPR, fpr = REGARG_FIRSTFPR;
++  Reg gpr = REGARG_FIRSTGPR;
++#if !LJ_SOFTFP
++  Reg fpr = REGARG_FIRSTFPR;
++#endif
+   if ((void *)ci->func)
+     emit_call(as, (void *)ci->func);
+   for (n = 0; n < nargs; n++) {  /* Setup args. */
+     IRRef ref = args[n];
+     if (ref) {
+       IRIns *ir = IR(ref);
++#if !LJ_SOFTFP
+       if (irt_isfp(ir->t)) {
+       if (fpr <= REGARG_LASTFPR) {
+         lua_assert(rset_test(as->freeset, fpr));  /* Already evicted. */
+@@ -271,7 +277,9 @@ static void asm_gencall(ASMState *as, co
+         emit_spstore(as, ir, r, ofs);
+         ofs += irt_isnum(ir->t) ? 8 : 4;
+       }
+-      } else {
++      } else
++#endif
++      {
+       if (gpr <= REGARG_LASTGPR) {
+         lua_assert(rset_test(as->freeset, gpr));  /* Already evicted. */
+         ra_leftov(as, gpr, ref);
+@@ -290,8 +298,10 @@ static void asm_gencall(ASMState *as, co
+     }
+     checkmclim(as);
+   }
++#if !LJ_SOFTFP
+   if ((ci->flags & CCI_VARARG))  /* Vararg calls need to know about FPR use. */
+     emit_tab(as, fpr == REGARG_FIRSTFPR ? PPCI_CRXOR : PPCI_CREQV, 6, 6, 6);
++#endif
+ }
+ /* Setup result reg/sp for call. Evict scratch regs. */
+@@ -299,8 +309,10 @@ static void asm_setupresult(ASMState *as
+ {
+   RegSet drop = RSET_SCRATCH;
+   int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
++#if !LJ_SOFTFP
+   if ((ci->flags & CCI_NOFPRCLOBBER))
+     drop &= ~RSET_FPR;
++#endif
+   if (ra_hasreg(ir->r))
+     rset_clear(drop, ir->r);  /* Dest reg handled below. */
+   if (hiop && ra_hasreg((ir+1)->r))
+@@ -308,7 +320,7 @@ static void asm_setupresult(ASMState *as
+   ra_evictset(as, drop);  /* Evictions must be performed first. */
+   if (ra_used(ir)) {
+     lua_assert(!irt_ispri(ir->t));
+-    if (irt_isfp(ir->t)) {
++    if (!LJ_SOFTFP && irt_isfp(ir->t)) {
+       if ((ci->flags & CCI_CASTU64)) {
+       /* Use spill slot or temp slots. */
+       int32_t ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
+@@ -377,6 +389,7 @@ static void asm_retf(ASMState *as, IRIns
+ /* -- Type conversions ---------------------------------------------------- */
++#if !LJ_SOFTFP
+ static void asm_tointg(ASMState *as, IRIns *ir, Reg left)
+ {
+   RegSet allow = RSET_FPR;
+@@ -409,15 +422,23 @@ static void asm_tobit(ASMState *as, IRIn
+   emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);
+   emit_fab(as, PPCI_FADD, tmp, left, right);
+ }
++#endif
+ static void asm_conv(ASMState *as, IRIns *ir)
+ {
+   IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);
++#if !LJ_SOFTFP
+   int stfp = (st == IRT_NUM || st == IRT_FLOAT);
++#endif
+   IRRef lref = ir->op1;
+-  lua_assert(irt_type(ir->t) != st);
+   lua_assert(!(irt_isint64(ir->t) ||
+              (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */
++#if LJ_SOFTFP
++  /* FP conversions are handled by SPLIT. */
++  lua_assert(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT));
++  /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */
++#else
++  lua_assert(irt_type(ir->t) != st);
+   if (irt_isfp(ir->t)) {
+     Reg dest = ra_dest(as, ir, RSET_FPR);
+     if (stfp) {  /* FP to FP conversion. */
+@@ -476,7 +497,9 @@ static void asm_conv(ASMState *as, IRIns
+       emit_fb(as, PPCI_FCTIWZ, tmp, left);
+       }
+     }
+-  } else {
++  } else
++#endif
++  {
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */
+       Reg left = ra_alloc1(as, ir->op1, RSET_GPR);
+@@ -496,17 +519,41 @@ static void asm_strto(ASMState *as, IRIn
+ {
+   const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];
+   IRRef args[2];
+-  int32_t ofs;
++  int32_t ofs = SPOFS_TMP;
++#if LJ_SOFTFP
++  ra_evictset(as, RSET_SCRATCH);
++  if (ra_used(ir)) {
++    if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) &&
++      (ir->s & 1) == LJ_BE && (ir->s ^ 1) == (ir+1)->s) {
++      int i;
++      for (i = 0; i < 2; i++) {
++      Reg r = (ir+i)->r;
++      if (ra_hasreg(r)) {
++        ra_free(as, r);
++        ra_modified(as, r);
++        emit_spload(as, ir+i, r, sps_scale((ir+i)->s));
++      }
++      }
++      ofs = sps_scale(ir->s & ~1);
++    } else {
++      Reg rhi = ra_dest(as, ir+1, RSET_GPR);
++      Reg rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi));
++      emit_tai(as, PPCI_LWZ, rhi, RID_SP, ofs);
++      emit_tai(as, PPCI_LWZ, rlo, RID_SP, ofs+4);
++    }
++  }
++#else
+   RegSet drop = RSET_SCRATCH;
+   if (ra_hasreg(ir->r)) rset_set(drop, ir->r);  /* Spill dest reg (if any). */
+   ra_evictset(as, drop);
++  if (ir->s) ofs = sps_scale(ir->s);
++#endif
+   asm_guardcc(as, CC_EQ);
+   emit_ai(as, PPCI_CMPWI, RID_RET, 0);  /* Test return status. */
+   args[0] = ir->op1;      /* GCstr *str */
+   args[1] = ASMREF_TMP1;  /* TValue *n  */
+   asm_gencall(as, ci, args);
+   /* Store the result to the spill slot or temp slots. */
+-  ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
+   emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs);
+ }
+@@ -530,7 +577,10 @@ static void asm_tvptr(ASMState *as, Reg
+       Reg src = ra_alloc1(as, ref, allow);
+       emit_setgl(as, src, tmptv.gcr);
+     }
+-    type = ra_allock(as, irt_toitype(ir->t), allow);
++    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
++      type = ra_alloc1(as, ref+1, allow);
++    else
++      type = ra_allock(as, irt_toitype(ir->t), allow);
+     emit_setgl(as, type, tmptv.it);
+   }
+ }
+@@ -574,11 +624,27 @@ static void asm_href(ASMState *as, IRIns
+   Reg tisnum = RID_NONE, tmpnum = RID_NONE;
+   IRRef refkey = ir->op2;
+   IRIns *irkey = IR(refkey);
++  int isk = irref_isk(refkey);
+   IRType1 kt = irkey->t;
+   uint32_t khash;
+   MCLabel l_end, l_loop, l_next;
+   rset_clear(allow, tab);
++#if LJ_SOFTFP
++  if (!isk) {
++    key = ra_alloc1(as, refkey, allow);
++    rset_clear(allow, key);
++    if (irkey[1].o == IR_HIOP) {
++      if (ra_hasreg((irkey+1)->r)) {
++      tmpnum = (irkey+1)->r;
++      ra_noweak(as, tmpnum);
++      } else {
++      tmpnum = ra_allocref(as, refkey+1, allow);
++      }
++      rset_clear(allow, tmpnum);
++    }
++  }
++#else
+   if (irt_isnum(kt)) {
+     key = ra_alloc1(as, refkey, RSET_FPR);
+     tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));
+@@ -588,6 +654,7 @@ static void asm_href(ASMState *as, IRIns
+     key = ra_alloc1(as, refkey, allow);
+     rset_clear(allow, key);
+   }
++#endif
+   tmp2 = ra_scratch(as, allow);
+   rset_clear(allow, tmp2);
+@@ -610,7 +677,7 @@ static void asm_href(ASMState *as, IRIns
+     asm_guardcc(as, CC_EQ);
+   else
+     emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);
+-  if (irt_isnum(kt)) {
++  if (!LJ_SOFTFP && irt_isnum(kt)) {
+     emit_fab(as, PPCI_FCMPU, 0, tmpnum, key);
+     emit_condbranch(as, PPCI_BC, CC_GE, l_next);
+     emit_ab(as, PPCI_CMPLW, tmp1, tisnum);
+@@ -620,7 +687,10 @@ static void asm_href(ASMState *as, IRIns
+       emit_ab(as, PPCI_CMPW, tmp2, key);
+       emit_condbranch(as, PPCI_BC, CC_NE, l_next);
+     }
+-    emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
++    if (LJ_SOFTFP && ra_hasreg(tmpnum))
++      emit_ab(as, PPCI_CMPW, tmp1, tmpnum);
++    else
++      emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
+     if (!irt_ispri(kt))
+       emit_tai(as, PPCI_LWZ, tmp2, dest, (int32_t)offsetof(Node, key.gcr));
+   }
+@@ -629,19 +699,19 @@ static void asm_href(ASMState *as, IRIns
+           (((char *)as->mcp-(char *)l_loop) & 0xffffu);
+   /* Load main position relative to tab->node into dest. */
+-  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;
++  khash = isk ? ir_khash(irkey) : 1;
+   if (khash == 0) {
+     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
+   } else {
+     Reg tmphash = tmp1;
+-    if (irref_isk(refkey))
++    if (isk)
+       tmphash = ra_allock(as, khash, allow);
+     emit_tab(as, PPCI_ADD, dest, dest, tmp1);
+     emit_tai(as, PPCI_MULLI, tmp1, tmp1, sizeof(Node));
+     emit_asb(as, PPCI_AND, tmp1, tmp2, tmphash);
+     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
+     emit_tai(as, PPCI_LWZ, tmp2, tab, (int32_t)offsetof(GCtab, hmask));
+-    if (irref_isk(refkey)) {
++    if (isk) {
+       /* Nothing to do. */
+     } else if (irt_isstr(kt)) {
+       emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, hash));
+@@ -651,13 +721,19 @@ static void asm_href(ASMState *as, IRIns
+       emit_asb(as, PPCI_XOR, tmp1, tmp1, tmp2);
+       emit_rotlwi(as, tmp1, tmp1, (HASH_ROT2+HASH_ROT1)&31);
+       emit_tab(as, PPCI_SUBF, tmp2, dest, tmp2);
+-      if (irt_isnum(kt)) {
++      if (LJ_SOFTFP ? (irkey[1].o == IR_HIOP) : irt_isnum(kt)) {
++#if LJ_SOFTFP
++      emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
++      emit_rotlwi(as, dest, tmp1, HASH_ROT1);
++      emit_tab(as, PPCI_ADD, tmp1, tmpnum, tmpnum);
++#else
+       int32_t ofs = ra_spill(as, irkey);
+       emit_asb(as, PPCI_XOR, tmp2, tmp2, tmp1);
+       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
+       emit_tab(as, PPCI_ADD, tmp1, tmp1, tmp1);
+       emit_tai(as, PPCI_LWZ, tmp2, RID_SP, ofs+4);
+       emit_tai(as, PPCI_LWZ, tmp1, RID_SP, ofs);
++#endif
+       } else {
+       emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
+       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
+@@ -784,8 +860,8 @@ static PPCIns asm_fxloadins(IRIns *ir)
+   case IRT_U8: return PPCI_LBZ;
+   case IRT_I16: return PPCI_LHA;
+   case IRT_U16: return PPCI_LHZ;
+-  case IRT_NUM: return PPCI_LFD;
+-  case IRT_FLOAT: return PPCI_LFS;
++  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_LFD;
++  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_LFS;
+   default: return PPCI_LWZ;
+   }
+ }
+@@ -795,8 +871,8 @@ static PPCIns asm_fxstoreins(IRIns *ir)
+   switch (irt_type(ir->t)) {
+   case IRT_I8: case IRT_U8: return PPCI_STB;
+   case IRT_I16: case IRT_U16: return PPCI_STH;
+-  case IRT_NUM: return PPCI_STFD;
+-  case IRT_FLOAT: return PPCI_STFS;
++  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_STFD;
++  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_STFS;
+   default: return PPCI_STW;
+   }
+ }
+@@ -839,7 +915,8 @@ static void asm_fstore(ASMState *as, IRI
+ static void asm_xload(ASMState *as, IRIns *ir)
+ {
+-  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
++  Reg dest = ra_dest(as, ir,
++    (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
+   lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));
+   if (irt_isi8(ir->t))
+     emit_as(as, PPCI_EXTSB, dest, dest);
+@@ -857,7 +934,8 @@ static void asm_xstore_(ASMState *as, IR
+     Reg src = ra_alloc1(as, irb->op1, RSET_GPR);
+     asm_fusexrefx(as, PPCI_STWBRX, src, ir->op1, rset_exclude(RSET_GPR, src));
+   } else {
+-    Reg src = ra_alloc1(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
++    Reg src = ra_alloc1(as, ir->op2,
++      (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
+     asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,
+                rset_exclude(RSET_GPR, src), ofs);
+   }
+@@ -871,10 +949,19 @@ static void asm_ahuvload(ASMState *as, I
+   Reg dest = RID_NONE, type = RID_TMP, tmp = RID_TMP, idx;
+   RegSet allow = RSET_GPR;
+   int32_t ofs = AHUREF_LSX;
++  if (LJ_SOFTFP && (ir+1)->o == IR_HIOP) {
++    t.irt = IRT_NUM;
++    if (ra_used(ir+1)) {
++      type = ra_dest(as, ir+1, allow);
++      rset_clear(allow, type);
++    }
++    ofs = 0;
++  }
+   if (ra_used(ir)) {
+-    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
+-    if (!irt_isnum(t)) ofs = 0;
+-    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
++    lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) ||
++             irt_isint(ir->t) || irt_isaddr(ir->t));
++    if (LJ_SOFTFP || !irt_isnum(t)) ofs = 0;
++    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
+     rset_clear(allow, dest);
+   }
+   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
+@@ -883,12 +970,13 @@ static void asm_ahuvload(ASMState *as, I
+     asm_guardcc(as, CC_GE);
+     emit_ab(as, PPCI_CMPLW, type, tisnum);
+     if (ra_hasreg(dest)) {
+-      if (ofs == AHUREF_LSX) {
++      if (!LJ_SOFTFP && ofs == AHUREF_LSX) {
+       tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR,
+                                                      (idx&255)), (idx>>8)));
+       emit_fab(as, PPCI_LFDX, dest, (idx&255), tmp);
+       } else {
+-      emit_fai(as, PPCI_LFD, dest, idx, ofs);
++      emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest, idx,
++               ofs+4*LJ_SOFTFP);
+       }
+     }
+   } else {
+@@ -911,7 +999,7 @@ static void asm_ahustore(ASMState *as, I
+   int32_t ofs = AHUREF_LSX;
+   if (ir->r == RID_SINK)
+     return;
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     src = ra_alloc1(as, ir->op2, RSET_FPR);
+   } else {
+     if (!irt_ispri(ir->t)) {
+@@ -919,11 +1007,14 @@ static void asm_ahustore(ASMState *as, I
+       rset_clear(allow, src);
+       ofs = 0;
+     }
+-    type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
++    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
++      type = ra_alloc1(as, (ir+1)->op2, allow);
++    else
++      type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
+     rset_clear(allow, type);
+   }
+   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     if (ofs == AHUREF_LSX) {
+       emit_fab(as, PPCI_STFDX, src, (idx&255), RID_TMP);
+       emit_slwi(as, RID_TMP, (idx>>8), 3);
+@@ -948,21 +1039,33 @@ static void asm_sload(ASMState *as, IRIn
+   IRType1 t = ir->t;
+   Reg dest = RID_NONE, type = RID_NONE, base;
+   RegSet allow = RSET_GPR;
++  int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);
++  if (hiop)
++    t.irt = IRT_NUM;
+   lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */
+-  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));
++  lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK));
+   lua_assert(LJ_DUALNUM ||
+            !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));
++#if LJ_SOFTFP
++  lua_assert(!(ir->op2 & IRSLOAD_CONVERT));  /* Handled by LJ_SOFTFP SPLIT. */
++  if (hiop && ra_used(ir+1)) {
++    type = ra_dest(as, ir+1, allow);
++    rset_clear(allow, type);
++  }
++#else
+   if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {
+     dest = ra_scratch(as, RSET_FPR);
+     asm_tointg(as, ir, dest);
+     t.irt = IRT_NUM;  /* Continue with a regular number type check. */
+-  } else if (ra_used(ir)) {
++  } else
++#endif
++  if (ra_used(ir)) {
+     lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
+-    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
++    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
+     rset_clear(allow, dest);
+     base = ra_alloc1(as, REF_BASE, allow);
+     rset_clear(allow, base);
+-    if ((ir->op2 & IRSLOAD_CONVERT)) {
++    if (!LJ_SOFTFP && (ir->op2 & IRSLOAD_CONVERT)) {
+       if (irt_isint(t)) {
+       emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);
+       dest = ra_scratch(as, RSET_FPR);
+@@ -994,10 +1097,13 @@ dotypecheck:
+     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
+       Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow);
+       asm_guardcc(as, CC_GE);
+-      emit_ab(as, PPCI_CMPLW, RID_TMP, tisnum);
++#if !LJ_SOFTFP
+       type = RID_TMP;
++#endif
++      emit_ab(as, PPCI_CMPLW, type, tisnum);
+     }
+-    if (ra_hasreg(dest)) emit_fai(as, PPCI_LFD, dest, base, ofs-4);
++    if (ra_hasreg(dest)) emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest,
++                                base, ofs-(LJ_SOFTFP?0:4));
+   } else {
+     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
+       asm_guardcc(as, CC_NE);
+@@ -1119,6 +1225,7 @@ static void asm_obar(ASMState *as, IRIns
+ /* -- Arithmetic and logic operations ------------------------------------- */
++#if !LJ_SOFTFP
+ static void asm_fparith(ASMState *as, IRIns *ir, PPCIns pi)
+ {
+   Reg dest = ra_dest(as, ir, RSET_FPR);
+@@ -1146,13 +1253,17 @@ static void asm_fpmath(ASMState *as, IRI
+   else
+     asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
+ }
++#endif
+ static void asm_add(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD))
+       asm_fparith(as, ir, PPCI_FADD);
+-  } else {
++  } else
++#endif
++  {
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
+     PPCIns pi;
+@@ -1191,10 +1302,13 @@ static void asm_add(ASMState *as, IRIns
+ static void asm_sub(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB))
+       asm_fparith(as, ir, PPCI_FSUB);
+-  } else {
++  } else
++#endif
++  {
+     PPCIns pi = PPCI_SUBF;
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg left, right;
+@@ -1220,9 +1334,12 @@ static void asm_sub(ASMState *as, IRIns
+ static void asm_mul(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     asm_fparith(as, ir, PPCI_FMUL);
+-  } else {
++  } else
++#endif
++  {
+     PPCIns pi = PPCI_MULLW;
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
+@@ -1250,9 +1367,12 @@ static void asm_mul(ASMState *as, IRIns
+ static void asm_neg(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     asm_fpunary(as, ir, PPCI_FNEG);
+-  } else {
++  } else
++#endif
++  {
+     Reg dest, left;
+     PPCIns pi = PPCI_NEG;
+     if (as->flagmcp == as->mcp) {
+@@ -1563,9 +1683,40 @@ static void asm_bitshift(ASMState *as, I
+                      PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31))
+ #define asm_bror(as, ir)      lua_assert(0)
++#if LJ_SOFTFP
++static void asm_sfpmin_max(ASMState *as, IRIns *ir)
++{
++  CCallInfo ci = lj_ir_callinfo[IRCALL_softfp_cmp];
++  IRRef args[4];
++  MCLabel l_right, l_end;
++  Reg desthi = ra_dest(as, ir, RSET_GPR), destlo = ra_dest(as, ir+1, RSET_GPR);
++  Reg righthi, lefthi = ra_alloc2(as, ir, RSET_GPR);
++  Reg rightlo, leftlo = ra_alloc2(as, ir+1, RSET_GPR);
++  PPCCC cond = (IROp)ir->o == IR_MIN ? CC_EQ : CC_NE;
++  righthi = (lefthi >> 8); lefthi &= 255;
++  rightlo = (leftlo >> 8); leftlo &= 255;
++  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
++  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
++  l_end = emit_label(as);
++  if (desthi != righthi) emit_mr(as, desthi, righthi);
++  if (destlo != rightlo) emit_mr(as, destlo, rightlo);
++  l_right = emit_label(as);
++  if (l_end != l_right) emit_jmp(as, l_end);
++  if (desthi != lefthi) emit_mr(as, desthi, lefthi);
++  if (destlo != leftlo) emit_mr(as, destlo, leftlo);
++  if (l_right == as->mcp+1) {
++    cond ^= 4; l_right = l_end; ++as->mcp;
++  }
++  emit_condbranch(as, PPCI_BC, cond, l_right);
++  ra_evictset(as, RSET_SCRATCH);
++  emit_cmpi(as, RID_RET, 1);
++  asm_gencall(as, &ci, args);
++}
++#endif
++
+ static void asm_min_max(ASMState *as, IRIns *ir, int ismax)
+ {
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     Reg dest = ra_dest(as, ir, RSET_FPR);
+     Reg tmp = dest;
+     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
+@@ -1653,7 +1804,7 @@ static void asm_intcomp_(ASMState *as, I
+ static void asm_comp(ASMState *as, IRIns *ir)
+ {
+   PPCCC cc = asm_compmap[ir->o];
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
+     right = (left >> 8); left &= 255;
+     asm_guardcc(as, (cc >> 4));
+@@ -1674,6 +1825,44 @@ static void asm_comp(ASMState *as, IRIns
+ #define asm_equal(as, ir)     asm_comp(as, ir)
++#if LJ_SOFTFP
++/* SFP comparisons. */
++static void asm_sfpcomp(ASMState *as, IRIns *ir)
++{
++  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp];
++  RegSet drop = RSET_SCRATCH;
++  Reg r;
++  IRRef args[4];
++  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
++  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
++
++  for (r = REGARG_FIRSTGPR; r <= REGARG_FIRSTGPR+3; r++) {
++    if (!rset_test(as->freeset, r) &&
++      regcost_ref(as->cost[r]) == args[r-REGARG_FIRSTGPR])
++      rset_clear(drop, r);
++  }
++  ra_evictset(as, drop);
++  asm_setupresult(as, ir, ci);
++  switch ((IROp)ir->o) {
++  case IR_ULT:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
++  case IR_ULE:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 1);
++    break;
++  case IR_GE: case IR_GT:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 2);
++  default:
++    asm_guardcc(as, (asm_compmap[ir->o] & 0xf));
++    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
++    break;
++  }
++  asm_gencall(as, ci, args);
++}
++#endif
++
+ #if LJ_HASFFI
+ /* 64 bit integer comparisons. */
+ static void asm_comp64(ASMState *as, IRIns *ir)
+@@ -1703,19 +1892,36 @@ static void asm_comp64(ASMState *as, IRI
+ /* Hiword op of a split 64 bit op. Previous op must be the loword op. */
+ static void asm_hiop(ASMState *as, IRIns *ir)
+ {
+-#if LJ_HASFFI
++#if LJ_HASFFI || LJ_SOFTFP
+   /* HIOP is marked as a store because it needs its own DCE logic. */
+   int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */
+   if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;
+   if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */
+     as->curins--;  /* Always skip the CONV. */
++#if LJ_HASFFI && !LJ_SOFTFP
+     if (usehi || uselo)
+       asm_conv64(as, ir);
+     return;
++#endif
+   } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */
+     as->curins--;  /* Always skip the loword comparison. */
++#if LJ_SOFTFP
++    if (!irt_isint(ir->t)) {
++      asm_sfpcomp(as, ir-1);
++      return;
++    }
++#endif
++#if LJ_HASFFI
+     asm_comp64(as, ir);
++#endif
++    return;
++#if LJ_SOFTFP
++  } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) {
++      as->curins--;  /* Always skip the loword min/max. */
++    if (uselo || usehi)
++      asm_sfpmin_max(as, ir-1);
+     return;
++#endif
+   } else if ((ir-1)->o == IR_XSTORE) {
+     as->curins--;  /* Handle both stores here. */
+     if ((ir-1)->r != RID_SINK) {
+@@ -1726,14 +1932,27 @@ static void asm_hiop(ASMState *as, IRIns
+   }
+   if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */
+   switch ((ir-1)->o) {
++#if LJ_HASFFI
+   case IR_ADD: as->curins--; asm_add64(as, ir); break;
+   case IR_SUB: as->curins--; asm_sub64(as, ir); break;
+   case IR_NEG: as->curins--; asm_neg64(as, ir); break;
++#endif
++#if LJ_SOFTFP
++  case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:
++  case IR_STRTO:
++    if (!uselo)
++      ra_allocref(as, ir->op1, RSET_GPR);  /* Mark lo op as used. */
++    break;
++#endif
+   case IR_CALLN:
++  case IR_CALLS:
+   case IR_CALLXS:
+     if (!uselo)
+       ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */
+     break;
++#if LJ_SOFTFP
++  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR:
++#endif
+   case IR_CNEWI:
+     /* Nothing to do here. Handled by lo op itself. */
+     break;
+@@ -1797,8 +2016,19 @@ static void asm_stack_restore(ASMState *
+     if ((sn & SNAP_NORESTORE))
+       continue;
+     if (irt_isnum(ir->t)) {
++#if LJ_SOFTFP
++      Reg tmp;
++      RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
++      lua_assert(irref_isk(ref));  /* LJ_SOFTFP: must be a number constant. */
++      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, allow);
++      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?4:0));
++      if (rset_test(as->freeset, tmp+1)) allow = RID2RSET(tmp+1);
++      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, allow);
++      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?0:4));
++#else
+       Reg src = ra_alloc1(as, ref, RSET_FPR);
+       emit_fai(as, PPCI_STFD, src, RID_BASE, ofs);
++#endif
+     } else {
+       Reg type;
+       RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
+@@ -1811,6 +2041,10 @@ static void asm_stack_restore(ASMState *
+       if ((sn & (SNAP_CONT|SNAP_FRAME))) {
+       if (s == 0) continue;  /* Do not overwrite link to previous frame. */
+       type = ra_allock(as, (int32_t)(*flinks--), allow);
++#if LJ_SOFTFP
++      } else if ((sn & SNAP_SOFTFPNUM)) {
++      type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPR, RID_BASE));
++#endif
+       } else {
+       type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
+       }
+@@ -1947,14 +2181,15 @@ static Reg asm_setup_call_slots(ASMState
+   int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;
+   asm_collectargs(as, ir, ci, args);
+   for (i = 0; i < nargs; i++)
+-    if (args[i] && irt_isfp(IR(args[i])->t)) {
++    if (!LJ_SOFTFP && args[i] && irt_isfp(IR(args[i])->t)) {
+       if (nfpr > 0) nfpr--; else nslots = (nslots+3) & ~1;
+     } else {
+       if (ngpr > 0) ngpr--; else nslots++;
+     }
+   if (nslots > as->evenspill)  /* Leave room for args in stack slots. */
+     as->evenspill = nslots;
+-  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);
++  return (!LJ_SOFTFP && irt_isfp(ir->t)) ? REGSP_HINT(RID_FPRET) :
++                                         REGSP_HINT(RID_RET);
+ }
+ static void asm_setup_target(ASMState *as)
diff --git a/lang/lua/luajit/patches/060-ppc-musl.patch b/lang/lua/luajit/patches/060-ppc-musl.patch
new file mode 100644 (file)
index 0000000..119fedd
--- /dev/null
@@ -0,0 +1,112 @@
+From 195e0be62c0aa0f6aaf63a93ee322bb0a630576c Mon Sep 17 00:00:00 2001
+From: Clint Bland <[email protected]>
+Date: Wed, 13 Mar 2019 19:19:16 -0700
+Subject: [PATCH] Have powerpc use fake GOT like MIPS
+
+---
+ src/lj_dispatch.c | 15 +++++++++++++++
+ src/lj_dispatch.h | 29 ++++++++++++++++++++++++++++-
+ src/vm_ppc.dasc   |  9 ++++++++-
+ 3 files changed, 51 insertions(+), 2 deletions(-)
+
+--- a/src/lj_dispatch.c
++++ b/src/lj_dispatch.c
+@@ -56,6 +56,18 @@ static const ASMFunction dispatch_got[]
+ #undef GOTFUNC
+ #endif
++#if LJ_TARGET_PPC
++#include <math.h>
++LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,
++                                                        lua_State *co);
++
++#define GOTFUNC(name) (ASMFunction)name,
++static const ASMFunction dispatch_got[] = {
++  GOTDEF(GOTFUNC)
++};
++#undef GOTFUNC
++#endif
++
+ /* Initialize instruction dispatch table and hot counters. */
+ void lj_dispatch_init(GG_State *GG)
+ {
+@@ -77,6 +89,9 @@ void lj_dispatch_init(GG_State *GG)
+ #if LJ_TARGET_MIPS
+   memcpy(GG->got, dispatch_got, LJ_GOT__MAX*sizeof(ASMFunction *));
+ #endif
++#if LJ_TARGET_PPC
++  memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);
++#endif
+ }
+ #if LJ_HASJIT
+--- a/src/lj_dispatch.h
++++ b/src/lj_dispatch.h
+@@ -66,6 +66,33 @@ GOTDEF(GOTENUM)
+ };
+ #endif
++#if LJ_TARGET_PPC
++/* Need our own global offset table for the dreaded MIPS calling conventions. */
++#if LJ_SOFTFP
++#ifndef _LJ_IRCALL_H
++extern double __ledf2(double a, double b);
++extern double __adddf3(double a, double b);
++extern double __subdf3(double a, double b);
++extern double __muldf3(double a, double b);
++extern double __divdf3(double a, double b);
++#endif
++#define SFGOTDEF(_)   _(__ledf2) _(__adddf3) _(__subdf3) _(__muldf3) _(__divdf3)
++#else
++#define SFGOTDEF(_)
++#endif
++#define GOTDEF(_) \
++  _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \
++  _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \
++  _(pow) _(fmod) _(ldexp) _(sqrt) SFGOTDEF(_)
++
++enum {
++#define GOTENUM(name) LJ_GOT_##name,
++GOTDEF(GOTENUM)
++#undef GOTENUM
++  LJ_GOT__MAX
++};
++#endif
++
+ /* Type of hot counter. Must match the code in the assembler VM. */
+ /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */
+ typedef uint16_t HotCount;
+@@ -89,7 +116,7 @@ typedef uint16_t HotCount;
+ typedef struct GG_State {
+   lua_State L;                                /* Main thread. */
+   global_State g;                     /* Global state. */
+-#if LJ_TARGET_MIPS
++#if LJ_TARGET_MIPS || LJ_TARGET_PPC
+   ASMFunction got[LJ_GOT__MAX];               /* Global offset table. */
+ #endif
+ #if LJ_HASJIT
+--- a/src/vm_ppc.dasc
++++ b/src/vm_ppc.dasc
+@@ -59,7 +59,12 @@
+ |.define ENV_OFS,     8
+ |.endif
+ |.else  // No TOC.
+-|.macro blex, target; bl extern target@plt; .endmacro
++|.macro blex, target
++|  lwz TMP0, DISPATCH_GOT(target)(DISPATCH)
++|  mtctr TMP0
++|  bctrl
++|  //bl extern target@plt
++|.endmacro
+ |.macro .toc, a, b; .endmacro
+ |.endif
+ |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro
+@@ -482,6 +487,8 @@
+ |// Assumes DISPATCH is relative to GL.
+ #define DISPATCH_GL(field)    (GG_DISP2G + (int)offsetof(global_State, field))
+ #define DISPATCH_J(field)     (GG_DISP2J + (int)offsetof(jit_State, field))
++#define GG_DISP2GOT           (GG_OFS(got) - GG_OFS(dispatch))
++#define DISPATCH_GOT(name)    (GG_DISP2GOT + 4*LJ_GOT_##name)
+ |
+ #define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))
+ |
diff --git a/lang/lua/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch b/lang/lua/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch
new file mode 100644 (file)
index 0000000..e63c5dd
--- /dev/null
@@ -0,0 +1,58 @@
+From 2c8b9d5807a515a0ff859899065f512beabcbaed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C5=A0imon=20Bo=C5=99ek?= <[email protected]>
+Date: Sat, 16 Jul 2022 18:39:55 +0200
+Subject: [PATCH] PPC/e500 with SPE enabled: use soft float instead of failing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows building LuaJit for systems with Power ISA SPE
+extension[^1] support by using soft float on LuaJit side.
+
+While e500 CPU cores support SPE instruction set extension
+allowing them to perform floating point arithmetic natively,
+this isn't required. They can function with software floating
+point to integer arithmetic translation as well,
+just like FPU-less PowerPC CPUs without SPE support.
+
+Therefore I see no need to prevent them from running LuaJit
+explicitly.
+
+[^1]: https://www.nxp.com/docs/en/reference-manual/SPEPEM.pdf
+
+Signed-off-by: Pali Rohár <[email protected]>
+Signed-off-by: Å imon BoÅ™ek <[email protected]>
+---
+ src/lj_arch.h | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -256,7 +256,7 @@
+ #define LJ_ARCH_NAME          "ppc"
+ #if !defined(LJ_ARCH_HASFPU)
+-#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
+ #define LJ_ARCH_HASFPU                0
+ #else
+ #define LJ_ARCH_HASFPU                1
+@@ -264,7 +264,7 @@
+ #endif
+ #if !defined(LJ_ABI_SOFTFP)
+-#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
+ #define LJ_ABI_SOFTFP         1
+ #else
+ #define LJ_ABI_SOFTFP         0
+@@ -442,9 +442,6 @@
+ #if LJ_ARCH_PPC64
+ #error "No support for PowerPC 64 bit mode (yet)"
+ #endif
+-#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
+-#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
+-#endif
+ #elif LJ_TARGET_MIPS32
+ #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32))
+ #error "Only o32 ABI supported for MIPS32"
diff --git a/lang/lua/luajit2/Makefile b/lang/lua/luajit2/Makefile
new file mode 100644 (file)
index 0000000..5e74097
--- /dev/null
@@ -0,0 +1,97 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luajit2
+PKG_SOURCE_DATE:=2025-10-30
+PKG_VERSION:=2.1.$(subst -,.,$(PKG_SOURCE_DATE))
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/openresty/luajit2
+PKG_MIRROR_HASH:=7b986a40ef091df5168eaa8b2012d3a95110fafeb69a7c199e3fca9795bae631
+PKG_SOURCE_VERSION:=71fae383f6c4637d64b03a6d0ec76ae8c19d6821
+
+PKG_MAINTAINER:=Javier Marcet <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+
+PKG_BUILD_FLAGS:=no-mips16
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+# HAS_LUAJIT_ARCH config is defined in luajit and is used to define
+# arch deoendency for luajit. Since luajit2 is an improved version of
+# luajit, they share the same arch dependency. Refer there to update
+# dependency for them.
+define Package/luajit2
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Lua
+ TITLE:=LuaJIT from OpenResty
+ URL:=https://www.luajit.org
+ DEPENDS:=@HAS_LUAJIT_ARCH
+ PROVIDES:=luajit
+endef
+
+define Package/luajit2/description
+ OpenResty's maintained branch of LuaJIT, a Just-In-Time (JIT) compiler for the Lua programming language
+endef
+
+ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
+  ifeq ($(CONFIG_ARCH_64BIT),)
+    HOST_BITS := -m32
+  endif
+endif
+
+define Build/Compile
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
+               CROSS="$(TARGET_CROSS)" \
+               DESTDIR=$(PKG_INSTALL_DIR) \
+               PREFIX=/usr \
+               TARGET_SYS=Linux \
+               TARGET_CFLAGS="$(TARGET_CFLAGS)" \
+               BUILDMODE=dynamic
+       $(RM) -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR=$(PKG_INSTALL_DIR) \
+               PREFIX=/usr \
+               TARGET_SYS=Linux \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
+endef
+
+define Package/luajit2/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
+endef
+
+define Host/Compile
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               TARGET_CFLAGS="$(HOST_CFLAGS)" \
+               TARGET_LDFLAGS="$(HOST_LDFLAGS)"
+endef
+
+define Host/Install
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               install
+       $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-* $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild,luajit2))
+$(eval $(call BuildPackage,luajit2))
diff --git a/lang/lua/luajit2/patches/010-lua-path.patch b/lang/lua/luajit2/patches/010-lua-path.patch
new file mode 100644 (file)
index 0000000..f9658dc
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -34,8 +34,8 @@
+ #ifndef LUA_LMULTILIB
+ #define LUA_LMULTILIB "lib"
+ #endif
+-#define LUA_LROOT     "/usr/local"
+-#define LUA_LUADIR    "/lua/5.1/"
++#define LUA_LROOT     "/usr"
++#define LUA_LUADIR    "/lua/"
+ #ifdef LUA_ROOT
+ #define LUA_JROOT     LUA_ROOT
diff --git a/lang/lua/lualanes/Makefile b/lang/lua/lualanes/Makefile
new file mode 100644 (file)
index 0000000..764b8dd
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lualanes
+PKG_VERSION:=3.16.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/LuaLanes/lanes/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=22cfa836de4be14fe588b9cd34e936d6f61ec6f4096d8ae30d4ec35855d9608f
+PKG_BUILD_DIR:=$(BUILD_DIR)/lanes-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Vladimir Malyutin <[email protected]>
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYRIGHT
+
+PKG_BUILD_DEPENDS:=lua/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lualanes
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=LuaLanes
+       URL:=http://lualanes.github.io/lanes/
+       DEPENDS:=+lua +luac +liblua +libpthread
+endef
+
+define Package/lualanes/description
+Lua Lanes is a Lua extension library providing the possibility to run
+multiple Lua states in parallel. It is intended to be used for optimizing
+performance on multicore CPU's and to study ways to make Lua programs
+naturally parallel to begin with.
+
+Lanes is included into your software by the regular require "lanes" method.
+No C side programming is needed; all APIs are Lua side, and most existing
+extension modules should work seamlessly together with the multiple lanes.
+
+Lanes supports Lua 5.1, 5.2 and 5.3
+endef
+
+define Package/lualanes/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/lua/lmod/lanes.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lanes
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/lua/cmod/core.so $(1)/usr/lib/lua/lanes/core.so
+endef
+
+$(eval $(call BuildPackage,lualanes))
diff --git a/lang/lua/luaossl/Makefile b/lang/lua/luaossl/Makefile
new file mode 100644 (file)
index 0000000..8223033
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# Copyright (C) 2021 Siger Yang <[email protected]>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luaossl
+PKG_VERSION:=20220711
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Siger Yang <[email protected]>
+
+PKG_MIRROR_HASH:=7abb1070da36906f9ef310af1a12827543bb5de4bbe239068420fd8b3e3858d2
+PKG_SOURCE_URL:=https://github.com/wahern/luaossl.git
+PKG_SOURCE_VERSION:=rel-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luaossl/default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Comprehensive binding to OpenSSL for $(1)
+  URL:=http://25thandclement.com/~william/projects/luaossl.html
+  DEPENDS:=+libopenssl
+endef
+
+define Package/luaossl/default/description
+ luaossl is a comprehensive binding to OpenSSL for Lua 5.1, 5.2, and
+ later. It includes support for certificate and key management, key
+ generation, signature verification, and deep bindings to the
+ distinguished name, alternative name, and X.509v3 extension interfaces. 
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += $(FPIC)
+
+define Package/luaossl
+  $(call Package/luaossl/default,lua5.1)
+  DEPENDS+=+liblua
+  VARIANT:=lua51
+endef
+define Package/luaossl-lua5.3
+  $(call Package/luaossl/default,lua5.3)
+  DEPENDS+=+liblua5.3
+  VARIANT:=lua53
+endef
+define Package/luaossl-lua5.4
+  $(call Package/luaossl/default,lua5.4)
+  DEPENDS+=+liblua5.4
+  VARIANT:=lua54
+endef
+
+Package/luaossl/description = $(Package/luaossl/default/description)
+Package/luaossl-lua5.3/description = $(Package/luaossl/default/description)
+Package/luaossl-lua5.4/description = $(Package/luaossl/default/description)
+
+ifeq ($(BUILD_VARIANT),lua51)
+  MAKE_FLAGS += \
+       LUA_APIS="5.1" \
+       LUA51_CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+       lua51cpath="/usr/lib/lua" \
+       lua51path="/usr/lib/lua"
+endif
+ifeq ($(BUILD_VARIANT),lua53)
+  MAKE_FLAGS += \
+       LUA_APIS="5.3" \
+       LUA53_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.3" \
+       lua53cpath="/usr/local/lib/lua/5.3" \
+       lua53path="/usr/local/lib/lua/5.3"
+endif
+ifeq ($(BUILD_VARIANT),lua54)
+  MAKE_FLAGS += \
+       LUA_APIS="5.4" \
+       LUA54_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.4" \
+       lua54cpath="/usr/local/lib/lua/5.4" \
+       lua54path="/usr/local/lib/lua/5.4"
+endif
+
+define Package/luaossl/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/_openssl.so $(1)/usr/lib/lua/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/openssl.lua $(1)/usr/lib/lua/
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/openssl $(1)/usr/lib/lua/
+endef
+define Package/luaossl-lua5.3/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/_openssl.so $(1)/usr/local/lib/lua/5.3/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/openssl.lua $(1)/usr/local/lib/lua/5.3/
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/openssl $(1)/usr/local/lib/lua/5.3/
+endef
+define Package/luaossl-lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/_openssl.so $(1)/usr/local/lib/lua/5.4/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/openssl.lua $(1)/usr/local/lib/lua/5.4/
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/openssl $(1)/usr/local/lib/lua/5.4/
+endef
+
+$(eval $(call BuildPackage,luaossl))
+$(eval $(call BuildPackage,luaossl-lua5.3))
+$(eval $(call BuildPackage,luaossl-lua5.4))
diff --git a/lang/lua/luaossl/patches/900_fix_build_on_macos.patch b/lang/lua/luaossl/patches/900_fix_build_on_macos.patch
new file mode 100644 (file)
index 0000000..5ceb99b
--- /dev/null
@@ -0,0 +1,15 @@
+commit 8686cae32fc04045c1404c2febf84242c298bf0d
+Author: Sergey V. Lobanov <[email protected]>
+Date:   Fri Jan 7 23:00:03 2022 +0300
+
+    fix build on macos
+    
+    OpenWrt is always Linux. Disable OS detection
+
+--- a/mk/vendor.os
++++ b/mk/vendor.os
+@@ -1,3 +1,3 @@
+ #!/bin/sh
+-uname -s
++echo Linux
diff --git a/lang/lua/luaposix/Makefile b/lang/lua/luaposix/Makefile
new file mode 100644 (file)
index 0000000..c49d205
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luaposix
+PKG_VERSION:=36.3
+PKG_RELEASE:=2
+
+PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=82cd9a96c41a4a3205c050206f0564ff4456f773a8f9ffc9235ff8f1907ca5e6
+PKG_MAINTAINER:=Maxim Storchak <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DEPENDS:=luarocks/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luaposix
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=POSIX binding for LuaJIT, Lua 5.1, 5.2 and 5.3
+  URL:=https://github.com/luaposix/luaposix
+  DEPENDS:= +USE_GLIBC:libcrypt-compat +lua +lua-bit32
+endef
+
+define Package/luaposix/description
+  luaposix is a general POSIX library for Lua providing access
+  to various low level libc functions.
+endef
+
+TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
+
+TARGET_CFLAGS += \
+       -I$(STAGING_DIR)/usr/include
+
+define Build/Compile
+  cd $(PKG_BUILD_DIR) && \
+       LDFLAGS="$(TARGET_LDFLAGS) $(FPIC)" \
+       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+    LUA_PKGNAME=lua5.1 \
+    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+    luarocks make --force --deps-mode=none --pack-binary-rock luaposix-$(PKG_VERSION)-1.rockspec \
+    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+    LUA_PKGNAME=lua5.1 \
+    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+       LDFLAGS="$(TARGET_LDFLAGS)"
+endef
+
+define Package/luaposix/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/posix/sys
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/*.so $(1)/usr/lib/lua/posix/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/sys/*.so $(1)/usr/lib/lua/posix/sys/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix/*.lua $(1)/usr/lib/lua/posix/
+       rm -f $(1)/usr/lib/lua/posix/{deprecated,compat}.lua
+endef
+
+$(eval $(call BuildPackage,luaposix))
diff --git a/lang/lua/luaposix/patches/102-disable-compat-deprecated.patch b/lang/lua/luaposix/patches/102-disable-compat-deprecated.patch
new file mode 100644 (file)
index 0000000..efaa37b
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/lib/posix/init.lua
++++ b/lib/posix/init.lua
+@@ -437,14 +437,6 @@ do
+       end
+    end
+-   -- Inject deprecated APIs (overwriting submodules) for backwards compatibility.
+-   for k, v in next, (require 'posix.deprecated') do
+-      rawset(M, k, v)
+-   end
+-   for k, v in next, (require 'posix.compat') do
+-      rawset(M, k, v)
+-   end
+-
+    --- Metamethods
+    -- @section metamethods
diff --git a/lang/lua/luaposix/scripts/uname b/lang/lua/luaposix/scripts/uname
new file mode 100755 (executable)
index 0000000..787b647
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo Linux
diff --git a/lang/lua/luarocks/Makefile b/lang/lua/luarocks/Makefile
new file mode 100644 (file)
index 0000000..e6d6797
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luarocks
+PKG_VERSION:=2.2.2
+PKG_RELEASE:=4
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_MIRROR_HASH:=9b2f880e0ff57a0d7e3a9d8d5365c73e6f546891bc39d2c6ef4c3443a8ca4b45
+
+PKG_MAINTAINER:=Amr Hassan <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=lua/host
+HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
+HOST_BUILD_PARALLEL:=1
+
+HOST_BUILD_PREFIX:=$(STAGING_DIR)/host
+HOST_BUILD_DIR:=$(BUILD_DIR)/host/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luarocks
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luarocks
+  URL:=https://github.com/keplerproject/luarocks
+  DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
+endef
+
+define Package/luarocks/description
+       LuaRocks is a deployment and management system for Lua modules.
+endef
+
+# My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
+CONFIGURE_ARGS = \
+    --prefix=$(CONFIGURE_PREFIX) \
+    --sysconfdir=/etc \
+    --with-lua=$(STAGING_DIR_HOSTPKG)
+
+HOST_CONFIGURE_ARGS= \
+    --prefix=$(STAGING_DIR)/host \
+    --sysconfdir=$(STAGING_DIR)/host/etc \
+    --with-lua=$(STAGING_DIR_HOSTPKG)
+
+CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
+
+HOST_CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
+
+define Build/Compile
+       $(call Build/Compile/Default,build)
+endef
+
+define Host/Compile
+  $(call Host/Compile/Default,build)
+endef
+
+define Package/luarocks/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
+       $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
+endef
+
+define Host/Install
+  $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+$(eval $(call BuildPackage,luarocks))
+
+$(eval $(call HostBuild))
diff --git a/lang/lua/luarocks/patches/01_dont_modify_bin_shebang.diff b/lang/lua/luarocks/patches/01_dont_modify_bin_shebang.diff
new file mode 100644 (file)
index 0000000..ab48a96
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -89,7 +89,7 @@ build_bins: cleanup_bins
+       for f in $(BIN_FILES) ;\
+       do \
+          sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
+-         echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
++         echo "#!/usr/bin/env lua5.1" > src/bin/$$f ;\
+          echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
+          cat src/bin/$$f.bak >> src/bin/$$f ;\
+          chmod +x src/bin/$$f ;\
diff --git a/lang/lua/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch b/lang/lua/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch
new file mode 100644 (file)
index 0000000..d6da3fe
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/configure
++++ b/configure
+@@ -388,18 +388,22 @@ then
+ fi
+ echo_n "Configuring for system... "
+-if uname -s
+-then
+-   LUAROCKS_UNAME_S=`uname -s`
+-else
+-   die "Could not determine operating system. 'uname -s' failed."
++if [ -z "$LUAROCKS_UNAME_S" ]; then
++    if uname -s
++    then
++        LUAROCKS_UNAME_S=`uname -s`
++    else
++        die "Could not determine operating system. 'uname -s' failed."
++    fi
+ fi
+ echo_n "Configuring for architecture... "
+-if uname -m
+-then
+-   LUAROCKS_UNAME_M=`uname -m`
+-else
+-   die "Could not determine processor architecture. 'uname -m' failed."
++if [ -z "$LUAROCKS_UNAME_M" ]; then
++    if uname -m
++    then
++        LUAROCKS_UNAME_M=`uname -m`
++    else
++        die "Could not determine processor architecture. 'uname -m' failed."
++    fi
+ fi
+ for v in 5.1 5.2 5.3; do
diff --git a/lang/lua/luasec/Makefile b/lang/lua/luasec/Makefile
new file mode 100644 (file)
index 0000000..9d60604
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2009-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasec
+PKG_VERSION:=1.3.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/brunoos/luasec/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=97293092ba385ab390decb6678bc8cbeffd5899bfbc49eb7ef4aa00f5e31c3d4
+
+MAINTAINER:=W. Michael Petullo <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasec
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaSec
+  URL:=https://github.com/brunoos/luasec
+  DEPENDS:=+lua +libopenssl +luasocket
+endef
+
+define Package/luasec/description
+  LuaSec is a binding for OpenSSL library to provide TLS/SSL communication.
+endef
+
+define Build/Configure
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += $(FPIC)
+
+MAKE_FLAGS += \
+       LD="$(TARGET_CC)" \
+       INC_PATH="" \
+       LIB_PATH="" \
+       LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+       LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua"
+
+define Build/Compile
+$(call Build/Compile/Default,linux)
+endef
+
+define Package/luasec/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.so $(1)/usr/lib/lua/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/ssl
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl/https.lua $(1)/usr/lib/lua/ssl/
+endef
+
+$(eval $(call BuildPackage,luasec))
diff --git a/lang/lua/luasec/patches/100-fix-compilation.patch b/lang/lua/luasec/patches/100-fix-compilation.patch
new file mode 100644 (file)
index 0000000..1c3bc3b
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,8 +16,8 @@ WARN=-Wall -pedantic
+ BSD_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+ BSD_LDFLAGS=-O -fPIC -shared $(LIBDIR)
+-LNX_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+-LNX_LDFLAGS=-O -fPIC -shared $(LIBDIR)
++LNX_CFLAGS=$(INCDIR) $(DEFS)
++LNX_LDFLAGS=-shared $(LIBDIR)
+ MAC_ENV=env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
+ MAC_CFLAGS=-O2 -fno-common $(WARN) $(INCDIR) $(DEFS)
+@@ -34,10 +34,10 @@ LDFLAGS += $(MYLDFLAGS)
+ all:
+ install: $(CMOD) $(LMOD)
+-      $(INSTALL) -d $(DESTDIR)$(LUAPATH)/ssl $(DESTDIR)$(LUACPATH)
+-      $(INSTALL) $(CMOD) $(DESTDIR)$(LUACPATH)
+-      $(INSTALL) -m644 $(LMOD) $(DESTDIR)$(LUAPATH)
+-      $(INSTALL) -m644 https.lua $(DESTDIR)$(LUAPATH)/ssl
++      $(INSTALL) -d $(LUAPATH)/ssl $(LUACPATH)
++      $(INSTALL) $(CMOD) $(LUACPATH)
++      $(INSTALL) -m644 $(LMOD) $(LUAPATH)
++      $(INSTALL) -m644 https.lua $(LUAPATH)/ssl
+ linux:
+       @$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)" EXTRA="$(EXTRA)"
diff --git a/lang/lua/luasoap/Makefile b/lang/lua/luasoap/Makefile
new file mode 100644 (file)
index 0000000..20e5a3d
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasoap
+PKG_VERSION:=4.0.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/tomasguisasola/luasoap
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_MIRROR_HASH:=ecd82fe9d7c62c6870f042ba65ce57054d68193779af9461cb4d95b83983bf80
+
+PKG_MAINTAINER:=Liu Peng <[email protected]>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasoap
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaSOAP
+  URL:=https://github.com/tomasguisasola/luasoap
+  DEPENDS:=+lua +luaexpat +luasec +luasocket
+  PKGARCH:=all
+endef
+
+define Package/luasoap/description
+  LuaSOAP is a library of functions to deal with SOAP.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/luasoap/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/soap.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/soap
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{client,server}.lua $(1)/usr/lib/lua/soap/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/soap/tests
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/test{,-http,-server,-wsdl}.lua $(1)/usr/lib/lua/soap/tests/
+endef
+
+$(eval $(call BuildPackage,luasoap))
diff --git a/lang/lua/luasocket/Makefile b/lang/lua/luasocket/Makefile
new file mode 100644 (file)
index 0000000..9538d7a
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasocket
+PKG_VERSION:=3.1.0
+PKG_RELEASE:=2
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/lunarmodules/luasocket
+PKG_MIRROR_HASH:=1ee81f1f5a63d0d14c8c8571e8940604cbf1443c3b18ee7d3d1bac6791f853fc
+
+PKG_MAINTAINER:=W. Michael Petullo <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasocket/default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  URL:=http://w3.impa.br/~diego/software/luasocket
+endef
+
+define Package/luasocket
+  $(Package/luasocket/default)
+  TITLE:=LuaSocket
+  DEPENDS:=+lua
+  VARIANT:=lua-51
+  DEFAULT_VARIANT:=1
+endef
+
+define Package/luasocket5.3
+  $(Package/luasocket/default)
+  TITLE:=LuaSocket 5.3
+  DEPENDS:=+liblua5.3
+  VARIANT:=lua-53
+endef
+
+ifeq ($(BUILD_VARIANT),lua-51)
+  LUA_VERSION=5.1
+endif
+
+ifeq ($(BUILD_VARIANT),lua-53)
+  LUA_VERSION=5.3
+endif
+
+
+define Package/luasocket/default/description
+  LuaSocket is the most comprehensive networking support
+  library for the Lua language. It provides easy access to
+  TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more.
+endef
+Package/luasocket/description     = $(Package/luasocket/default/description)
+Package/luasocket5.3/description = $(Package/luasocket/default/description)
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/ \
+               LIBDIR="$(TARGET_LDFLAGS)" \
+               CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
+               LD="$(TARGET_CROSS)ld -shared" \
+               LUAV=$(LUA_VERSION) LUAINC_linux_base=$(STAGING_DIR)/usr/include \
+               all
+endef
+
+define Package/luasocket/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ltn12,mime,socket}.lua $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mime-1.0.3.so $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/socket-3.0.0.so $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/mime
+       ln -sf ../mime-1.0.3.so $(1)/usr/lib/lua/mime/core.so
+       $(INSTALL_DIR) $(1)/usr/lib/lua/socket
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/serial.so $(1)/usr/lib/lua/socket
+       ln -sf ../socket-3.0.0.so $(1)/usr/lib/lua/socket/core.so
+endef
+
+
+define Package/luasocket5.3/install
+       $(MAKE) -C $(PKG_BUILD_DIR)/src \
+               DESTDIR="$(1)" \
+               LUAV=$(LUA_VERSION) \
+               install
+endef
+
+
+$(eval $(call BuildPackage,luasocket))
+$(eval $(call BuildPackage,luasocket5.3))
diff --git a/lang/lua/luasocket/patches/0001-Add-interface-support.patch b/lang/lua/luasocket/patches/0001-Add-interface-support.patch
new file mode 100644 (file)
index 0000000..d7bfe2b
--- /dev/null
@@ -0,0 +1,228 @@
+From 96fdf07acf78ecfc9be76a8b0591f38fe6f1a875 Mon Sep 17 00:00:00 2001
+From: Steven Barth <[email protected]>
+Date: Sat, 9 Nov 2013 12:01:42 +0100
+Subject: [PATCH] Add interface resolving
+
+---
+ src/if.c        | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/if.h        |  27 ++++++++++++++
+ src/luasocket.c |   2 +
+ src/makefile    |   2 +
+ src/options.c   |   9 +++++
+ 5 files changed, 153 insertions(+)
+ create mode 100644 src/if.c
+ create mode 100644 src/if.h
+
+--- /dev/null
++++ b/src/if.c
+@@ -0,0 +1,117 @@
++/*
++ * $Id: if.c $
++ *
++ * Author: Markus Stenberg <[email protected]>
++ *
++ * Copyright (c) 2012 cisco Systems, Inc.
++ *
++ * Created:       Tue Dec  4 14:50:34 2012 mstenber
++ * Last modified: Wed Dec  5 18:51:08 2012 mstenber
++ * Edit time:     24 min
++ *
++ */
++
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if.h>
++
++#include "if.h"
++
++#include "lauxlib.h"
++
++static int if_global_indextoname(lua_State *L);
++static int if_global_nametoindex(lua_State *L);
++static int if_global_nameindex(lua_State *L);
++
++static luaL_Reg func[] = {
++    { "indextoname", if_global_indextoname},
++    { "nametoindex", if_global_nametoindex},
++    { "nameindex", if_global_nameindex},
++    { NULL, NULL}
++};
++
++int if_open(lua_State *L)
++{
++    lua_pushstring(L, "iface");
++    lua_newtable(L);
++#if LUA_VERSION_NUM < 503
++    luaL_openlib(L, NULL, func, 0);
++#else
++    luaL_setfuncs(L, func, 0);
++#endif
++    lua_settable(L, -3);
++    return 0;
++}
++
++int if_global_indextoname(lua_State *L)
++{
++  unsigned int ifnumber;
++  const char *name;
++  char buf[IF_NAMESIZE+1];
++
++  if (!lua_isnumber(L, 1))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "indextoname expects only number argument");
++      return 2;
++    }
++  ifnumber = lua_tonumber(L, 1);
++  if (!(name = if_indextoname(ifnumber, buf)))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nonexistent interface");
++      return 2;
++    }
++  lua_pushstring(L, name);
++  return 1;
++}
++
++int if_global_nametoindex(lua_State *L)
++{
++  unsigned int ifnumber;
++  if (!lua_isstring(L, 1))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nametoindex expects only string argument");
++      return 2;
++    }
++  if (!(ifnumber = if_nametoindex(lua_tostring(L, 1))))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nonexistent interface");
++      return 2;
++    }
++  lua_pushnumber(L, ifnumber);
++  return 1;
++}
++
++int if_global_nameindex(lua_State *L)
++{
++  struct if_nameindex *ni, *oni;
++  int i = 1;
++  oni = ni = if_nameindex();
++  lua_newtable(L);
++  while (ni && ni->if_index && *(ni->if_name))
++    {
++      /* at result[i], we store.. */
++      lua_pushnumber(L, i);
++
++      /* new table with two items - index, name*/
++      lua_newtable(L);
++      lua_pushstring(L, "index");
++      lua_pushnumber(L, ni->if_index);
++      lua_settable(L, -3);
++
++      lua_pushstring(L, "name");
++      lua_pushstring(L, ni->if_name);
++      lua_settable(L, -3);
++
++      /* Then, actually store it */
++      lua_settable(L, -3);
++
++      i++;
++      ni++;
++    }
++  if_freenameindex(oni);
++  return 1;
++}
+--- /dev/null
++++ b/src/if.h
+@@ -0,0 +1,27 @@
++/*
++ * $Id: if.h $
++ *
++ * Author: Markus Stenberg <[email protected]>
++ *
++ *  Copyright (c) 2012 cisco Systems, Inc.
++ *
++ * Created:       Tue Dec  4 14:37:24 2012 mstenber
++ * Last modified: Tue Dec  4 14:51:43 2012 mstenber
++ * Edit time:     7 min
++ *
++ */
++
++/* This module provides Lua wrapping for the advanced socket API
++ * defined in RFC3542, or mainly, the access to the system's interface
++ * list. It is necessary for use of recvmsg/sendmsg.
++ *
++ * TODO - Do something clever with Windows?
++ */
++#ifndef IF_H
++#define IF_H
++
++#include "lua.h"
++
++int if_open(lua_State *L);
++
++#endif /* IF_H */
+--- a/src/luasocket.c
++++ b/src/luasocket.c
+@@ -21,6 +21,7 @@
+ #include "tcp.h"
+ #include "udp.h"
+ #include "select.h"
++#include "if.h"
+ /*-------------------------------------------------------------------------*\
+ * Internal function prototypes
+@@ -41,6 +42,7 @@ static const luaL_Reg mod[] = {
+     {"tcp", tcp_open},
+     {"udp", udp_open},
+     {"select", select_open},
++    {"iface", if_open},
+     {NULL, NULL}
+ };
+--- a/src/makefile
++++ b/src/makefile
+@@ -303,6 +303,7 @@ SOCKET_OBJS= \
+       compat.$(O) \
+       options.$(O) \
+       inet.$(O) \
++      if.$(O) \
+       $(SOCKET) \
+       except.$(O) \
+       select.$(O) \
+@@ -440,6 +441,7 @@ auxiliar.$(O): auxiliar.c auxiliar.h
+ buffer.$(O): buffer.c buffer.h io.h timeout.h
+ except.$(O): except.c except.h
+ inet.$(O): inet.c inet.h socket.h io.h timeout.h usocket.h
++if.$(O): if.c if.h
+ io.$(O): io.c io.h timeout.h
+ luasocket.$(O): luasocket.c luasocket.h auxiliar.h except.h \
+       timeout.h buffer.h io.h inet.h socket.h usocket.h tcp.h \
+--- a/src/options.c
++++ b/src/options.c
+@@ -7,7 +7,10 @@
+ #include "options.h"
+ #include "inet.h"
+ #include <string.h>
+-
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if.h>
++ 
+ /*=========================================================================*\
+ * Internal functions prototypes
+ \*=========================================================================*/
+@@ -414,6 +417,12 @@ static int opt_ip6_setmembership(lua_Sta
+     if (!lua_isnil(L, -1)) {
+         if (lua_isnumber(L, -1)) {
+             val.ipv6mr_interface = (unsigned int) lua_tonumber(L, -1);
++        } else if (lua_isstring(L, -1)) {
++            if (!(val.ipv6mr_interface = if_nametoindex(lua_tostring(L, -1)))) {
++                lua_pushnil(L);
++                lua_pushstring(L, "nonexistent interface");
++                return 2;
++            }
+         } else
+           luaL_argerror(L, -1, "number 'interface' field expected");
+     }
diff --git a/lang/lua/luasocket/patches/0301-Fix-mpc85xx-build.patch b/lang/lua/luasocket/patches/0301-Fix-mpc85xx-build.patch
new file mode 100644 (file)
index 0000000..14ba072
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/makefile
++++ b/src/makefile
+@@ -397,18 +397,18 @@ none:
+ all: $(SOCKET_SO) $(MIME_SO)
+ $(SOCKET_SO): $(SOCKET_OBJS)
+-      $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
++      $(CC) $(SOCKET_OBJS) $(LDFLAGS)$@
+ $(MIME_SO): $(MIME_OBJS)
+-      $(LD) $(MIME_OBJS) $(LDFLAGS)$@
++      $(CC) $(MIME_OBJS) $(LDFLAGS)$@
+ all-unix: all $(UNIX_SO) $(SERIAL_SO)
+ $(UNIX_SO): $(UNIX_OBJS)
+-      $(LD) $(UNIX_OBJS) $(LDFLAGS)$@
++      $(CC) $(UNIX_OBJS) $(LDFLAGS)$@
+ $(SERIAL_SO): $(SERIAL_OBJS)
+-      $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
++      $(CC) $(SERIAL_OBJS) $(LDFLAGS)$@
+ install:
+       $(INSTALL_DIR) $(INSTALL_TOP_LDIR)
diff --git a/lang/lua/luasql/Makefile b/lang/lua/luasql/Makefile
new file mode 100644 (file)
index 0000000..1a807eb
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasql
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/luasql/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=db2458a8c8c5f3bc717e4030fe2878f1ad8d71e437ec6149c381eebad5d525c5
+
+PKG_MAINTAINER:=
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=doc/us/license.html
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasql/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua SQL binding
+  URL:=https://keplerproject.github.io/luasql/
+  DEPENDS:= +lua
+endef
+
+define Package/luasql/Default/description
+ LuaSQL is a simple interface from Lua to a DBMS.
+endef
+
+
+define Package/luasql-mysql
+$(call Package/luasql/Default)
+  TITLE+= for MySQL
+  DEPENDS+= +libmysqlclient
+  VARIANT:=mysql
+endef
+
+define Package/luasql-mysql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the MySQL binding.
+endef
+
+
+define Package/luasql-pgsql
+$(call Package/luasql/Default)
+  TITLE+= for PostgreSQL
+  DEPENDS+= +libpq
+  VARIANT:=postgres
+endef
+
+define Package/luasql-pgsql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the PostgreSQL binding.
+endef
+
+
+define Package/luasql-sqlite3
+$(call Package/luasql/Default)
+  TITLE+= for SQLite 3
+  DEPENDS+= +libsqlite3
+  VARIANT:=sqlite3
+endef
+
+define Package/luasql-sqlite3/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the SQLite 3 binding.
+endef
+
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
+
+ifeq ($(BUILD_VARIANT),mysql)
+  MAKE_FLAGS += DRIVER_INCS_mysql='-I$(STAGING_DIR)/usr/include/mysql' \
+               DRIVER_LIBS_mysql='$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz'
+endif
+
+ifeq ($(BUILD_VARIANT),postgres)
+  MAKE_FLAGS += DRIVER_LIBS_postgres='$(TARGET_LDFLAGS) -lpq'
+endif
+
+ifeq ($(BUILD_VARIANT),sqlite3)
+  MAKE_FLAGS += DRIVER_LIBS_sqlite='$(TARGET_LDFLAGS) -lsqlite3 -lpthread'
+endif
+
+MAKE_FLAGS += \
+       LIB_OPTION="-shared" \
+       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+       $(BUILD_VARIANT)
+
+define Package/Install/Default
+       $(INSTALL_DIR) $(1)/usr/lib/lua/luasql
+       $(CP) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/lua/luasql/
+endef
+
+Package/luasql-mysql/install = $(Package/Install/Default)
+Package/luasql-pgsql/install = $(Package/Install/Default)
+Package/luasql-sqlite3/install = $(Package/Install/Default)
+
+$(eval $(call BuildPackage,luasql-mysql))
+$(eval $(call BuildPackage,luasql-pgsql))
+$(eval $(call BuildPackage,luasql-sqlite3))
diff --git a/lang/lua/luasrcdiet/Makefile b/lang/lua/luasrcdiet/Makefile
new file mode 100644 (file)
index 0000000..f1ed10c
--- /dev/null
@@ -0,0 +1,58 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasrcdiet
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Matthias Schiffer <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+
+PKG_SOURCE_URL:=https://github.com/jirutka/luasrcdiet.git
+PKG_SOURCE_VERSION:=f138fc9359821d9201cd6b57cfa2fcbed5b9af97
+PKG_SOURCE_PROTO:=git
+PKG_MIRROR_HASH:=a3e316f273d4daf4bc5caea295d050efb2624125960de593c72b3aef0126583c
+
+HOST_BUILD_DEPENDS:=lua/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/luasrcdiet
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luasrcdiet
+  URL:=https://github.com/jirutka/luasrcdiet
+  DEPENDS:=+lua
+  PKGARCH:=all
+endef
+
+define Package/luasrcdiet/description
+  Compresses Lua source code by removing unnecessary characters
+endef
+
+define Build/Compile
+endef
+
+define Package/luasrcdiet/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/luasrcdiet $(1)/usr/bin/luasrcdiet
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/luasrcdiet $(1)/usr/lib/lua/
+endef
+
+define Host/Compile
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/luasrcdiet $(1)/bin/
+
+       $(INSTALL_DIR) $(1)/lib/lua/5.1
+       $(CP) $(HOST_BUILD_DIR)/luasrcdiet $(1)/lib/lua/5.1/
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,luasrcdiet))
diff --git a/lang/lua/luv/Config.in b/lang/lua/luv/Config.in
new file mode 100644 (file)
index 0000000..076473f
--- /dev/null
@@ -0,0 +1,11 @@
+menu "Configuration"
+       depends on PACKAGE_luv
+
+config LUV_USE_LUAJIT_ENGINE
+       bool "Use luajit engine"
+       select PACKAGE_luajit
+       help
+               If selected, luv will be compiled against luajit. If not selected, luv will use Lua as engine.
+       default n
+
+endmenu
diff --git a/lang/lua/luv/Makefile b/lang/lua/luv/Makefile
new file mode 100644 (file)
index 0000000..cf9f1dd
--- /dev/null
@@ -0,0 +1,62 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luv
+PKG_REAL_VERSION:=1.51.0-1
+PKG_VERSION:=$(subst -,.,$(PKG_REAL_VERSION))
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_REAL_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/luvit/luv/releases/download/$(PKG_REAL_VERSION)
+PKG_HASH:=dc706d9141c185bdce08b6fc8a9d4df05c3ac3676809ee4e9e37e1553d821237
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_REAL_VERSION)
+
+PKG_MAINTAINER:=Morteza Milani <[email protected]>
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/luv
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Luv
+  URL:=https://github.com/luvit/luv
+  DEPENDS:=+libuv +!LUV_USE_LUAJIT_ENGINE:lua
+endef
+
+define Package/luv/description
+  Bare libuv bindings for lua
+endef
+
+define Package/luv/config
+       source "$(SOURCE)/Config.in"
+endef
+
+CMAKE_OPTIONS += \
+       -DLUA_BUILD_TYPE=System \
+       -DWITH_SHARED_LIBUV=ON \
+       -DBUILD_MODULE=OFF \
+       -DBUILD_SHARED_LIBS=ON \
+       -DWITH_LUA_ENGINE=$(if $(CONFIG_LUV_USE_LUAJIT_ENGINE),Luajit,Lua)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/luv
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/luv/*.h $(1)/usr/include/luv
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libluv.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libluv.pc $(1)/usr/lib/pkgconfig
+       $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libluv.pc
+       $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libluv.pc
+endef
+
+define Package/luv/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libluv.so.1.51.0 $(1)/usr/lib/lua/luv.so
+endef
+
+
+$(eval $(call BuildPackage,luv))
diff --git a/lang/lua/lyaml/Makefile b/lang/lua/lyaml/Makefile
new file mode 100755 (executable)
index 0000000..ac7311a
--- /dev/null
@@ -0,0 +1,66 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lyaml
+PKG_VERSION:=6.2.7
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/gvvaughan/lyaml/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=9bb489cefae48b150d66f6bab4141d8d5831fcb7465bfc52a9845fa01efc63b0
+
+PKG_MAINTAINER:=Mathew McBride <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=lua/host luarocks/host HOST_OS_MACOS:fakeuname/host
+
+include $(INCLUDE_DIR)/package.mk
+ifeq ($(CONFIG_HOST_OS_MACOS),y)
+    include ../../utils/fakeuname/fakeuname.mk
+endif
+
+define Package/lyaml
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua lib-yaml bindings
+  URL:=https://github.com/gvvaughan/lyaml
+  DEPENDS:= +lua +libyaml
+endef
+
+define Package/lyaml/description
+  Lua bindings for libyaml
+endef
+
+TARGET_CFLAGS += \
+       -I$(STAGING_DIR)/usr/include
+
+# Note: the duplicate environment exports are not a typo!
+# First is for luarocks, then the second is for the compilation
+# invoked by luarocks
+# (Same setup as luaposix)
+define Build/Compile
+       cd $(PKG_BUILD_DIR) && \
+       LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+       LUA_PKGNAME=lua5.1 \
+       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+       $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(TARGET_PATH_PKG)) \
+       luarocks make --pack-binary-rock lyaml-$(PKG_VERSION)-1.rockspec \
+               LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
+               YAML_DIR=$(STAGING_DIR)/usr \
+               LUA_INCDIR=$(STAGING_DIR)/usr/include \
+               LUA_PKGNAME=lua5.1 \
+               CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+               CC="$(TARGET_CC)" LD="$(TARGET_CC)"
+endef
+
+define Package/lyaml/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lyaml
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/yaml.so $(1)/usr/lib/lua/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lyaml/*.lua $(1)/usr/lib/lua/lyaml/
+endef
+
+$(eval $(call BuildPackage,lyaml))
diff --git a/lang/lua/lzmq/Makefile b/lang/lua/lzmq/Makefile
new file mode 100644 (file)
index 0000000..f401af3
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lzmq
+PKG_VERSION:=0.4.4
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Dirk Chang <[email protected]>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/zeromq/lzmq/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=cf70200045b8bcb0e929c338ad421b6a291cf1038053532888dc201af3224d8b
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lzmq
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua ZeroMQ binding
+  URL:=https://github.com/zeromq/lzmq
+  DEPENDS:= +lua +libzmq
+endef
+
+define Package/lzmq/description
+ LZMQ is a Lua binding to ZeroMQ.
+endef
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+define Package/lzmq/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lzmq
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq/timer.so $(1)/usr/lib/lua/lzmq
+       $(CP) -R $(PKG_BUILD_DIR)/src/lua/lzmq/* $(1)/usr/lib/lua/lzmq
+endef
+
+$(eval $(call BuildPackage,lzmq))
diff --git a/lang/lua/lzmq/patches/010-gcc14.patch b/lang/lua/lzmq/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..8be0b65
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/lzmq.c
++++ b/src/lzmq.c
+@@ -23,6 +23,7 @@
+ #include <assert.h>\r
+ #include "zsupport.h"\r
+ #include <memory.h>\r
++#include <stdlib.h>\r
\r
+ #define LUAZMQ_MODULE_NAME      "lzmq"\r
+ #define LUAZMQ_MODULE_LICENSE   "MIT"\r
diff --git a/lang/lua/uuid/Makefile b/lang/lua/uuid/Makefile
new file mode 100644 (file)
index 0000000..d1ca407
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=uuid
+PKG_VERSION:=0.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=142b60b266d90db6177eb07919d8b71ac4a3bb17859540d4655c02f395526962
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/Tieske/uuid.git
+PKG_SOURCE_VERSION:=version_$(PKG_VERSION)
+
+PKG_MAINTAINER:=Amr Hassan <[email protected]>
+PKG_LICENSE=Apache-2.0
+
+LUA_MODULE_PATH:=/usr/lib/lua
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/uuid
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=uuid
+  URL:=https://github.com/Tieske/uuid
+  DEPENDS:=+lua +luasocket
+  PKGARCH:=all
+endef
+
+define Package/uuid/description
+       A pure Lua uuid generator
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/uuid/install
+       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/uuid.lua $(1)/$(LUA_MODULE_PATH)/uuid.lua
+endef
+
+$(eval $(call BuildPackage,uuid))
diff --git a/lang/lua5.4/Makefile b/lang/lua5.4/Makefile
deleted file mode 100644 (file)
index 3db0e30..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-#
-# Copyright (C) 2006-2023 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lua
-PKG_VERSION:=5.4.7
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://www.lua.org/ftp/ \
-       https://www.tecgraf.puc-rio.br/lua/ftp/
-PKG_HASH:=9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30
-PKG_BUILD_PARALLEL:=1
-
-PKG_MAINTAINER:=Christian Marangi <[email protected]>
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYRIGHT
-PKG_CPE_ID:=cpe:/a:lua:lua
-
-HOST_PATCH_DIR := ./patches-host
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/host-build.mk
-
-define Package/lua5.4/Default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua programming language (version 5.4)
-  URL:=https://www.lua.org/
-endef
-
-define Package/lua5.4/Default/description
-  Lua is a powerful, efficient, lightweight, embeddable scripting language. It
-  supports procedural programming, object-oriented programming, functional
-  programming, data-driven programming, and data description.
-endef
-
-define Package/liblua5.4
-$(call Package/lua5.4/Default)
-  SUBMENU:=
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+= (libraries)
-  ABI_VERSION:=5.4
-endef
-
-define Package/liblua5.4/description
-$(call Package/lua5.4/Default/description)
- This package contains the Lua shared libraries, needed by other programs.
-endef
-
-define Package/lua5.4
-$(call Package/lua5.4/Default)
-  DEPENDS:=+liblua5.4
-  TITLE+= (interpreter)
-endef
-
-define Package/lua5.4/description
-$(call Package/lua5.4/Default/description)
-  This package contains the Lua language interpreter.
-endef
-
-define Package/luac5.4
-$(call Package/lua5.4/Default)
-  DEPENDS:=+liblua5.4
-  TITLE+= (compiler)
-endef
-
-define Package/luac5.4/description
-$(call Package/lua5.4/Default/description)
-  This package contains the Lua language compiler.
-endef
-
-define Build/Prepare
-       $(call Build/Prepare/Default)
-       mv $(PKG_BUILD_DIR)/doc/lua.1 $(PKG_BUILD_DIR)/doc/lua5.4.1
-       mv $(PKG_BUILD_DIR)/doc/luac.1 $(PKG_BUILD_DIR)/doc/luac5.4.1
-endef
-
-TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
-
-define Build/Compile
-       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-               CC="$(TARGET_CROSS)gcc" \
-               AR="$(TARGET_CROSS)ar rcu" \
-               RANLIB="$(TARGET_CROSS)ranlib" \
-               INSTALL_ROOT=/usr \
-               CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
-               PKG_VERSION=$(PKG_VERSION) \
-               linux
-       rm -rf $(PKG_INSTALL_DIR)
-       mkdir -p $(PKG_INSTALL_DIR)
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
-               install
-endef
-
-define Host/Prepare
-       $(call Host/Prepare/Default)
-       mv $(HOST_BUILD_DIR)/doc/lua.1 $(HOST_BUILD_DIR)/doc/lua5.4.1
-       mv $(HOST_BUILD_DIR)/doc/luac.1 $(HOST_BUILD_DIR)/doc/luac5.4.1
-endef
-
-define Host/Configure
-       $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
-endef
-
-ifeq ($(HOST_OS),Darwin)
-       LUA_OS:=macosx
-else
-       ifeq ($(HOST_OS),FreeBSD)
-               LUA_OS:=freebsd
-       else
-               LUA_OS:=linux
-       endif
-endif
-
-define Host/Compile
-       $(MAKE) -C $(HOST_BUILD_DIR) \
-               CC="$(HOSTCC) $(HOST_FPIC) -std=gnu99" \
-               $(LUA_OS)
-endef
-
-define Host/Install
-       $(MAKE) -C $(HOST_BUILD_DIR) \
-               INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
-               install
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/lua5.4 $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua{,lib,conf}.h $(1)/usr/include/lua5.4/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua.hpp $(1)/usr/include/lua5.4/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lauxlib.h $(1)/usr/include/lua5.4/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.{a,so*} $(1)/usr/lib/
-       $(LN) liblua5.4.so.0.0.0 $(1)/usr/lib/liblualib5.4.so
-endef
-
-define Package/liblua5.4/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.so* $(1)/usr/lib/
-endef
-
-define Package/lua5.4/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.4 $(1)/usr/bin/
-endef
-
-define Package/luac5.4/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.4 $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,liblua5.4))
-$(eval $(call BuildPackage,lua5.4))
-$(eval $(call BuildPackage,luac5.4))
-$(eval $(call HostBuild))
diff --git a/lang/lua5.4/patches-host/001-include-version-number.patch b/lang/lua5.4/patches-host/001-include-version-number.patch
deleted file mode 100644 (file)
index d3d8b94..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 21 Jun 2019 14:08:38 +0200
-Subject: [PATCH] include version number
-
-Including it allows multiple lua versions to coexist.
-
-Signed-off-by: RafaÅ‚ MiÅ‚ecki <[email protected]>
----
-
---- a/Makefile
-+++ b/Makefile
-@@ -12,7 +12,7 @@ PLAT= guess
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
- INSTALL_TOP= /usr/local
- 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_LMOD= $(INSTALL_TOP)/share/lua/$V
-@@ -39,10 +39,10 @@ RM= rm -f
- 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.a
-+TO_MAN= lua$V.1 luac$V.1
- # Lua version and release.
- V= 5.4
-@@ -52,7 +52,7 @@ R= $V.7
- all:  $(PLAT)
- $(PLATS) help test clean:
--      @cd src && $(MAKE) $@
-+      @cd src && $(MAKE) $@ V=$V
- install: dummy
-       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -32,15 +32,15 @@ CMCFLAGS=
- PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
--LUA_A=        liblua.a
-+LUA_A=        liblua$V.a
- 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)
diff --git a/lang/lua5.4/patches-host/100-no_readline.patch b/lang/lua5.4/patches-host/100-no_readline.patch
deleted file mode 100644 (file)
index 64567dd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -126,7 +126,7 @@ c89:
-       @echo ''
- FreeBSD NetBSD OpenBSD freebsd:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
- generic: $(ALL)
-@@ -136,13 +136,13 @@ ios:
- Linux linux:  linux-noreadline
- linux-noreadline:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
- linux-readline:
-       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
- Darwin macos macosx:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
- mingw:
-       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
diff --git a/lang/lua5.4/patches/001-include-version-number.patch b/lang/lua5.4/patches/001-include-version-number.patch
deleted file mode 100644 (file)
index d3d8b94..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Fri, 21 Jun 2019 14:08:38 +0200
-Subject: [PATCH] include version number
-
-Including it allows multiple lua versions to coexist.
-
-Signed-off-by: RafaÅ‚ MiÅ‚ecki <[email protected]>
----
-
---- a/Makefile
-+++ b/Makefile
-@@ -12,7 +12,7 @@ PLAT= guess
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
- INSTALL_TOP= /usr/local
- 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_LMOD= $(INSTALL_TOP)/share/lua/$V
-@@ -39,10 +39,10 @@ RM= rm -f
- 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.a
-+TO_MAN= lua$V.1 luac$V.1
- # Lua version and release.
- V= 5.4
-@@ -52,7 +52,7 @@ R= $V.7
- all:  $(PLAT)
- $(PLATS) help test clean:
--      @cd src && $(MAKE) $@
-+      @cd src && $(MAKE) $@ V=$V
- install: dummy
-       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -32,15 +32,15 @@ CMCFLAGS=
- PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
--LUA_A=        liblua.a
-+LUA_A=        liblua$V.a
- 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)
diff --git a/lang/lua5.4/patches/020-shared_liblua.patch b/lang/lua5.4/patches/020-shared_liblua.patch
deleted file mode 100644 (file)
index 615cda1..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic
- # What to install.
- TO_BIN= lua$V luac$V
- TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
--TO_LIB= liblua$V.a
-+TO_LIB= liblua$V.a liblua$V.so.0.0.0
- TO_MAN= lua$V.1 luac$V.1
- # Lua version and release.
-@@ -59,6 +59,9 @@ install: dummy
-       cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
-       cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-       cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
-+      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0.0
-+      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0
-+      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so
-       cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
- uninstall:
---- a/src/ldebug.h
-+++ b/src/ldebug.h
-@@ -36,7 +36,7 @@
- #endif
--LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
-+LUA_API int luaG_getfuncline (const Proto *f, int pc);
- LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
-                                                     StkId *pos);
- LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
---- a/src/lstring.h
-+++ b/src/lstring.h
-@@ -50,7 +50,7 @@ LUAI_FUNC void luaS_init (lua_State *L);
- LUAI_FUNC void luaS_remove (lua_State *L, TString *ts);
- LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue);
- LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
--LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
-+LUA_API TString *luaS_new (lua_State *L, const char *str);
- LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l);
---- a/src/lundump.h
-+++ b/src/lundump.h
-@@ -29,7 +29,7 @@
- LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
- /* dump one chunk; from ldump.c */
--LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
-+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
-                          void* data, int strip);
- #endif
---- a/src/lzio.h
-+++ b/src/lzio.h
-@@ -44,7 +44,7 @@ typedef struct Mbuffer {
- #define luaZ_freebuffer(L, buff)      luaZ_resizebuffer(L, buff, 0)
--LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
-+LUA_API void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
-                                         void *data);
- LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n);       /* read next n bytes */
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -33,6 +33,7 @@ CMCFLAGS=
- PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
- LUA_A=        liblua$V.a
-+LUA_SO=       liblua$V.so.0.0.0
- 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)
-@@ -44,8 +45,9 @@ 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_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
- ALL_A= $(LUA_A)
-+ALL_SO= $(LUA_SO)
- # Targets start here.
- default: $(PLAT)
-@@ -56,14 +58,25 @@ o: $(ALL_O)
- a:    $(ALL_A)
-+so:   $(ALL_SO)
-+
- $(LUA_A): $(BASE_O)
-       $(AR) $@ $(BASE_O)
-       $(RANLIB) $@
--$(LUA_T): $(LUA_O) $(LUA_A)
--      $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-+$(LUA_SO): $(CORE_O) $(LIB_O)
-+      $(CC) -o $@ -Wl,-Bsymbolic-functions -shared -Wl,-soname="$@" $?
-+      ln -fs $@ liblua$V.so.0.0
-+      ln -fs $@ liblua$V.so.0
-+      ln -fs $@ liblua$V.so
-+
-+$(LUA_T): $(LUA_O) $(LUA_SO)
-+      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUA_O) $(LIBS)
-+
-+$(LUAC_T): $(LUAC_O) $(LUA_SO)
-+      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUAC_O) $(LIBS)
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+$(LUAC_T)-host: $(LUAC_O) $(LUA_A)
-       $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
- test:
diff --git a/lang/lua5.4/patches/100-no_readline.patch b/lang/lua5.4/patches/100-no_readline.patch
deleted file mode 100644 (file)
index 64567dd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -126,7 +126,7 @@ c89:
-       @echo ''
- FreeBSD NetBSD OpenBSD freebsd:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
- generic: $(ALL)
-@@ -136,13 +136,13 @@ ios:
- Linux linux:  linux-noreadline
- linux-noreadline:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
- linux-readline:
-       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
- Darwin macos macosx:
--      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
-+      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
- mingw:
-       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
diff --git a/lang/luabitop/Makefile b/lang/luabitop/Makefile
deleted file mode 100644 (file)
index f9f7e17..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luabitop
-PKG_VERSION:=1.0.3
-PKG_RELEASE:=1
-
-_BASENAME:=LuaBitOp
-
-PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://bitop.luajit.org/download/
-PKG_HASH:=d514a3d2cefa76c8d11c1b9ec740d5fae316a9c9764e1e12ddea21e4982fab4b
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luabitop
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=luabitop
-  URL:=http://bitop.luajit.org/
-  DEPENDS:=+liblua
-endef
-
-define Package/luabitop/description
-Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers.
-endef
-
-define Build/Configure
-endef
-
-
-TARGET_CFLAGS += $(FPIC) -DLUA_USE_LINUX -DLUA_NUMBER_DOUBLE
-
-define Build/Compile
-       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) -std=gnu99 $(FPIC) -DLUA_USE_LINUX -shared -o $(PKG_BUILD_DIR)/bit.so $(PKG_BUILD_DIR)/bit.c
-endef
-
-define Package/luabitop/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit.so $(1)/usr/lib/lua
-endef
-
-$(eval $(call BuildPackage,luabitop))
diff --git a/lang/luaexpat/Makefile b/lang/luaexpat/Makefile
deleted file mode 100644 (file)
index 0894971..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# 
-# Copyright (C) 2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luaexpat
-PKG_VERSION:=1.5.2
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/lunarmodules/luaexpat
-PKG_MIRROR_HASH:=d479e41ea28b71ede214754d0cde87e6582022fcdd3981c928b41491062835c8
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENCE
-PKG_CPE_ID:=cpe:/a:matthewwild:luaexpat
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luaexpat
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=LuaExpat
-  URL:=http://matthewwild.co.uk/projects/luaexpat/
-  MAINTAINER:=W. Michael Petullo <[email protected]>
-  DEPENDS:=+lua +libexpat
-endef
-
-define Package/luaexpat/description
-  LuaExpat is a SAX XML parser based on the Expat library.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(CP) files/compat-5.1r5 $(PKG_BUILD_DIR)/compat-5.1r5
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-       EXPAT_INC="-I$(STAGING_DIR)/usr/include/" \
-       LUA_INC="-I$(STAGING_DIR)/usr/include/" \
-       LUA_LIBDIR="$(STAGING_DIR)/usr/lib/" \
-       COMPAT_DIR="$(PKG_BUILD_DIR)/compat-5.1r5" \
-       LDFLAGS="-shared $(TARGET_LDFLAGS)" \
-       CC="$(TARGET_CC) $(TARGET_CFLAGS) $(FPIC) -std=c99" \
-       LD="$(TARGET_CROSS)ld -shared"
-endef
-
-define Package/luaexpat/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp.so $(1)/usr/lib/lua/lxp.so
-       $(INSTALL_DIR) $(1)/usr/lib/lua/lxp
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/lxp
-endef
-
-$(eval $(call BuildPackage,luaexpat))
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.c b/lang/luaexpat/files/compat-5.1r5/compat-5.1.c
deleted file mode 100644 (file)
index 6fdb8b7..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-** Compat-5.1
-** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
-** $Id: compat-5.1.c,v 1.13 2006/02/20 21:12:47 carregal Exp $
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "lua.h"
-#include "lauxlib.h"
-#include "compat-5.1.h"
-
-static void getfield(lua_State *L, int idx, const char *name) {
-    const char *end = strchr(name, '.');
-    lua_pushvalue(L, idx);
-    while (end) {
-        lua_pushlstring(L, name, end - name);
-        lua_gettable(L, -2);
-        lua_remove(L, -2);
-        if (lua_isnil(L, -1)) return;
-        name = end+1;
-        end = strchr(name, '.');
-    }
-    lua_pushstring(L, name);
-    lua_gettable(L, -2);
-    lua_remove(L, -2);
-}
-
-static void setfield(lua_State *L, int idx, const char *name) {
-    const char *end = strchr(name, '.');
-    lua_pushvalue(L, idx);
-    while (end) {
-        lua_pushlstring(L, name, end - name);
-        lua_gettable(L, -2);
-        /* create table if not found */
-        if (lua_isnil(L, -1)) {
-            lua_pop(L, 1);
-            lua_newtable(L);
-            lua_pushlstring(L, name, end - name);
-            lua_pushvalue(L, -2);
-            lua_settable(L, -4);
-        }
-        lua_remove(L, -2);
-        name = end+1;
-        end = strchr(name, '.');
-    }
-    lua_pushstring(L, name);
-    lua_pushvalue(L, -3);
-    lua_settable(L, -3);
-    lua_pop(L, 2);
-}
-
-LUALIB_API void luaL_module(lua_State *L, const char *libname,
-                              const luaL_reg *l, int nup) {
-  if (libname) {
-    getfield(L, LUA_GLOBALSINDEX, libname);  /* check whether lib already exists */
-    if (lua_isnil(L, -1)) { 
-      int env, ns;
-      lua_pop(L, 1); /* get rid of nil */
-      lua_pushliteral(L, "require");
-      lua_gettable(L, LUA_GLOBALSINDEX); /* look for require */
-      lua_getfenv(L, -1); /* getfenv(require) */
-      lua_remove(L, -2); /* remove function require */
-      env = lua_gettop(L);
-
-      lua_newtable(L); /* create namespace for lib */
-      ns = lua_gettop(L);
-      getfield(L, env, "package.loaded"); /* get package.loaded table */
-      if (lua_isnil(L, -1)) { /* create package.loaded table */
-          lua_pop(L, 1); /* remove previous result */
-          lua_newtable(L);
-          lua_pushvalue(L, -1);
-          setfield(L, env, "package.loaded");
-      }
-      else if (!lua_istable(L, -1))
-        luaL_error(L, "name conflict for library `%s'", libname);
-      lua_pushstring(L, libname);
-      lua_pushvalue(L, ns); 
-      lua_settable(L, -3); /* package.loaded[libname] = ns */
-      lua_pop(L, 1); /* get rid of package.loaded table */
-      lua_pushvalue(L, ns); /* copy namespace */
-      setfield(L, LUA_GLOBALSINDEX, libname);
-      lua_remove (L, env); /* remove env */
-    }
-    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
-  }
-  for (; l->name; l++) {
-    int i;
-    lua_pushstring(L, l->name);
-    for (i=0; i<nup; i++)  /* copy upvalues to the top */
-      lua_pushvalue(L, -(nup+1));
-    lua_pushcclosure(L, l->func, nup);
-    lua_settable(L, -(nup+3));
-  }
-  lua_pop(L, nup);  /* remove upvalues */
-}
-
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.h b/lang/luaexpat/files/compat-5.1r5/compat-5.1.h
deleted file mode 100644 (file)
index 97570d9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-** Compat-5.1
-** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat/)
-** $Id: compat-5.1.h,v 1.8 2006/02/20 21:12:47 carregal Exp $
-*/
-
-#ifndef COMPAT_H
-
-LUALIB_API void luaL_module(lua_State *L, const char *libname,
-                                       const luaL_reg *l, int nup);
-#define luaL_openlib luaL_module
-
-#endif
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua b/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua
deleted file mode 100644 (file)
index 0938d56..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
---
--- Compat-5.1
--- Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
--- According to Lua 5.1
--- $Id: compat-5.1.lua,v 1.22 2006/02/20 21:12:47 carregal Exp $
---
-
-_COMPAT51 = "Compat-5.1 R5"
-
-local LUA_DIRSEP = '/'
-local LUA_OFSEP = '_'
-local OLD_LUA_OFSEP = ''
-local POF = 'luaopen_'
-local LUA_PATH_MARK = '?'
-local LUA_IGMARK = ':'
-
-local assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type = assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type
-local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub
-
---
--- avoid overwriting the package table if it's already there
---
-package = package or {}
-local _PACKAGE = package
-
-package.path = LUA_PATH or os.getenv("LUA_PATH") or
-             ("./?.lua;" ..
-              "/usr/local/share/lua/5.0/?.lua;" ..
-              "/usr/local/share/lua/5.0/?/?.lua;" ..
-              "/usr/local/share/lua/5.0/?/init.lua" )
-package.cpath = LUA_CPATH or os.getenv("LUA_CPATH") or
-             "./?.so;" ..
-             "./l?.so;" ..
-             "/usr/local/lib/lua/5.0/?.so;" ..
-             "/usr/local/lib/lua/5.0/l?.so"
-
---
--- make sure require works with standard libraries
---
-package.loaded = package.loaded or {}
-package.loaded.debug = debug
-package.loaded.string = string
-package.loaded.math = math
-package.loaded.io = io
-package.loaded.os = os
-package.loaded.table = table 
-package.loaded.base = _G
-package.loaded.coroutine = coroutine
-local _LOADED = package.loaded
-
---
--- avoid overwriting the package.preload table if it's already there
---
-package.preload = package.preload or {}
-local _PRELOAD = package.preload
-
-
---
--- looks for a file `name' in given path
---
-local function findfile (name, pname)
-       name = gsub (name, "%.", LUA_DIRSEP)
-       local path = _PACKAGE[pname]
-       assert (type(path) == "string", format ("package.%s must be a string", pname))
-       for c in gfind (path, "[^;]+") do
-               c = gsub (c, "%"..LUA_PATH_MARK, name)
-               local f = io.open (c)
-               if f then
-                       f:close ()
-                       return c
-               end
-       end
-       return nil -- not found
-end
-
-
---
--- check whether library is already loaded
---
-local function loader_preload (name)
-       assert (type(name) == "string", format (
-               "bad argument #1 to `require' (string expected, got %s)", type(name)))
-       assert (type(_PRELOAD) == "table", "`package.preload' must be a table")
-       return _PRELOAD[name]
-end
-
-
---
--- Lua library loader
---
-local function loader_Lua (name)
-       assert (type(name) == "string", format (
-               "bad argument #1 to `require' (string expected, got %s)", type(name)))
-       local filename = findfile (name, "path")
-       if not filename then
-               return false
-       end
-       local f, err = loadfile (filename)
-       if not f then
-               error (format ("error loading module `%s' (%s)", name, err))
-       end
-       return f
-end
-
-
-local function mkfuncname (name)
-       name = gsub (name, "^.*%"..LUA_IGMARK, "")
-       name = gsub (name, "%.", LUA_OFSEP)
-       return POF..name
-end
-
-local function old_mkfuncname (name)
-       --name = gsub (name, "^.*%"..LUA_IGMARK, "")
-       name = gsub (name, "%.", OLD_LUA_OFSEP)
-       return POF..name
-end
-
---
--- C library loader
---
-local function loader_C (name)
-       assert (type(name) == "string", format (
-               "bad argument #1 to `require' (string expected, got %s)", type(name)))
-       local filename = findfile (name, "cpath")
-       if not filename then
-               return false
-       end
-       local funcname = mkfuncname (name)
-       local f, err = loadlib (filename, funcname)
-       if not f then
-               funcname = old_mkfuncname (name)
-               f, err = loadlib (filename, funcname)
-               if not f then
-                       error (format ("error loading module `%s' (%s)", name, err))
-               end
-       end
-       return f
-end
-
-
-local function loader_Croot (name)
-       local p = gsub (name, "^([^.]*).-$", "%1")
-       if p == "" then
-               return
-       end
-       local filename = findfile (p, "cpath")
-       if not filename then
-               return
-       end
-       local funcname = mkfuncname (name)
-       local f, err, where = loadlib (filename, funcname)
-       if f then
-               return f
-       elseif where ~= "init" then
-               error (format ("error loading module `%s' (%s)", name, err))
-       end
-end
-
--- create `loaders' table
-package.loaders = package.loaders or { loader_preload, loader_Lua, loader_C, loader_Croot, }
-local _LOADERS = package.loaders
-
-
---
--- iterate over available loaders
---
-local function load (name, loaders)
-       -- iterate over available loaders
-       assert (type (loaders) == "table", "`package.loaders' must be a table")
-       for i, loader in ipairs (loaders) do
-               local f = loader (name)
-               if f then
-                       return f
-               end
-       end
-       error (format ("module `%s' not found", name))
-end
-
--- sentinel
-local sentinel = function () end
-
---
--- new require
---
-function _G.require (modname)
-       assert (type(modname) == "string", format (
-               "bad argument #1 to `require' (string expected, got %s)", type(name)))
-       local p = _LOADED[modname]
-       if p then -- is it there?
-               if p == sentinel then
-                       error (format ("loop or previous error loading module '%s'", modname))
-               end
-               return p -- package is already loaded
-       end
-       local init = load (modname, _LOADERS)
-       _LOADED[modname] = sentinel
-       local actual_arg = _G.arg
-       _G.arg = { modname }
-       local res = init (modname)
-       if res then
-               _LOADED[modname] = res
-       end
-       _G.arg = actual_arg
-       if _LOADED[modname] == sentinel then
-               _LOADED[modname] = true
-       end
-       return _LOADED[modname]
-end
-
-
--- findtable
-local function findtable (t, f)
-       assert (type(f)=="string", "not a valid field name ("..tostring(f)..")")
-       local ff = f.."."
-       local ok, e, w = find (ff, '(.-)%.', 1)
-       while ok do
-               local nt = rawget (t, w)
-               if not nt then
-                       nt = {}
-                       t[w] = nt
-               elseif type(t) ~= "table" then
-                       return sub (f, e+1)
-               end
-               t = nt
-               ok, e, w = find (ff, '(.-)%.', e+1)
-       end
-       return t
-end
-
---
--- new package.seeall function
---
-function _PACKAGE.seeall (module)
-       local t = type(module)
-       assert (t == "table", "bad argument #1 to package.seeall (table expected, got "..t..")")
-       local meta = getmetatable (module)
-       if not meta then
-               meta = {}
-               setmetatable (module, meta)
-       end
-       meta.__index = _G
-end
-
-
---
--- new module function
---
-function _G.module (modname, ...)
-       local ns = _LOADED[modname]
-       if type(ns) ~= "table" then
-               ns = findtable (_G, modname)
-               if not ns then
-                       error (string.format ("name conflict for module '%s'", modname))
-               end
-               _LOADED[modname] = ns
-       end
-       if not ns._NAME then
-               ns._NAME = modname
-               ns._M = ns
-               ns._PACKAGE = gsub (modname, "[^.]*$", "")
-       end
-       setfenv (2, ns)
-       for i, f in ipairs (arg) do
-               f (ns)
-       end
-end
diff --git a/lang/luafilesystem/Makefile b/lang/luafilesystem/Makefile
deleted file mode 100644 (file)
index a59f451..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Copyright (C) 2008-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luafilesystem
-PKG_VERSION:=1.8.0
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_MIRROR_HASH:=69c676dd811fc77e205b1b8064017536fade1be47e50ba785c243a5d7540cdf6
-PKG_SOURCE_URL:=https://github.com/keplerproject/luafilesystem.git
-PKG_SOURCE_VERSION:=v$(subst .,_,$(PKG_VERSION))
-PKG_SOURCE_PROTO:=git
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luafilesystem
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=LuaFileSystem
-  URL:=http://keplerproject.github.com/luafilesystem/
-  MAINTAINER:=W. Michael Petullo <[email protected]>
-  DEPENDS:=+liblua
-endef
-
-define Package/luafilesystem/description
- This package contains the LuaFileSystem library, a set of portable
- functions for directory creation, listing and deletion and for file
- locking.
-endef
-
-define Build/Configure
-endef
-
-TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS)
-
-TARGET_LDFLAGS += -llua
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \
-               LDFLAGS="$(TARGET_LDFLAGS)"
-       $(TARGET_CROSS)ar r $(PKG_BUILD_DIR)/src/luafilesystem.a $(PKG_BUILD_DIR)/src/lfs.o
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
-       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lfs.h $(STAGING_DIR)/usr/include
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(STAGING_DIR)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/luafilesystem.a $(STAGING_DIR)/usr/lib/lua
-endef
-
-define Package/luafilesystem/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(1)/usr/lib/lua/lfs.so
-endef
-
-$(eval $(call BuildPackage,luafilesystem))
diff --git a/lang/luajit/Makefile b/lang/luajit/Makefile
deleted file mode 100644 (file)
index 538db73..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luajit
-PKG_VERSION:=2.1.0
-PKG_REAL_VERSION:=$(PKG_VERSION)-beta3
-PKG_RELEASE:=8
-
-PKG_SOURCE:=LuaJIT-$(PKG_REAL_VERSION).tar.gz
-PKG_SOURCE_URL:=https://luajit.org/download
-PKG_HASH:=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
-PKG_BUILD_DIR:=$(BUILD_DIR)/LuaJIT-$(PKG_REAL_VERSION)
-
-PKG_MAINTAINER:=Morteza Milani <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYRIGHT
-PKG_CPE_ID:=cpe:/a:luajit:luajit
-
-PKG_BUILD_FLAGS:=no-mips16
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/host-build.mk
-
-define Package/luajit
- SUBMENU:=Lua
- SECTION:=lang
- CATEGORY:=Languages
- TITLE:=LuaJIT
- URL:=https://www.luajit.org
- DEPENDS:=@HAS_LUAJIT_ARCH
-endef
-
-define Package/luajit/description
- LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
-endef
-
-define Package/luajit/config
-config HAS_LUAJIT_ARCH
-       bool
-       default y if i386||x86_64||arm||armeb||aarch64||powerpc||mips||mipsel||mips64
-endef
-
-ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
-  ifeq ($(CONFIG_ARCH_64BIT),)
-    HOST_BITS := -m32
-  endif
-endif
-
-define Build/Compile
-       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-               HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
-               CROSS="$(TARGET_CROSS)" \
-               DPREFIX=$(PKG_INSTALL_DIR)/usr \
-               PREFIX=/usr \
-               TARGET_SYS=Linux \
-               TARGET_CFLAGS="$(TARGET_CFLAGS)" \
-               BUILDMODE=dynamic
-       rm -rf $(PKG_INSTALL_DIR)
-       mkdir -p $(PKG_INSTALL_DIR)
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DPREFIX=$(PKG_INSTALL_DIR)/usr \
-               PREFIX=/usr \
-               TARGET_SYS=Linux \
-               install
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
-endef
-
-define Package/luajit/install
-       $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(1)/usr/bin/$(PKG_NAME)
-endef
-
-define Host/Compile
-       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               DPREFIX=$(STAGING_DIR_HOSTPKG) \
-               TARGET_CFLAGS="$(HOST_CFLAGS)" \
-               TARGET_LDFLAGS="$(HOST_LDFLAGS)"
-endef
-
-define Host/Install
-       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               DPREFIX=$(STAGING_DIR_HOSTPKG) \
-               install
-       $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-$(PKG_REAL_VERSION) $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
-endef
-
-$(eval $(call HostBuild,luajit))
-$(eval $(call BuildPackage,luajit))
diff --git a/lang/luajit/patches/010-lua-path.patch b/lang/luajit/patches/010-lua-path.patch
deleted file mode 100644 (file)
index f752002..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/luaconf.h
-+++ b/src/luaconf.h
-@@ -35,8 +35,8 @@
- #ifndef LUA_LMULTILIB
- #define LUA_LMULTILIB "lib"
- #endif
--#define LUA_LROOT     "/usr/local"
--#define LUA_LUADIR    "/lua/5.1/"
-+#define LUA_LROOT     "/usr"
-+#define LUA_LUADIR    "/lua/"
- #define LUA_LJDIR     "/luajit-2.1.0-beta3/"
- #ifdef LUA_ROOT
diff --git a/lang/luajit/patches/020-clang.patch b/lang/luajit/patches/020-clang.patch
deleted file mode 100644 (file)
index e0a5374..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/src/lj_arch.h
-+++ b/src/lj_arch.h
-@@ -391,9 +391,6 @@
- #endif
- #endif
- #elif !LJ_TARGET_PS3
--#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
--#error "Need at least GCC 4.3 or newer"
--#endif
- #endif
- #endif
diff --git a/lang/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch b/lang/luajit/patches/030_fix_posix_install_with_missing_or_incompatible_ldconfig.patch
deleted file mode 100644 (file)
index 70f664c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 18c9cf7d3788a8f7408df45df92fc4ae3bcc0d80
-Author: Mike Pall <mike>
-Date:   Sat Jan 25 17:37:12 2020 +0100
-
-    Fix POSIX install with missing or incompatible ldconfig.
-
---- a/Makefile
-+++ b/Makefile
-@@ -75,7 +75,7 @@ SYMLINK= ln -sf
- INSTALL_X= install -m 0755
- INSTALL_F= install -m 0644
- UNINSTALL= $(RM)
--LDCONFIG= ldconfig -n
-+LDCONFIG= ldconfig -n 2>/dev/null
- SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
-             -e "s|^multilib=.*|multilib=$(MULTILIB)|"
-@@ -121,7 +121,7 @@ install: $(INSTALL_DEP)
-       $(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)
-       cd src && test -f $(FILE_SO) && \
-         $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \
--        $(LDCONFIG) $(INSTALL_LIB) && \
-+        ( $(LDCONFIG) $(INSTALL_LIB) || : ) && \
-         $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \
-         $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :
-       cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)
diff --git a/lang/luajit/patches/040-softfloat-ppc.patch b/lang/luajit/patches/040-softfloat-ppc.patch
deleted file mode 100644 (file)
index c424b9e..0000000
+++ /dev/null
@@ -1,2742 +0,0 @@
-From fd37da0d586c331b0008fbfd653a9659344fe76f Mon Sep 17 00:00:00 2001
-From: Mike Pall <mike>
-Date: Wed, 26 Jul 2017 09:52:19 +0200
-Subject: [PATCH] PPC: Add soft-float support to interpreter.
-
-Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
-Sponsored by Cisco Systems, Inc.
----
- src/host/buildvm_asm.c |    2 +-
- src/lj_arch.h          |   29 +-
- src/lj_ccall.c         |   38 +-
- src/lj_ccall.h         |    4 +-
- src/lj_ccallback.c     |   30 +-
- src/lj_frame.h         |    2 +-
- src/lj_ircall.h        |    2 +-
- src/vm_ppc.dasc        | 1249 +++++++++++++++++++++++++++++++++-------
- 8 files changed, 1101 insertions(+), 255 deletions(-)
-
---- a/src/host/buildvm_asm.c
-+++ b/src/host/buildvm_asm.c
-@@ -338,7 +338,7 @@ void emit_asm(BuildCtx *ctx)
- #if !(LJ_TARGET_PS3 || LJ_TARGET_PSVITA)
-     fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX "progbits\n");
- #endif
--#if LJ_TARGET_PPC && !LJ_TARGET_PS3
-+#if LJ_TARGET_PPC && !LJ_TARGET_PS3 && !LJ_ABI_SOFTFP
-     /* Hard-float ABI. */
-     fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n");
- #endif
---- a/src/lj_arch.h
-+++ b/src/lj_arch.h
-@@ -254,6 +254,29 @@
- #else
- #define LJ_ARCH_BITS          32
- #define LJ_ARCH_NAME          "ppc"
-+
-+#if !defined(LJ_ARCH_HASFPU)
-+#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
-+#define LJ_ARCH_HASFPU                0
-+#else
-+#define LJ_ARCH_HASFPU                1
-+#endif
-+#endif
-+
-+#if !defined(LJ_ABI_SOFTFP)
-+#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
-+#define LJ_ABI_SOFTFP         1
-+#else
-+#define LJ_ABI_SOFTFP         0
-+#endif
-+#endif
-+#endif
-+
-+#if LJ_ABI_SOFTFP
-+#define LJ_ARCH_NOJIT         1  /* NYI */
-+#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
-+#else
-+#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
- #endif
- #define LJ_TARGET_PPC         1
-@@ -262,7 +285,6 @@
- #define LJ_TARGET_MASKSHIFT   0
- #define LJ_TARGET_MASKROT     1
- #define LJ_TARGET_UNIFYROT    1       /* Want only IR_BROL. */
--#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
- #if LJ_TARGET_CONSOLE
- #define LJ_ARCH_PPC32ON64     1
-@@ -415,16 +437,13 @@
- #error "No support for ILP32 model on ARM64"
- #endif
- #elif LJ_TARGET_PPC
--#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
--#error "No support for PowerPC CPUs without double-precision FPU"
--#endif
- #if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
- #error "No support for little-endian PPC32"
- #endif
- #if LJ_ARCH_PPC64
- #error "No support for PowerPC 64 bit mode (yet)"
- #endif
--#ifdef __NO_FPRS__
-+#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
- #error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
- #endif
- #elif LJ_TARGET_MIPS32
---- a/src/lj_ccall.c
-+++ b/src/lj_ccall.c
-@@ -387,6 +387,24 @@
- #define CCALL_HANDLE_COMPLEXARG \
-   /* Pass complex by value in 2 or 4 GPRs. */
-+#define CCALL_HANDLE_GPR \
-+  /* Try to pass argument in GPRs. */ \
-+  if (n > 1) { \
-+    lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
-+    if (ctype_isinteger(d->info) || ctype_isfp(d->info)) \
-+      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
-+    else if (ngpr + n > maxgpr) \
-+      ngpr = maxgpr;  /* Prevent reordering. */ \
-+  } \
-+  if (ngpr + n <= maxgpr) { \
-+    dp = &cc->gpr[ngpr]; \
-+    ngpr += n; \
-+    goto done; \
-+  } \
-+
-+#if LJ_ABI_SOFTFP
-+#define CCALL_HANDLE_REGARG  CCALL_HANDLE_GPR
-+#else
- #define CCALL_HANDLE_REGARG \
-   if (isfp) {  /* Try to pass argument in FPRs. */ \
-     if (nfpr + 1 <= CCALL_NARG_FPR) { \
-@@ -395,24 +413,16 @@
-       d = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */ \
-       goto done; \
-     } \
--  } else {  /* Try to pass argument in GPRs. */ \
--    if (n > 1) { \
--      lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
--      if (ctype_isinteger(d->info)) \
--      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
--      else if (ngpr + n > maxgpr) \
--      ngpr = maxgpr;  /* Prevent reordering. */ \
--    } \
--    if (ngpr + n <= maxgpr) { \
--      dp = &cc->gpr[ngpr]; \
--      ngpr += n; \
--      goto done; \
--    } \
-+  } else { \
-+    CCALL_HANDLE_GPR \
-   }
-+#endif
-+#if !LJ_ABI_SOFTFP
- #define CCALL_HANDLE_RET \
-   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
-     ctr = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */
-+#endif
- #elif LJ_TARGET_MIPS32
- /* -- MIPS o32 calling conventions ---------------------------------------- */
-@@ -1080,7 +1090,7 @@ static int ccall_set_args(lua_State *L,
-   }
-   if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG);  /* Too few arguments. */
--#if LJ_TARGET_X64 || LJ_TARGET_PPC
-+#if LJ_TARGET_X64 || (LJ_TARGET_PPC && !LJ_ABI_SOFTFP)
-   cc->nfpr = nfpr;  /* Required for vararg functions. */
- #endif
-   cc->nsp = nsp;
---- a/src/lj_ccall.h
-+++ b/src/lj_ccall.h
-@@ -86,9 +86,9 @@ typedef union FPRArg {
- #elif LJ_TARGET_PPC
- #define CCALL_NARG_GPR                8
--#define CCALL_NARG_FPR                8
-+#define CCALL_NARG_FPR                (LJ_ABI_SOFTFP ? 0 : 8)
- #define CCALL_NRET_GPR                4       /* For complex double. */
--#define CCALL_NRET_FPR                1
-+#define CCALL_NRET_FPR                (LJ_ABI_SOFTFP ? 0 : 1)
- #define CCALL_SPS_EXTRA               4
- #define CCALL_SPS_FREE                0
---- a/src/lj_ccallback.c
-+++ b/src/lj_ccallback.c
-@@ -419,6 +419,23 @@ void lj_ccallback_mcode_free(CTState *ct
- #elif LJ_TARGET_PPC
-+#define CALLBACK_HANDLE_GPR \
-+  if (n > 1) { \
-+    lua_assert(((LJ_ABI_SOFTFP && ctype_isnum(cta->info)) ||  /* double. */ \
-+              ctype_isinteger(cta->info)) && n == 2);  /* int64_t. */ \
-+    ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
-+  } \
-+  if (ngpr + n <= maxgpr) { \
-+    sp = &cts->cb.gpr[ngpr]; \
-+    ngpr += n; \
-+    goto done; \
-+  }
-+
-+#if LJ_ABI_SOFTFP
-+#define CALLBACK_HANDLE_REGARG \
-+  CALLBACK_HANDLE_GPR \
-+  UNUSED(isfp);
-+#else
- #define CALLBACK_HANDLE_REGARG \
-   if (isfp) { \
-     if (nfpr + 1 <= CCALL_NARG_FPR) { \
-@@ -427,20 +444,15 @@ void lj_ccallback_mcode_free(CTState *ct
-       goto done; \
-     } \
-   } else {  /* Try to pass argument in GPRs. */ \
--    if (n > 1) { \
--      lua_assert(ctype_isinteger(cta->info) && n == 2);  /* int64_t. */ \
--      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
--    } \
--    if (ngpr + n <= maxgpr) { \
--      sp = &cts->cb.gpr[ngpr]; \
--      ngpr += n; \
--      goto done; \
--    } \
-+    CALLBACK_HANDLE_GPR \
-   }
-+#endif
-+#if !LJ_ABI_SOFTFP
- #define CALLBACK_HANDLE_RET \
-   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
-     *(double *)dp = *(float *)dp;  /* FPRs always hold doubles. */
-+#endif
- #elif LJ_TARGET_MIPS32
---- a/src/lj_frame.h
-+++ b/src/lj_frame.h
-@@ -226,7 +226,7 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CAL
- #define CFRAME_OFS_L          36
- #define CFRAME_OFS_PC         32
- #define CFRAME_OFS_MULTRES    28
--#define CFRAME_SIZE           272
-+#define CFRAME_SIZE           (LJ_ARCH_HASFPU ? 272 : 128)
- #define CFRAME_SHIFT_MULTRES  3
- #endif
- #elif LJ_TARGET_MIPS32
---- a/src/lj_ircall.h
-+++ b/src/lj_ircall.h
-@@ -272,7 +272,7 @@ LJ_DATA const CCallInfo lj_ir_callinfo[I
- #define fp64_f2l __aeabi_f2lz
- #define fp64_f2ul __aeabi_f2ulz
- #endif
--#elif LJ_TARGET_MIPS
-+#elif LJ_TARGET_MIPS || LJ_TARGET_PPC
- #define softfp_add __adddf3
- #define softfp_sub __subdf3
- #define softfp_mul __muldf3
---- a/src/vm_ppc.dasc
-+++ b/src/vm_ppc.dasc
-@@ -103,6 +103,18 @@
- |// Fixed register assignments for the interpreter.
- |// Don't use: r1 = sp, r2 and r13 = reserved (TOC, TLS or SDATA)
- |
-+|.macro .FPU, a, b
-+|.if FPU
-+|  a, b
-+|.endif
-+|.endmacro
-+|
-+|.macro .FPU, a, b, c
-+|.if FPU
-+|  a, b, c
-+|.endif
-+|.endmacro
-+|
- |// The following must be C callee-save (but BASE is often refetched).
- |.define BASE,                r14     // Base of current Lua stack frame.
- |.define KBASE,               r15     // Constants of current Lua function.
-@@ -116,8 +128,10 @@
- |.define TISNUM,      r22
- |.define TISNIL,      r23
- |.define ZERO,                r24
-+|.if FPU
- |.define TOBIT,               f30     // 2^52 + 2^51.
- |.define TONUM,               f31     // 2^52 + 2^51 + 2^31.
-+|.endif
- |
- |// The following temporaries are not saved across C calls, except for RA.
- |.define RA,          r20     // Callee-save.
-@@ -133,6 +147,7 @@
- |
- |// Saved temporaries.
- |.define SAVE0,               r21
-+|.define SAVE1,               r25
- |
- |// Calling conventions.
- |.define CARG1,               r3
-@@ -141,8 +156,10 @@
- |.define CARG4,               r6      // Overlaps TMP3.
- |.define CARG5,               r7      // Overlaps INS.
- |
-+|.if FPU
- |.define FARG1,               f1
- |.define FARG2,               f2
-+|.endif
- |
- |.define CRET1,               r3
- |.define CRET2,               r4
-@@ -213,10 +230,16 @@
- |.endif
- |.else
- |
-+|.if FPU
- |.define SAVE_LR,     276(sp)
- |.define CFRAME_SPACE,        272     // Delta for sp.
- |// Back chain for sp:        272(sp) <-- sp entering interpreter
- |.define SAVE_FPR_,   128     // .. 128+18*8: 64 bit FPR saves.
-+|.else
-+|.define SAVE_LR,     132(sp)
-+|.define CFRAME_SPACE,        128     // Delta for sp.
-+|// Back chain for sp:        128(sp) <-- sp entering interpreter
-+|.endif
- |.define SAVE_GPR_,   56      // .. 56+18*4: 32 bit GPR saves.
- |.define SAVE_CR,     52(sp)  // 32 bit CR save.
- |.define SAVE_ERRF,   48(sp)  // 32 bit C frame info.
-@@ -226,16 +249,25 @@
- |.define SAVE_PC,     32(sp)
- |.define SAVE_MULTRES,        28(sp)
- |.define UNUSED1,     24(sp)
-+|.if FPU
- |.define TMPD_LO,     20(sp)
- |.define TMPD_HI,     16(sp)
- |.define TONUM_LO,    12(sp)
- |.define TONUM_HI,    8(sp)
-+|.else
-+|.define SFSAVE_4,    20(sp)
-+|.define SFSAVE_3,    16(sp)
-+|.define SFSAVE_2,    12(sp)
-+|.define SFSAVE_1,    8(sp)
-+|.endif
- |// Next frame lr:    4(sp)
- |// Back chain for sp:        0(sp)   <-- sp while in interpreter
- |
-+|.if FPU
- |.define TMPD_BLO,    23(sp)
- |.define TMPD,                TMPD_HI
- |.define TONUM_D,     TONUM_HI
-+|.endif
- |
- |.endif
- |
-@@ -245,7 +277,7 @@
- |.else
- |  stw r..reg, SAVE_GPR_+(reg-14)*4(sp)
- |.endif
--|  stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
-+|  .FPU stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
- |.endmacro
- |.macro rest_, reg
- |.if GPR64
-@@ -253,7 +285,7 @@
- |.else
- |  lwz r..reg, SAVE_GPR_+(reg-14)*4(sp)
- |.endif
--|  lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
-+|  .FPU lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
- |.endmacro
- |
- |.macro saveregs
-@@ -323,6 +355,7 @@
- |// Trap for not-yet-implemented parts.
- |.macro NYI; tw 4, sp, sp; .endmacro
- |
-+|.if FPU
- |// int/FP conversions.
- |.macro tonum_i, freg, reg
- |  xoris reg, reg, 0x8000
-@@ -346,6 +379,7 @@
- |.macro toint, reg, freg
- |  toint reg, freg, freg
- |.endmacro
-+|.endif
- |
- |//-----------------------------------------------------------------------
- |
-@@ -533,9 +567,19 @@ static void build_subroutines(BuildCtx *
-   |  beq >2
-   |1:
-   |  addic. TMP1, TMP1, -8
-+  |.if FPU
-   |   lfd f0, 0(RA)
-+  |.else
-+  |   lwz CARG1, 0(RA)
-+  |   lwz CARG2, 4(RA)
-+  |.endif
-   |    addi RA, RA, 8
-+  |.if FPU
-   |   stfd f0, 0(BASE)
-+  |.else
-+  |   stw CARG1, 0(BASE)
-+  |   stw CARG2, 4(BASE)
-+  |.endif
-   |    addi BASE, BASE, 8
-   |  bney <1
-   |
-@@ -613,23 +657,23 @@ static void build_subroutines(BuildCtx *
-   |  .toc ld TOCREG, SAVE_TOC
-   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
-   |  lp BASE, L->base
--  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
-+  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
-   |   lwz DISPATCH, L->glref          // Setup pointer to dispatch table.
-   |     li ZERO, 0
--  |     stw TMP3, TMPD
-+  |     .FPU stw TMP3, TMPD
-   |  li TMP1, LJ_TFALSE
--  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
-+  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
-   |     li TISNIL, LJ_TNIL
-   |    li_vmstate INTERP
--  |     lfs TOBIT, TMPD
-+  |     .FPU lfs TOBIT, TMPD
-   |  lwz PC, FRAME_PC(BASE)           // Fetch PC of previous frame.
-   |  la RA, -8(BASE)                  // Results start at BASE-8.
--  |     stw TMP3, TMPD
-+  |     .FPU stw TMP3, TMPD
-   |   addi DISPATCH, DISPATCH, GG_G2DISP
-   |  stw TMP1, 0(RA)                  // Prepend false to error message.
-   |  li RD, 16                                // 2 results: false + error message.
-   |    st_vmstate
--  |     lfs TONUM, TMPD
-+  |     .FPU lfs TONUM, TMPD
-   |  b ->vm_returnc
-   |
-   |//-----------------------------------------------------------------------
-@@ -690,22 +734,22 @@ static void build_subroutines(BuildCtx *
-   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
-   |   lp TMP1, L->top
-   |  lwz PC, FRAME_PC(BASE)
--  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
-+  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
-   |    stb CARG3, L->status
--  |     stw TMP3, TMPD
--  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
--  |     lfs TOBIT, TMPD
-+  |     .FPU stw TMP3, TMPD
-+  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
-+  |     .FPU lfs TOBIT, TMPD
-   |   sub RD, TMP1, BASE
--  |     stw TMP3, TMPD
--  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
-+  |     .FPU stw TMP3, TMPD
-+  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
-   |   addi RD, RD, 8
--  |     stw TMP0, TONUM_HI
-+  |     .FPU stw TMP0, TONUM_HI
-   |    li_vmstate INTERP
-   |     li ZERO, 0
-   |    st_vmstate
-   |  andix. TMP0, PC, FRAME_TYPE
-   |   mr MULTRES, RD
--  |     lfs TONUM, TMPD
-+  |     .FPU lfs TONUM, TMPD
-   |     li TISNIL, LJ_TNIL
-   |  beq ->BC_RET_Z
-   |  b ->vm_return
-@@ -739,19 +783,19 @@ static void build_subroutines(BuildCtx *
-   |  lp TMP2, L->base                 // TMP2 = old base (used in vmeta_call).
-   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
-   |   lp TMP1, L->top
--  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
-+  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
-   |  add PC, PC, BASE
--  |     stw TMP3, TMPD
-+  |     .FPU stw TMP3, TMPD
-   |     li ZERO, 0
--  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
--  |     lfs TOBIT, TMPD
-+  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
-+  |     .FPU lfs TOBIT, TMPD
-   |  sub PC, PC, TMP2                 // PC = frame delta + frame type
--  |     stw TMP3, TMPD
--  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
-+  |     .FPU stw TMP3, TMPD
-+  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
-   |   sub NARGS8:RC, TMP1, BASE
--  |     stw TMP0, TONUM_HI
-+  |     .FPU stw TMP0, TONUM_HI
-   |    li_vmstate INTERP
--  |     lfs TONUM, TMPD
-+  |     .FPU lfs TONUM, TMPD
-   |     li TISNIL, LJ_TNIL
-   |    st_vmstate
-   |
-@@ -839,15 +883,30 @@ static void build_subroutines(BuildCtx *
-   |  lwz INS, -4(PC)
-   |   subi CARG2, RB, 16
-   |  decode_RB8 SAVE0, INS
-+  |.if FPU
-   |   lfd f0, 0(RA)
-+  |.else
-+  |   lwz TMP2, 0(RA)
-+  |   lwz TMP3, 4(RA)
-+  |.endif
-   |  add TMP1, BASE, SAVE0
-   |   stp BASE, L->base
-   |  cmplw TMP1, CARG2
-   |   sub CARG3, CARG2, TMP1
-   |  decode_RA8 RA, INS
-+  |.if FPU
-   |   stfd f0, 0(CARG2)
-+  |.else
-+  |   stw TMP2, 0(CARG2)
-+  |   stw TMP3, 4(CARG2)
-+  |.endif
-   |  bney ->BC_CAT_Z
-+  |.if FPU
-   |   stfdx f0, BASE, RA
-+  |.else
-+  |   stwux TMP2, RA, BASE
-+  |   stw TMP3, 4(RA)
-+  |.endif
-   |  b ->cont_nop
-   |
-   |//-- Table indexing metamethods -----------------------------------------
-@@ -900,9 +959,19 @@ static void build_subroutines(BuildCtx *
-   |  // Returns TValue * (finished) or NULL (metamethod).
-   |  cmplwi CRET1, 0
-   |  beq >3
-+  |.if FPU
-   |   lfd f0, 0(CRET1)
-+  |.else
-+  |   lwz TMP0, 0(CRET1)
-+  |   lwz TMP1, 4(CRET1)
-+  |.endif
-   |  ins_next1
-+  |.if FPU
-   |   stfdx f0, BASE, RA
-+  |.else
-+  |   stwux TMP0, RA, BASE
-+  |   stw TMP1, 4(RA)
-+  |.endif
-   |  ins_next2
-   |
-   |3:  // Call __index metamethod.
-@@ -920,7 +989,12 @@ static void build_subroutines(BuildCtx *
-   |  // Returns cTValue * or NULL.
-   |  cmplwi CRET1, 0
-   |  beq >1
-+  |.if FPU
-   |  lfd f14, 0(CRET1)
-+  |.else
-+  |  lwz SAVE0, 0(CRET1)
-+  |  lwz SAVE1, 4(CRET1)
-+  |.endif
-   |  b ->BC_TGETR_Z
-   |1:
-   |  stwx TISNIL, BASE, RA
-@@ -975,11 +1049,21 @@ static void build_subroutines(BuildCtx *
-   |  bl extern lj_meta_tset           // (lua_State *L, TValue *o, TValue *k)
-   |  // Returns TValue * (finished) or NULL (metamethod).
-   |  cmplwi CRET1, 0
-+  |.if FPU
-   |   lfdx f0, BASE, RA
-+  |.else
-+  |   lwzux TMP2, RA, BASE
-+  |   lwz TMP3, 4(RA)
-+  |.endif
-   |  beq >3
-   |  // NOBARRIER: lj_meta_tset ensures the table is not black.
-   |  ins_next1
-+  |.if FPU
-   |   stfd f0, 0(CRET1)
-+  |.else
-+  |   stw TMP2, 0(CRET1)
-+  |   stw TMP3, 4(CRET1)
-+  |.endif
-   |  ins_next2
-   |
-   |3:  // Call __newindex metamethod.
-@@ -990,7 +1074,12 @@ static void build_subroutines(BuildCtx *
-   |   add PC, TMP1, BASE
-   |  lwz LFUNC:RB, FRAME_FUNC(BASE)   // Guaranteed to be a function here.
-   |   li NARGS8:RC, 24                        // 3 args for func(t, k, v)
-+  |.if FPU
-   |  stfd f0, 16(BASE)                        // Copy value to third argument.
-+  |.else
-+  |  stw TMP2, 16(BASE)
-+  |  stw TMP3, 20(BASE)
-+  |.endif
-   |  b ->vm_call_dispatch_f
-   |
-   |->vmeta_tsetr:
-@@ -998,7 +1087,12 @@ static void build_subroutines(BuildCtx *
-   |  stw PC, SAVE_PC
-   |  bl extern lj_tab_setinth  // (lua_State *L, GCtab *t, int32_t key)
-   |  // Returns TValue *.
-+  |.if FPU
-   |  stfd f14, 0(CRET1)
-+  |.else
-+  |  stw SAVE0, 0(CRET1)
-+  |  stw SAVE1, 4(CRET1)
-+  |.endif
-   |  b ->cont_nop
-   |
-   |//-- Comparison metamethods ---------------------------------------------
-@@ -1037,9 +1131,19 @@ static void build_subroutines(BuildCtx *
-   |
-   |->cont_ra:                         // RA = resultptr
-   |  lwz INS, -4(PC)
-+  |.if FPU
-   |   lfd f0, 0(RA)
-+  |.else
-+  |   lwz CARG1, 0(RA)
-+  |   lwz CARG2, 4(RA)
-+  |.endif
-   |  decode_RA8 TMP1, INS
-+  |.if FPU
-   |   stfdx f0, BASE, TMP1
-+  |.else
-+  |   stwux CARG1, TMP1, BASE
-+  |   stw CARG2, 4(TMP1)
-+  |.endif
-   |  b ->cont_nop
-   |
-   |->cont_condt:                      // RA = resultptr
-@@ -1245,22 +1349,32 @@ static void build_subroutines(BuildCtx *
-   |.macro .ffunc_n, name
-   |->ff_ .. name:
-   |  cmplwi NARGS8:RC, 8
--  |   lwz CARG3, 0(BASE)
-+  |   lwz CARG1, 0(BASE)
-+  |.if FPU
-   |    lfd FARG1, 0(BASE)
-+  |.else
-+  |    lwz CARG2, 4(BASE)
-+  |.endif
-   |  blt ->fff_fallback
--  |  checknum CARG3; bge ->fff_fallback
-+  |  checknum CARG1; bge ->fff_fallback
-   |.endmacro
-   |
-   |.macro .ffunc_nn, name
-   |->ff_ .. name:
-   |  cmplwi NARGS8:RC, 16
--  |   lwz CARG3, 0(BASE)
-+  |   lwz CARG1, 0(BASE)
-+  |.if FPU
-   |    lfd FARG1, 0(BASE)
--  |   lwz CARG4, 8(BASE)
-+  |   lwz CARG3, 8(BASE)
-   |    lfd FARG2, 8(BASE)
-+  |.else
-+  |    lwz CARG2, 4(BASE)
-+  |   lwz CARG3, 8(BASE)
-+  |    lwz CARG4, 12(BASE)
-+  |.endif
-   |  blt ->fff_fallback
-+  |  checknum CARG1; bge ->fff_fallback
-   |  checknum CARG3; bge ->fff_fallback
--  |  checknum CARG4; bge ->fff_fallback
-   |.endmacro
-   |
-   |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1.
-@@ -1281,14 +1395,21 @@ static void build_subroutines(BuildCtx *
-   |  bge cr1, ->fff_fallback
-   |   stw CARG3, 0(RA)
-   |  addi RD, NARGS8:RC, 8            // Compute (nresults+1)*8.
-+  |  addi TMP1, BASE, 8
-+  |  add TMP2, RA, NARGS8:RC
-   |   stw CARG1, 4(RA)
-   |  beq ->fff_res                    // Done if exactly 1 argument.
--  |  li TMP1, 8
--  |  subi RC, RC, 8
-   |1:
--  |  cmplw TMP1, RC
--  |   lfdx f0, BASE, TMP1
--  |   stfdx f0, RA, TMP1
-+  |  cmplw TMP1, TMP2
-+  |.if FPU
-+  |   lfd f0, 0(TMP1)
-+  |   stfd f0, 0(TMP1)
-+  |.else
-+  |   lwz CARG1, 0(TMP1)
-+  |   lwz CARG2, 4(TMP1)
-+  |   stw CARG1, -8(TMP1)
-+  |   stw CARG2, -4(TMP1)
-+  |.endif
-   |    addi TMP1, TMP1, 8
-   |  bney <1
-   |  b ->fff_res
-@@ -1303,8 +1424,14 @@ static void build_subroutines(BuildCtx *
-   |  orc TMP1, TMP2, TMP0
-   |  addi TMP1, TMP1, ~LJ_TISNUM+1
-   |  slwi TMP1, TMP1, 3
-+  |.if FPU
-   |   la TMP2, CFUNC:RB->upvalue
-   |  lfdx FARG1, TMP2, TMP1
-+  |.else
-+  |  add TMP1, CFUNC:RB, TMP1
-+  |  lwz CARG1, CFUNC:TMP1->upvalue[0].u32.hi
-+  |  lwz CARG2, CFUNC:TMP1->upvalue[0].u32.lo
-+  |.endif
-   |  b ->fff_resn
-   |
-   |//-- Base library: getters and setters ---------------------------------
-@@ -1382,7 +1509,12 @@ static void build_subroutines(BuildCtx *
-   |   mr CARG1, L
-   |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)
-   |  // Returns cTValue *.
-+  |.if FPU
-   |  lfd FARG1, 0(CRET1)
-+  |.else
-+  |  lwz CARG2, 4(CRET1)
-+  |  lwz CARG1, 0(CRET1)      // Caveat: CARG1 == CRET1.
-+  |.endif
-   |  b ->fff_resn
-   |
-   |//-- Base library: conversions ------------------------------------------
-@@ -1391,7 +1523,11 @@ static void build_subroutines(BuildCtx *
-   |  // Only handles the number case inline (without a base argument).
-   |  cmplwi NARGS8:RC, 8
-   |   lwz CARG1, 0(BASE)
-+  |.if FPU
-   |    lfd FARG1, 0(BASE)
-+  |.else
-+  |    lwz CARG2, 4(BASE)
-+  |.endif
-   |  bne ->fff_fallback                       // Exactly one argument.
-   |   checknum CARG1; bgt ->fff_fallback
-   |  b ->fff_resn
-@@ -1442,12 +1578,23 @@ static void build_subroutines(BuildCtx *
-   |  cmplwi CRET1, 0
-   |   li CARG3, LJ_TNIL
-   |  beq ->fff_restv                  // End of traversal: return nil.
--  |  lfd f0, 8(BASE)                  // Copy key and value to results.
-   |   la RA, -8(BASE)
-+  |.if FPU
-+  |  lfd f0, 8(BASE)                  // Copy key and value to results.
-   |  lfd f1, 16(BASE)
-   |  stfd f0, 0(RA)
--  |   li RD, (2+1)*8
-   |  stfd f1, 8(RA)
-+  |.else
-+  |  lwz CARG1, 8(BASE)
-+  |  lwz CARG2, 12(BASE)
-+  |  lwz CARG3, 16(BASE)
-+  |  lwz CARG4, 20(BASE)
-+  |  stw CARG1, 0(RA)
-+  |  stw CARG2, 4(RA)
-+  |  stw CARG3, 8(RA)
-+  |  stw CARG4, 12(RA)
-+  |.endif
-+  |   li RD, (2+1)*8
-   |  b ->fff_res
-   |
-   |.ffunc_1 pairs
-@@ -1456,17 +1603,32 @@ static void build_subroutines(BuildCtx *
-   |  bne ->fff_fallback
- #if LJ_52
-   |   lwz TAB:TMP2, TAB:CARG1->metatable
-+  |.if FPU
-   |  lfd f0, CFUNC:RB->upvalue[0]
-+  |.else
-+  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
-+  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
-+  |.endif
-   |   cmplwi TAB:TMP2, 0
-   |  la RA, -8(BASE)
-   |   bne ->fff_fallback
- #else
-+  |.if FPU
-   |  lfd f0, CFUNC:RB->upvalue[0]
-+  |.else
-+  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
-+  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
-+  |.endif
-   |  la RA, -8(BASE)
- #endif
-   |   stw TISNIL, 8(BASE)
-   |  li RD, (3+1)*8
-+  |.if FPU
-   |  stfd f0, 0(RA)
-+  |.else
-+  |  stw TMP0, 0(RA)
-+  |  stw TMP1, 4(RA)
-+  |.endif
-   |  b ->fff_res
-   |
-   |.ffunc ipairs_aux
-@@ -1512,14 +1674,24 @@ static void build_subroutines(BuildCtx *
-   |  stfd FARG2, 0(RA)
-   |.endif
-   |  ble >2                           // Not in array part?
-+  |.if FPU
-   |  lwzx TMP2, TMP1, TMP3
-   |  lfdx f0, TMP1, TMP3
-+  |.else
-+  |  lwzux TMP2, TMP1, TMP3
-+  |  lwz TMP3, 4(TMP1)
-+  |.endif
-   |1:
-   |  checknil TMP2
-   |   li RD, (0+1)*8
-   |  beq ->fff_res                    // End of iteration, return 0 results.
-   |   li RD, (2+1)*8
-+  |.if FPU
-   |  stfd f0, 8(RA)
-+  |.else
-+  |  stw TMP2, 8(RA)
-+  |  stw TMP3, 12(RA)
-+  |.endif
-   |  b ->fff_res
-   |2:  // Check for empty hash part first. Otherwise call C function.
-   |  lwz TMP0, TAB:CARG1->hmask
-@@ -1533,7 +1705,11 @@ static void build_subroutines(BuildCtx *
-   |   li RD, (0+1)*8
-   |  beq ->fff_res
-   |  lwz TMP2, 0(CRET1)
-+  |.if FPU
-   |  lfd f0, 0(CRET1)
-+  |.else
-+  |  lwz TMP3, 4(CRET1)
-+  |.endif
-   |  b <1
-   |
-   |.ffunc_1 ipairs
-@@ -1542,12 +1718,22 @@ static void build_subroutines(BuildCtx *
-   |  bne ->fff_fallback
- #if LJ_52
-   |   lwz TAB:TMP2, TAB:CARG1->metatable
-+  |.if FPU
-   |  lfd f0, CFUNC:RB->upvalue[0]
-+  |.else
-+  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
-+  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
-+  |.endif
-   |   cmplwi TAB:TMP2, 0
-   |  la RA, -8(BASE)
-   |   bne ->fff_fallback
- #else
-+  |.if FPU
-   |  lfd f0, CFUNC:RB->upvalue[0]
-+  |.else
-+  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
-+  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
-+  |.endif
-   |  la RA, -8(BASE)
- #endif
-   |.if DUALNUM
-@@ -1557,7 +1743,12 @@ static void build_subroutines(BuildCtx *
-   |.endif
-   |   stw ZERO, 12(BASE)
-   |  li RD, (3+1)*8
-+  |.if FPU
-   |  stfd f0, 0(RA)
-+  |.else
-+  |  stw TMP0, 0(RA)
-+  |  stw TMP1, 4(RA)
-+  |.endif
-   |  b ->fff_res
-   |
-   |//-- Base library: catch errors ----------------------------------------
-@@ -1576,19 +1767,32 @@ static void build_subroutines(BuildCtx *
-   |
-   |.ffunc xpcall
-   |  cmplwi NARGS8:RC, 16
--  |   lwz CARG4, 8(BASE)
-+  |   lwz CARG3, 8(BASE)
-+  |.if FPU
-   |    lfd FARG2, 8(BASE)
-   |    lfd FARG1, 0(BASE)
-+  |.else
-+  |    lwz CARG1, 0(BASE)
-+  |    lwz CARG2, 4(BASE)
-+  |    lwz CARG4, 12(BASE)
-+  |.endif
-   |  blt ->fff_fallback
-   |  lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH)
-   |   mr TMP2, BASE
--  |  checkfunc CARG4; bne ->fff_fallback  // Traceback must be a function.
-+  |  checkfunc CARG3; bne ->fff_fallback  // Traceback must be a function.
-   |   la BASE, 16(BASE)
-   |  // Remember active hook before pcall.
-   |  rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31
-+  |.if FPU
-   |    stfd FARG2, 0(TMP2)            // Swap function and traceback.
--  |  subi NARGS8:RC, NARGS8:RC, 16
-   |    stfd FARG1, 8(TMP2)
-+  |.else
-+  |    stw CARG3, 0(TMP2)
-+  |    stw CARG4, 4(TMP2)
-+  |    stw CARG1, 8(TMP2)
-+  |    stw CARG2, 12(TMP2)
-+  |.endif
-+  |  subi NARGS8:RC, NARGS8:RC, 16
-   |  addi PC, TMP1, 16+FRAME_PCALL
-   |  b ->vm_call_dispatch
-   |
-@@ -1631,9 +1835,21 @@ static void build_subroutines(BuildCtx *
-   |  stp BASE, L->top
-   |2:  // Move args to coroutine.
-   |  cmpw TMP1, NARGS8:RC
-+  |.if FPU
-   |   lfdx f0, BASE, TMP1
-+  |.else
-+  |   add CARG3, BASE, TMP1
-+  |   lwz TMP2, 0(CARG3)
-+  |   lwz TMP3, 4(CARG3)
-+  |.endif
-   |  beq >3
-+  |.if FPU
-   |   stfdx f0, CARG2, TMP1
-+  |.else
-+  |   add CARG3, CARG2, TMP1
-+  |   stw TMP2, 0(CARG3)
-+  |   stw TMP3, 4(CARG3)
-+  |.endif
-   |  addi TMP1, TMP1, 8
-   |  b <2
-   |3:
-@@ -1664,8 +1880,17 @@ static void build_subroutines(BuildCtx *
-   |   stp TMP2, L:SAVE0->top          // Clear coroutine stack.
-   |5:  // Move results from coroutine.
-   |  cmplw TMP1, TMP3
-+  |.if FPU
-   |   lfdx f0, TMP2, TMP1
-   |   stfdx f0, BASE, TMP1
-+  |.else
-+  |   add CARG3, TMP2, TMP1
-+  |   lwz CARG1, 0(CARG3)
-+  |   lwz CARG2, 4(CARG3)
-+  |   add CARG3, BASE, TMP1
-+  |   stw CARG1, 0(CARG3)
-+  |   stw CARG2, 4(CARG3)
-+  |.endif
-   |    addi TMP1, TMP1, 8
-   |  bne <5
-   |6:
-@@ -1690,12 +1915,22 @@ static void build_subroutines(BuildCtx *
-   |  andix. TMP0, PC, FRAME_TYPE
-   |  la TMP3, -8(TMP3)
-   |   li TMP1, LJ_TFALSE
-+  |.if FPU
-   |  lfd f0, 0(TMP3)
-+  |.else
-+  |  lwz CARG1, 0(TMP3)
-+  |  lwz CARG2, 4(TMP3)
-+  |.endif
-   |   stp TMP3, L:SAVE0->top          // Remove error from coroutine stack.
-   |    li RD, (2+1)*8
-   |   stw TMP1, -8(BASE)              // Prepend false to results.
-   |    la RA, -8(BASE)
-+  |.if FPU
-   |  stfd f0, 0(BASE)                 // Copy error message.
-+  |.else
-+  |  stw CARG1, 0(BASE)                       // Copy error message.
-+  |  stw CARG2, 4(BASE)
-+  |.endif
-   |  b <7
-   |.else
-   |  mr CARG1, L
-@@ -1874,7 +2109,12 @@ static void build_subroutines(BuildCtx *
-   |  lus CARG1, 0x8000                        // -(2^31).
-   |  beqy ->fff_resi
-   |5:
-+  |.if FPU
-   |  lfd FARG1, 0(BASE)
-+  |.else
-+  |  lwz CARG1, 0(BASE)
-+  |  lwz CARG2, 4(BASE)
-+  |.endif
-   |  blex func
-   |  b ->fff_resn
-   |.endmacro
-@@ -1898,10 +2138,14 @@ static void build_subroutines(BuildCtx *
-   |
-   |.ffunc math_log
-   |  cmplwi NARGS8:RC, 8
--  |   lwz CARG3, 0(BASE)
--  |    lfd FARG1, 0(BASE)
-+  |   lwz CARG1, 0(BASE)
-   |  bne ->fff_fallback                       // Need exactly 1 argument.
--  |  checknum CARG3; bge ->fff_fallback
-+  |  checknum CARG1; bge ->fff_fallback
-+  |.if FPU
-+  |  lfd FARG1, 0(BASE)
-+  |.else
-+  |  lwz CARG2, 4(BASE)
-+  |.endif
-   |  blex log
-   |  b ->fff_resn
-   |
-@@ -1923,17 +2167,24 @@ static void build_subroutines(BuildCtx *
-   |.if DUALNUM
-   |.ffunc math_ldexp
-   |  cmplwi NARGS8:RC, 16
--  |   lwz CARG3, 0(BASE)
-+  |   lwz TMP0, 0(BASE)
-+  |.if FPU
-   |    lfd FARG1, 0(BASE)
--  |   lwz CARG4, 8(BASE)
-+  |.else
-+  |    lwz CARG1, 0(BASE)
-+  |    lwz CARG2, 4(BASE)
-+  |.endif
-+  |   lwz TMP1, 8(BASE)
-   |.if GPR64
-   |    lwz CARG2, 12(BASE)
--  |.else
-+  |.elif FPU
-   |    lwz CARG1, 12(BASE)
-+  |.else
-+  |    lwz CARG3, 12(BASE)
-   |.endif
-   |  blt ->fff_fallback
--  |  checknum CARG3; bge ->fff_fallback
--  |  checknum CARG4; bne ->fff_fallback
-+  |  checknum TMP0; bge ->fff_fallback
-+  |  checknum TMP1; bne ->fff_fallback
-   |.else
-   |.ffunc_nn math_ldexp
-   |.if GPR64
-@@ -1948,8 +2199,10 @@ static void build_subroutines(BuildCtx *
-   |.ffunc_n math_frexp
-   |.if GPR64
-   |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)
--  |.else
-+  |.elif FPU
-   |  la CARG1, DISPATCH_GL(tmptv)(DISPATCH)
-+  |.else
-+  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)
-   |.endif
-   |   lwz PC, FRAME_PC(BASE)
-   |  blex frexp
-@@ -1958,7 +2211,12 @@ static void build_subroutines(BuildCtx *
-   |.if not DUALNUM
-   |   tonum_i FARG2, TMP1
-   |.endif
-+  |.if FPU
-   |  stfd FARG1, 0(RA)
-+  |.else
-+  |  stw CRET1, 0(RA)
-+  |  stw CRET2, 4(RA)
-+  |.endif
-   |  li RD, (2+1)*8
-   |.if DUALNUM
-   |   stw TISNUM, 8(RA)
-@@ -1971,13 +2229,20 @@ static void build_subroutines(BuildCtx *
-   |.ffunc_n math_modf
-   |.if GPR64
-   |  la CARG2, -8(BASE)
--  |.else
-+  |.elif FPU
-   |  la CARG1, -8(BASE)
-+  |.else
-+  |  la CARG3, -8(BASE)
-   |.endif
-   |   lwz PC, FRAME_PC(BASE)
-   |  blex modf
-   |   la RA, -8(BASE)
-+  |.if FPU
-   |  stfd FARG1, 0(BASE)
-+  |.else
-+  |  stw CRET1, 0(BASE)
-+  |  stw CRET2, 4(BASE)
-+  |.endif
-   |  li RD, (2+1)*8
-   |  b ->fff_res
-   |
-@@ -1985,13 +2250,13 @@ static void build_subroutines(BuildCtx *
-   |.if DUALNUM
-   |  .ffunc_1 name
-   |  checknum CARG3
--  |   addi TMP1, BASE, 8
--  |   add TMP2, BASE, NARGS8:RC
-+  |   addi SAVE0, BASE, 8
-+  |   add SAVE1, BASE, NARGS8:RC
-   |  bne >4
-   |1:  // Handle integers.
--  |  lwz CARG4, 0(TMP1)
--  |   cmplw cr1, TMP1, TMP2
--  |  lwz CARG2, 4(TMP1)
-+  |  lwz CARG4, 0(SAVE0)
-+  |   cmplw cr1, SAVE0, SAVE1
-+  |  lwz CARG2, 4(SAVE0)
-   |   bge cr1, ->fff_resi
-   |  checknum CARG4
-   |   xoris TMP0, CARG1, 0x8000
-@@ -2008,36 +2273,76 @@ static void build_subroutines(BuildCtx *
-   |.if GPR64
-   |  rldicl CARG1, CARG1, 0, 32
-   |.endif
--  |   addi TMP1, TMP1, 8
-+  |   addi SAVE0, SAVE0, 8
-   |  b <1
-   |3:
-   |  bge ->fff_fallback
-   |  // Convert intermediate result to number and continue below.
-+  |.if FPU
-   |  tonum_i FARG1, CARG1
--  |  lfd FARG2, 0(TMP1)
-+  |  lfd FARG2, 0(SAVE0)
-+  |.else
-+  |  mr CARG2, CARG1
-+  |  bl ->vm_sfi2d_1
-+  |  lwz CARG3, 0(SAVE0)
-+  |  lwz CARG4, 4(SAVE0)
-+  |.endif
-   |  b >6
-   |4:
-+  |.if FPU
-   |   lfd FARG1, 0(BASE)
-+  |.else
-+  |   lwz CARG1, 0(BASE)
-+  |   lwz CARG2, 4(BASE)
-+  |.endif
-   |  bge ->fff_fallback
-   |5:  // Handle numbers.
--  |  lwz CARG4, 0(TMP1)
--  |   cmplw cr1, TMP1, TMP2
--  |  lfd FARG2, 0(TMP1)
-+  |  lwz CARG3, 0(SAVE0)
-+  |   cmplw cr1, SAVE0, SAVE1
-+  |.if FPU
-+  |  lfd FARG2, 0(SAVE0)
-+  |.else
-+  |  lwz CARG4, 4(SAVE0)
-+  |.endif
-   |   bge cr1, ->fff_resn
--  |  checknum CARG4; bge >7
-+  |  checknum CARG3; bge >7
-   |6:
-+  |   addi SAVE0, SAVE0, 8
-+  |.if FPU
-   |  fsub f0, FARG1, FARG2
--  |   addi TMP1, TMP1, 8
-   |.if ismax
-   |  fsel FARG1, f0, FARG1, FARG2
-   |.else
-   |  fsel FARG1, f0, FARG2, FARG1
-   |.endif
-+  |.else
-+  |  stw CARG1, SFSAVE_1
-+  |  stw CARG2, SFSAVE_2
-+  |  stw CARG3, SFSAVE_3
-+  |  stw CARG4, SFSAVE_4
-+  |  blex __ledf2
-+  |  cmpwi CRET1, 0
-+  |.if ismax
-+  |  blt >8
-+  |.else
-+  |  bge >8
-+  |.endif
-+  |  lwz CARG1, SFSAVE_1
-+  |  lwz CARG2, SFSAVE_2
-+  |  b <5
-+  |8:
-+  |  lwz CARG1, SFSAVE_3
-+  |  lwz CARG2, SFSAVE_4
-+  |.endif
-   |  b <5
-   |7:  // Convert integer to number and continue above.
--  |   lwz CARG2, 4(TMP1)
-+  |   lwz CARG3, 4(SAVE0)
-   |  bne ->fff_fallback
--  |  tonum_i FARG2, CARG2
-+  |.if FPU
-+  |  tonum_i FARG2, CARG3
-+  |.else
-+  |  bl ->vm_sfi2d_2
-+  |.endif
-   |  b <6
-   |.else
-   |  .ffunc_n name
-@@ -2237,28 +2542,37 @@ static void build_subroutines(BuildCtx *
-   |
-   |.macro .ffunc_bit_op, name, ins
-   |  .ffunc_bit name
--  |  addi TMP1, BASE, 8
--  |  add TMP2, BASE, NARGS8:RC
-+  |  addi SAVE0, BASE, 8
-+  |  add SAVE1, BASE, NARGS8:RC
-   |1:
--  |  lwz CARG4, 0(TMP1)
--  |   cmplw cr1, TMP1, TMP2
-+  |  lwz CARG4, 0(SAVE0)
-+  |   cmplw cr1, SAVE0, SAVE1
-   |.if DUALNUM
--  |  lwz CARG2, 4(TMP1)
-+  |  lwz CARG2, 4(SAVE0)
-   |.else
--  |  lfd FARG1, 0(TMP1)
-+  |  lfd FARG1, 0(SAVE0)
-   |.endif
-   |   bgey cr1, ->fff_resi
-   |  checknum CARG4
-   |.if DUALNUM
-+  |.if FPU
-   |  bnel ->fff_bitop_fb
-   |.else
-+  |  beq >3
-+  |  stw CARG1, SFSAVE_1
-+  |  bl ->fff_bitop_fb
-+  |  mr CARG2, CARG1
-+  |  lwz CARG1, SFSAVE_1
-+  |3:
-+  |.endif
-+  |.else
-   |  fadd FARG1, FARG1, TOBIT
-   |  bge ->fff_fallback
-   |  stfd FARG1, TMPD
-   |  lwz CARG2, TMPD_LO
-   |.endif
-   |  ins CARG1, CARG1, CARG2
--  |   addi TMP1, TMP1, 8
-+  |   addi SAVE0, SAVE0, 8
-   |  b <1
-   |.endmacro
-   |
-@@ -2280,7 +2594,14 @@ static void build_subroutines(BuildCtx *
-   |.macro .ffunc_bit_sh, name, ins, shmod
-   |.if DUALNUM
-   |  .ffunc_2 bit_..name
-+  |.if FPU
-   |  checknum CARG3; bnel ->fff_tobit_fb
-+  |.else
-+  |  checknum CARG3; beq >1
-+  |  bl ->fff_tobit_fb
-+  |  lwz CARG2, 12(BASE)      // Conversion polluted CARG2.
-+  |1:
-+  |.endif
-   |  // Note: no inline conversion from number for 2nd argument!
-   |  checknum CARG4; bne ->fff_fallback
-   |.else
-@@ -2317,27 +2638,77 @@ static void build_subroutines(BuildCtx *
-   |->fff_resn:
-   |  lwz PC, FRAME_PC(BASE)
-   |  la RA, -8(BASE)
-+  |.if FPU
-   |  stfd FARG1, -8(BASE)
-+  |.else
-+  |  stw CARG1, -8(BASE)
-+  |  stw CARG2, -4(BASE)
-+  |.endif
-   |  b ->fff_res1
-   |
-   |// Fallback FP number to bit conversion.
-   |->fff_tobit_fb:
-   |.if DUALNUM
-+  |.if FPU
-   |  lfd FARG1, 0(BASE)
-   |  bgt ->fff_fallback
-   |  fadd FARG1, FARG1, TOBIT
-   |  stfd FARG1, TMPD
-   |  lwz CARG1, TMPD_LO
-   |  blr
-+  |.else
-+  |  bgt ->fff_fallback
-+  |  mr CARG2, CARG1
-+  |  mr CARG1, CARG3
-+  |// Modifies: CARG1, CARG2, TMP0, TMP1, TMP2.
-+  |->vm_tobit:
-+  |  slwi TMP2, CARG1, 1
-+  |  addis TMP2, TMP2, 0x0020
-+  |  cmpwi TMP2, 0
-+  |  bge >2
-+  |   li TMP1, 0x3e0
-+  |  srawi TMP2, TMP2, 21
-+  |   not TMP1, TMP1
-+  |  sub. TMP2, TMP1, TMP2
-+  |    cmpwi cr7, CARG1, 0
-+  |  blt >1
-+  |   slwi TMP1, CARG1, 11
-+  |    srwi TMP0, CARG2, 21
-+  |   oris TMP1, TMP1, 0x8000
-+  |   or TMP1, TMP1, TMP0
-+  |   srw CARG1, TMP1, TMP2
-+  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
-+  |   neg CARG1, CARG1
-+  |  blr
-+  |1:
-+  |  addi TMP2, TMP2, 21
-+  |  srw TMP1, CARG2, TMP2
-+  |   slwi CARG2, CARG1, 12
-+  |  subfic TMP2, TMP2, 20
-+  |   slw TMP0, CARG2, TMP2
-+  |   or CARG1, TMP1, TMP0
-+  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
-+  |   neg CARG1, CARG1
-+  |  blr
-+  |2:
-+  |  li CARG1, 0
-+  |  blr
-+  |.endif
-   |.endif
-   |->fff_bitop_fb:
-   |.if DUALNUM
--  |  lfd FARG1, 0(TMP1)
-+  |.if FPU
-+  |  lfd FARG1, 0(SAVE0)
-   |  bgt ->fff_fallback
-   |  fadd FARG1, FARG1, TOBIT
-   |  stfd FARG1, TMPD
-   |  lwz CARG2, TMPD_LO
-   |  blr
-+  |.else
-+  |  bgt ->fff_fallback
-+  |  mr CARG1, CARG4
-+  |  b ->vm_tobit
-+  |.endif
-   |.endif
-   |
-   |//-----------------------------------------------------------------------
-@@ -2530,10 +2901,21 @@ static void build_subroutines(BuildCtx *
-   |  decode_RA8 RC, INS                       // Call base.
-   |   beq >2
-   |1:  // Move results down.
-+  |.if FPU
-   |  lfd f0, 0(RA)
-+  |.else
-+  |  lwz CARG1, 0(RA)
-+  |  lwz CARG2, 4(RA)
-+  |.endif
-   |   addic. TMP1, TMP1, -8
-   |    addi RA, RA, 8
-+  |.if FPU
-   |  stfdx f0, BASE, RC
-+  |.else
-+  |  add CARG3, BASE, RC
-+  |  stw CARG1, 0(CARG3)
-+  |  stw CARG2, 4(CARG3)
-+  |.endif
-   |    addi RC, RC, 8
-   |   bne <1
-   |2:
-@@ -2586,10 +2968,12 @@ static void build_subroutines(BuildCtx *
-   |//-----------------------------------------------------------------------
-   |
-   |.macro savex_, a, b, c, d
-+  |.if FPU
-   |  stfd f..a, 16+a*8(sp)
-   |  stfd f..b, 16+b*8(sp)
-   |  stfd f..c, 16+c*8(sp)
-   |  stfd f..d, 16+d*8(sp)
-+  |.endif
-   |.endmacro
-   |
-   |->vm_exit_handler:
-@@ -2661,16 +3045,16 @@ static void build_subroutines(BuildCtx *
-   |  lwz KBASE, PC2PROTO(k)(TMP1)
-   |  // Setup type comparison constants.
-   |  li TISNUM, LJ_TISNUM
--  |  lus TMP3, 0x59c0                 // TOBIT = 2^52 + 2^51 (float).
--  |  stw TMP3, TMPD
-+  |  .FPU lus TMP3, 0x59c0            // TOBIT = 2^52 + 2^51 (float).
-+  |  .FPU stw TMP3, TMPD
-   |  li ZERO, 0
--  |  ori TMP3, TMP3, 0x0004           // TONUM = 2^52 + 2^51 + 2^31 (float).
--  |  lfs TOBIT, TMPD
--  |  stw TMP3, TMPD
--  |  lus TMP0, 0x4338                 // Hiword of 2^52 + 2^51 (double)
-+  |  .FPU ori TMP3, TMP3, 0x0004      // TONUM = 2^52 + 2^51 + 2^31 (float).
-+  |  .FPU lfs TOBIT, TMPD
-+  |  .FPU stw TMP3, TMPD
-+  |  .FPU lus TMP0, 0x4338                    // Hiword of 2^52 + 2^51 (double)
-   |    li TISNIL, LJ_TNIL
--  |  stw TMP0, TONUM_HI
--  |  lfs TONUM, TMPD
-+  |  .FPU stw TMP0, TONUM_HI
-+  |  .FPU lfs TONUM, TMPD
-   |  // Modified copy of ins_next which handles function header dispatch, too.
-   |  lwz INS, 0(PC)
-   |   addi PC, PC, 4
-@@ -2715,7 +3099,35 @@ static void build_subroutines(BuildCtx *
-   |//-- Math helper functions ----------------------------------------------
-   |//-----------------------------------------------------------------------
-   |
--  |// NYI: Use internal implementations of floor, ceil, trunc.
-+  |// NYI: Use internal implementations of floor, ceil, trunc, sfcmp.
-+  |
-+  |.macro sfi2d, AHI, ALO
-+  |.if not FPU
-+  |  mr. AHI, ALO
-+  |  bclr 12, 2                               // Handle zero first.
-+  |  srawi TMP0, ALO, 31
-+  |  xor TMP1, ALO, TMP0
-+  |  sub TMP1, TMP1, TMP0             // Absolute value in TMP1.
-+  |  cntlzw AHI, TMP1
-+  |  andix. TMP0, TMP0, 0x800         // Mask sign bit.
-+  |  slw TMP1, TMP1, AHI              // Align mantissa left with leading 1.
-+  |  subfic AHI, AHI, 0x3ff+31-1      // Exponent -1 in AHI.
-+  |  slwi ALO, TMP1, 21
-+  |  or AHI, AHI, TMP0                        // Sign | Exponent.
-+  |  srwi TMP1, TMP1, 11
-+  |  slwi AHI, AHI, 20                        // Align left.
-+  |  add AHI, AHI, TMP1                       // Add mantissa, increment exponent.
-+  |  blr
-+  |.endif
-+  |.endmacro
-+  |
-+  |// Input: CARG2. Output: CARG1, CARG2. Temporaries: TMP0, TMP1.
-+  |->vm_sfi2d_1:
-+  |  sfi2d CARG1, CARG2
-+  |
-+  |// Input: CARG4. Output: CARG3, CARG4. Temporaries: TMP0, TMP1.
-+  |->vm_sfi2d_2:
-+  |  sfi2d CARG3, CARG4
-   |
-   |->vm_modi:
-   |  divwo. TMP0, CARG1, CARG2
-@@ -2783,21 +3195,21 @@ static void build_subroutines(BuildCtx *
-   |   addi DISPATCH, r12, GG_G2DISP
-   |  stw r11, CTSTATE->cb.slot
-   |  stw r3, CTSTATE->cb.gpr[0]
--  |   stfd f1, CTSTATE->cb.fpr[0]
-+  |   .FPU stfd f1, CTSTATE->cb.fpr[0]
-   |  stw r4, CTSTATE->cb.gpr[1]
--  |   stfd f2, CTSTATE->cb.fpr[1]
-+  |   .FPU stfd f2, CTSTATE->cb.fpr[1]
-   |  stw r5, CTSTATE->cb.gpr[2]
--  |   stfd f3, CTSTATE->cb.fpr[2]
-+  |   .FPU stfd f3, CTSTATE->cb.fpr[2]
-   |  stw r6, CTSTATE->cb.gpr[3]
--  |   stfd f4, CTSTATE->cb.fpr[3]
-+  |   .FPU stfd f4, CTSTATE->cb.fpr[3]
-   |  stw r7, CTSTATE->cb.gpr[4]
--  |   stfd f5, CTSTATE->cb.fpr[4]
-+  |   .FPU stfd f5, CTSTATE->cb.fpr[4]
-   |  stw r8, CTSTATE->cb.gpr[5]
--  |   stfd f6, CTSTATE->cb.fpr[5]
-+  |   .FPU stfd f6, CTSTATE->cb.fpr[5]
-   |  stw r9, CTSTATE->cb.gpr[6]
--  |   stfd f7, CTSTATE->cb.fpr[6]
-+  |   .FPU stfd f7, CTSTATE->cb.fpr[6]
-   |  stw r10, CTSTATE->cb.gpr[7]
--  |   stfd f8, CTSTATE->cb.fpr[7]
-+  |   .FPU stfd f8, CTSTATE->cb.fpr[7]
-   |  addi TMP0, sp, CFRAME_SPACE+8
-   |  stw TMP0, CTSTATE->cb.stack
-   |   mr CARG1, CTSTATE
-@@ -2808,21 +3220,21 @@ static void build_subroutines(BuildCtx *
-   |  lp BASE, L:CRET1->base
-   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
-   |  lp RC, L:CRET1->top
--  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
-+  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
-   |     li ZERO, 0
-   |   mr L, CRET1
--  |     stw TMP3, TMPD
--  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
-+  |     .FPU stw TMP3, TMPD
-+  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
-   |  lwz LFUNC:RB, FRAME_FUNC(BASE)
--  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
--  |     stw TMP0, TONUM_HI
-+  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
-+  |     .FPU stw TMP0, TONUM_HI
-   |     li TISNIL, LJ_TNIL
-   |    li_vmstate INTERP
--  |     lfs TOBIT, TMPD
--  |     stw TMP3, TMPD
-+  |     .FPU lfs TOBIT, TMPD
-+  |     .FPU stw TMP3, TMPD
-   |  sub RC, RC, BASE
-   |    st_vmstate
--  |     lfs TONUM, TMPD
-+  |     .FPU lfs TONUM, TMPD
-   |  ins_callt
-   |.endif
-   |
-@@ -2836,7 +3248,7 @@ static void build_subroutines(BuildCtx *
-   |  mr CARG2, RA
-   |  bl extern lj_ccallback_leave     // (CTState *cts, TValue *o)
-   |  lwz CRET1, CTSTATE->cb.gpr[0]
--  |  lfd FARG1, CTSTATE->cb.fpr[0]
-+  |  .FPU lfd FARG1, CTSTATE->cb.fpr[0]
-   |  lwz CRET2, CTSTATE->cb.gpr[1]
-   |  b ->vm_leave_unw
-   |.endif
-@@ -2870,14 +3282,14 @@ static void build_subroutines(BuildCtx *
-   |  bge <1
-   |2:
-   |  bney cr1, >3
--  |  lfd f1, CCSTATE->fpr[0]
--  |  lfd f2, CCSTATE->fpr[1]
--  |  lfd f3, CCSTATE->fpr[2]
--  |  lfd f4, CCSTATE->fpr[3]
--  |  lfd f5, CCSTATE->fpr[4]
--  |  lfd f6, CCSTATE->fpr[5]
--  |  lfd f7, CCSTATE->fpr[6]
--  |  lfd f8, CCSTATE->fpr[7]
-+  |  .FPU lfd f1, CCSTATE->fpr[0]
-+  |  .FPU lfd f2, CCSTATE->fpr[1]
-+  |  .FPU lfd f3, CCSTATE->fpr[2]
-+  |  .FPU lfd f4, CCSTATE->fpr[3]
-+  |  .FPU lfd f5, CCSTATE->fpr[4]
-+  |  .FPU lfd f6, CCSTATE->fpr[5]
-+  |  .FPU lfd f7, CCSTATE->fpr[6]
-+  |  .FPU lfd f8, CCSTATE->fpr[7]
-   |3:
-   |   lp TMP0, CCSTATE->func
-   |  lwz CARG2, CCSTATE->gpr[1]
-@@ -2894,7 +3306,7 @@ static void build_subroutines(BuildCtx *
-   |  lwz TMP2, -4(r14)
-   |   lwz TMP0, 4(r14)
-   |  stw CARG1, CCSTATE:TMP1->gpr[0]
--  |  stfd FARG1, CCSTATE:TMP1->fpr[0]
-+  |  .FPU stfd FARG1, CCSTATE:TMP1->fpr[0]
-   |  stw CARG2, CCSTATE:TMP1->gpr[1]
-   |   mtlr TMP0
-   |  stw CARG3, CCSTATE:TMP1->gpr[2]
-@@ -2923,19 +3335,19 @@ static void build_ins(BuildCtx *ctx, BCO
-   case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
-     |  // RA = src1*8, RD = src2*8, JMP with RD = target
-     |.if DUALNUM
--    |  lwzux TMP0, RA, BASE
-+    |  lwzux CARG1, RA, BASE
-     |    addi PC, PC, 4
-     |   lwz CARG2, 4(RA)
--    |  lwzux TMP1, RD, BASE
-+    |  lwzux CARG3, RD, BASE
-     |    lwz TMP2, -4(PC)
--    |  checknum cr0, TMP0
--    |   lwz CARG3, 4(RD)
-+    |  checknum cr0, CARG1
-+    |   lwz CARG4, 4(RD)
-     |    decode_RD4 TMP2, TMP2
--    |  checknum cr1, TMP1
--    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
-+    |  checknum cr1, CARG3
-+    |    addis SAVE0, TMP2, -(BCBIAS_J*4 >> 16)
-     |  bne cr0, >7
-     |  bne cr1, >8
--    |   cmpw CARG2, CARG3
-+    |   cmpw CARG2, CARG4
-     if (op == BC_ISLT) {
-       |  bge >2
-     } else if (op == BC_ISGE) {
-@@ -2946,28 +3358,41 @@ static void build_ins(BuildCtx *ctx, BCO
-       |  ble >2
-     }
-     |1:
--    |  add PC, PC, TMP2
-+    |  add PC, PC, SAVE0
-     |2:
-     |  ins_next
-     |
-     |7:  // RA is not an integer.
-     |  bgt cr0, ->vmeta_comp
-     |  // RA is a number.
--    |   lfd f0, 0(RA)
-+    |   .FPU lfd f0, 0(RA)
-     |  bgt cr1, ->vmeta_comp
-     |  blt cr1, >4
-     |  // RA is a number, RD is an integer.
--    |  tonum_i f1, CARG3
-+    |.if FPU
-+    |  tonum_i f1, CARG4
-+    |.else
-+    |  bl ->vm_sfi2d_2
-+    |.endif
-     |  b >5
-     |
-     |8: // RA is an integer, RD is not an integer.
-     |  bgt cr1, ->vmeta_comp
-     |  // RA is an integer, RD is a number.
-+    |.if FPU
-     |  tonum_i f0, CARG2
-+    |.else
-+    |  bl ->vm_sfi2d_1
-+    |.endif
-     |4:
--    |  lfd f1, 0(RD)
-+    |  .FPU lfd f1, 0(RD)
-     |5:
-+    |.if FPU
-     |  fcmpu cr0, f0, f1
-+    |.else
-+    |  blex __ledf2
-+    |  cmpwi CRET1, 0
-+    |.endif
-     if (op == BC_ISLT) {
-       |  bge <2
-     } else if (op == BC_ISGE) {
-@@ -3015,42 +3440,42 @@ static void build_ins(BuildCtx *ctx, BCO
-     vk = op == BC_ISEQV;
-     |  // RA = src1*8, RD = src2*8, JMP with RD = target
-     |.if DUALNUM
--    |  lwzux TMP0, RA, BASE
-+    |  lwzux CARG1, RA, BASE
-     |    addi PC, PC, 4
-     |   lwz CARG2, 4(RA)
--    |  lwzux TMP1, RD, BASE
--    |  checknum cr0, TMP0
--    |    lwz TMP2, -4(PC)
--    |  checknum cr1, TMP1
--    |    decode_RD4 TMP2, TMP2
--    |   lwz CARG3, 4(RD)
-+    |  lwzux CARG3, RD, BASE
-+    |  checknum cr0, CARG1
-+    |    lwz SAVE0, -4(PC)
-+    |  checknum cr1, CARG3
-+    |    decode_RD4 SAVE0, SAVE0
-+    |   lwz CARG4, 4(RD)
-     |  cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt
--    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
-+    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
-     if (vk) {
-       |  ble cr7, ->BC_ISEQN_Z
-     } else {
-       |  ble cr7, ->BC_ISNEN_Z
-     }
-     |.else
--    |  lwzux TMP0, RA, BASE
--    |   lwz TMP2, 0(PC)
-+    |  lwzux CARG1, RA, BASE
-+    |   lwz SAVE0, 0(PC)
-     |    lfd f0, 0(RA)
-     |   addi PC, PC, 4
--    |  lwzux TMP1, RD, BASE
--    |  checknum cr0, TMP0
--    |   decode_RD4 TMP2, TMP2
-+    |  lwzux CARG3, RD, BASE
-+    |  checknum cr0, CARG1
-+    |   decode_RD4 SAVE0, SAVE0
-     |    lfd f1, 0(RD)
--    |  checknum cr1, TMP1
--    |   addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
-+    |  checknum cr1, CARG3
-+    |   addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
-     |  bge cr0, >5
-     |  bge cr1, >5
-     |  fcmpu cr0, f0, f1
-     if (vk) {
-       |  bne >1
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-     } else {
-       |  beq >1
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-     }
-     |1:
-     |  ins_next
-@@ -3058,36 +3483,36 @@ static void build_ins(BuildCtx *ctx, BCO
-     |5:  // Either or both types are not numbers.
-     |.if not DUALNUM
-     |    lwz CARG2, 4(RA)
--    |    lwz CARG3, 4(RD)
-+    |    lwz CARG4, 4(RD)
-     |.endif
-     |.if FFI
--    |  cmpwi cr7, TMP0, LJ_TCDATA
--    |  cmpwi cr5, TMP1, LJ_TCDATA
-+    |  cmpwi cr7, CARG1, LJ_TCDATA
-+    |  cmpwi cr5, CARG3, LJ_TCDATA
-     |.endif
--    |   not TMP3, TMP0
--    |  cmplw TMP0, TMP1
--    |   cmplwi cr1, TMP3, ~LJ_TISPRI          // Primitive?
-+    |   not TMP2, CARG1
-+    |  cmplw CARG1, CARG3
-+    |   cmplwi cr1, TMP2, ~LJ_TISPRI          // Primitive?
-     |.if FFI
-     |  cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq
-     |.endif
--    |   cmplwi cr6, TMP3, ~LJ_TISTABUD                // Table or userdata?
-+    |   cmplwi cr6, TMP2, ~LJ_TISTABUD                // Table or userdata?
-     |.if FFI
-     |  beq cr7, ->vmeta_equal_cd
-     |.endif
--    |    cmplw cr5, CARG2, CARG3
-+    |    cmplw cr5, CARG2, CARG4
-     |  crandc 4*cr0+gt, 4*cr0+eq, 4*cr1+gt    // 2: Same type and primitive.
-     |  crorc 4*cr0+lt, 4*cr5+eq, 4*cr0+eq     // 1: Same tv or different type.
-     |  crand 4*cr0+eq, 4*cr0+eq, 4*cr5+eq     // 0: Same type and same tv.
--    |   mr SAVE0, PC
-+    |   mr SAVE1, PC
-     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr0+gt      // 0 or 2.
-     |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+gt      // 1 or 2.
-     if (vk) {
-       |  bne cr0, >6
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-       |6:
-     } else {
-       |  beq cr0, >6
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-       |6:
-     }
-     |.if DUALNUM
-@@ -3102,6 +3527,7 @@ static void build_ins(BuildCtx *ctx, BCO
-     |
-     |  // Different tables or userdatas. Need to check __eq metamethod.
-     |  // Field metatable must be at same offset for GCtab and GCudata!
-+    |   mr CARG3, CARG4
-     |  lwz TAB:TMP2, TAB:CARG2->metatable
-     |   li CARG4, 1-vk                        // ne = 0 or 1.
-     |  cmplwi TAB:TMP2, 0
-@@ -3109,7 +3535,7 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lbz TMP2, TAB:TMP2->nomm
-     |  andix. TMP2, TMP2, 1<<MM_eq
-     |  bne <1                         // Or 'no __eq' flag set?
--    |  mr PC, SAVE0                   // Restore old PC.
-+    |  mr PC, SAVE1                   // Restore old PC.
-     |  b ->vmeta_equal                        // Handle __eq metamethod.
-     break;
-@@ -3150,16 +3576,16 @@ static void build_ins(BuildCtx *ctx, BCO
-     vk = op == BC_ISEQN;
-     |  // RA = src*8, RD = num_const*8, JMP with RD = target
-     |.if DUALNUM
--    |  lwzux TMP0, RA, BASE
-+    |  lwzux CARG1, RA, BASE
-     |    addi PC, PC, 4
-     |   lwz CARG2, 4(RA)
--    |  lwzux TMP1, RD, KBASE
--    |  checknum cr0, TMP0
--    |    lwz TMP2, -4(PC)
--    |  checknum cr1, TMP1
--    |    decode_RD4 TMP2, TMP2
--    |   lwz CARG3, 4(RD)
--    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
-+    |  lwzux CARG3, RD, KBASE
-+    |  checknum cr0, CARG1
-+    |    lwz SAVE0, -4(PC)
-+    |  checknum cr1, CARG3
-+    |    decode_RD4 SAVE0, SAVE0
-+    |   lwz CARG4, 4(RD)
-+    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
-     if (vk) {
-       |->BC_ISEQN_Z:
-     } else {
-@@ -3167,7 +3593,7 @@ static void build_ins(BuildCtx *ctx, BCO
-     }
-     |  bne cr0, >7
-     |  bne cr1, >8
--    |   cmpw CARG2, CARG3
-+    |   cmpw CARG2, CARG4
-     |4:
-     |.else
-     if (vk) {
-@@ -3175,20 +3601,20 @@ static void build_ins(BuildCtx *ctx, BCO
-     } else {
-       |->BC_ISNEN_Z:  // Dummy label.
-     }
--    |  lwzx TMP0, BASE, RA
-+    |  lwzx CARG1, BASE, RA
-     |    addi PC, PC, 4
-     |   lfdx f0, BASE, RA
--    |    lwz TMP2, -4(PC)
-+    |    lwz SAVE0, -4(PC)
-     |  lfdx f1, KBASE, RD
--    |    decode_RD4 TMP2, TMP2
--    |  checknum TMP0
--    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
-+    |    decode_RD4 SAVE0, SAVE0
-+    |  checknum CARG1
-+    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
-     |  bge >3
-     |  fcmpu cr0, f0, f1
-     |.endif
-     if (vk) {
-       |  bne >1
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-       |1:
-       |.if not FFI
-       |3:
-@@ -3199,13 +3625,13 @@ static void build_ins(BuildCtx *ctx, BCO
-       |.if not FFI
-       |3:
-       |.endif
--      |  add PC, PC, TMP2
-+      |  add PC, PC, SAVE0
-       |2:
-     }
-     |  ins_next
-     |.if FFI
-     |3:
--    |  cmpwi TMP0, LJ_TCDATA
-+    |  cmpwi CARG1, LJ_TCDATA
-     |  beq ->vmeta_equal_cd
-     |  b <1
-     |.endif
-@@ -3213,18 +3639,31 @@ static void build_ins(BuildCtx *ctx, BCO
-     |7:  // RA is not an integer.
-     |  bge cr0, <3
-     |  // RA is a number.
--    |   lfd f0, 0(RA)
-+    |   .FPU lfd f0, 0(RA)
-     |  blt cr1, >1
-     |  // RA is a number, RD is an integer.
--    |  tonum_i f1, CARG3
-+    |.if FPU
-+    |  tonum_i f1, CARG4
-+    |.else
-+    |  bl ->vm_sfi2d_2
-+    |.endif
-     |  b >2
-     |
-     |8: // RA is an integer, RD is a number.
-+    |.if FPU
-     |  tonum_i f0, CARG2
-+    |.else
-+    |  bl ->vm_sfi2d_1
-+    |.endif
-     |1:
--    |  lfd f1, 0(RD)
-+    |  .FPU lfd f1, 0(RD)
-     |2:
-+    |.if FPU
-     |  fcmpu cr0, f0, f1
-+    |.else
-+    |  blex __ledf2
-+    |  cmpwi CRET1, 0
-+    |.endif
-     |  b <4
-     |.endif
-     break;
-@@ -3279,7 +3718,12 @@ static void build_ins(BuildCtx *ctx, BCO
-       |  add PC, PC, TMP2
-     } else {
-       |  li TMP1, LJ_TFALSE
-+      |.if FPU
-       |   lfdx f0, BASE, RD
-+      |.else
-+      |   lwzux CARG1, RD, BASE
-+      |   lwz CARG2, 4(RD)
-+      |.endif
-       |  cmplw TMP0, TMP1
-       if (op == BC_ISTC) {
-       |  bge >1
-@@ -3288,7 +3732,12 @@ static void build_ins(BuildCtx *ctx, BCO
-       }
-       |  addis PC, PC, -(BCBIAS_J*4 >> 16)
-       |  decode_RD4 TMP2, INS
-+      |.if FPU
-       |   stfdx f0, BASE, RA
-+      |.else
-+      |   stwux CARG1, RA, BASE
-+      |   stw CARG2, 4(RA)
-+      |.endif
-       |  add PC, PC, TMP2
-       |1:
-     }
-@@ -3323,8 +3772,15 @@ static void build_ins(BuildCtx *ctx, BCO
-   case BC_MOV:
-     |  // RA = dst*8, RD = src*8
-     |  ins_next1
-+    |.if FPU
-     |  lfdx f0, BASE, RD
-     |  stfdx f0, BASE, RA
-+    |.else
-+    |  lwzux TMP0, RD, BASE
-+    |  lwz TMP1, 4(RD)
-+    |  stwux TMP0, RA, BASE
-+    |  stw TMP1, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-   case BC_NOT:
-@@ -3426,44 +3882,65 @@ static void build_ins(BuildCtx *ctx, BCO
-     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
-     ||switch (vk) {
-     ||case 0:
--    |   lwzx TMP1, BASE, RB
-+    |   lwzx CARG1, BASE, RB
-     |   .if DUALNUM
--    |     lwzx TMP2, KBASE, RC
-+    |     lwzx CARG3, KBASE, RC
-     |   .endif
-+    |   .if FPU
-     |    lfdx f14, BASE, RB
-     |    lfdx f15, KBASE, RC
-+    |   .else
-+    |    add TMP1, BASE, RB
-+    |    add TMP2, KBASE, RC
-+    |    lwz CARG2, 4(TMP1)
-+    |    lwz CARG4, 4(TMP2)
-+    |   .endif
-     |   .if DUALNUM
--    |     checknum cr0, TMP1
--    |     checknum cr1, TMP2
-+    |     checknum cr0, CARG1
-+    |     checknum cr1, CARG3
-     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |     bge ->vmeta_arith_vn
-     |   .else
--    |     checknum TMP1; bge ->vmeta_arith_vn
-+    |     checknum CARG1; bge ->vmeta_arith_vn
-     |   .endif
-     ||  break;
-     ||case 1:
--    |   lwzx TMP1, BASE, RB
-+    |   lwzx CARG1, BASE, RB
-     |   .if DUALNUM
--    |     lwzx TMP2, KBASE, RC
-+    |     lwzx CARG3, KBASE, RC
-     |   .endif
-+    |   .if FPU
-     |    lfdx f15, BASE, RB
-     |    lfdx f14, KBASE, RC
-+    |   .else
-+    |    add TMP1, BASE, RB
-+    |    add TMP2, KBASE, RC
-+    |    lwz CARG2, 4(TMP1)
-+    |    lwz CARG4, 4(TMP2)
-+    |   .endif
-     |   .if DUALNUM
--    |     checknum cr0, TMP1
--    |     checknum cr1, TMP2
-+    |     checknum cr0, CARG1
-+    |     checknum cr1, CARG3
-     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |     bge ->vmeta_arith_nv
-     |   .else
--    |     checknum TMP1; bge ->vmeta_arith_nv
-+    |     checknum CARG1; bge ->vmeta_arith_nv
-     |   .endif
-     ||  break;
-     ||default:
--    |   lwzx TMP1, BASE, RB
--    |   lwzx TMP2, BASE, RC
-+    |   lwzx CARG1, BASE, RB
-+    |   lwzx CARG3, BASE, RC
-+    |   .if FPU
-     |    lfdx f14, BASE, RB
-     |    lfdx f15, BASE, RC
--    |   checknum cr0, TMP1
--    |   checknum cr1, TMP2
-+    |   .else
-+    |    add TMP1, BASE, RB
-+    |    add TMP2, BASE, RC
-+    |    lwz CARG2, 4(TMP1)
-+    |    lwz CARG4, 4(TMP2)
-+    |   .endif
-+    |   checknum cr0, CARG1
-+    |   checknum cr1, CARG3
-     |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |   bge ->vmeta_arith_vv
-     ||  break;
-@@ -3497,48 +3974,78 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  fsub a, b, a                   // b - floor(b/c)*c
-     |.endmacro
-     |
-+    |.macro sfpmod
-+    |->BC_MODVN_Z:
-+    |  stw CARG1, SFSAVE_1
-+    |  stw CARG2, SFSAVE_2
-+    |  mr SAVE0, CARG3
-+    |  mr SAVE1, CARG4
-+    |  blex __divdf3
-+    |  blex floor
-+    |  mr CARG3, SAVE0
-+    |  mr CARG4, SAVE1
-+    |  blex __muldf3
-+    |  mr CARG3, CRET1
-+    |  mr CARG4, CRET2
-+    |  lwz CARG1, SFSAVE_1
-+    |  lwz CARG2, SFSAVE_2
-+    |  blex __subdf3
-+    |.endmacro
-+    |
-     |.macro ins_arithfp, fpins
-     |  ins_arithpre
-     |.if "fpins" == "fpmod_"
-     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
--    |.else
-+    |.elif FPU
-     |  fpins f0, f14, f15
-     |  ins_next1
-     |  stfdx f0, BASE, RA
-     |  ins_next2
-+    |.else
-+    |  blex __divdf3                  // Only soft-float div uses this macro.
-+    |  ins_next1
-+    |  stwux CRET1, RA, BASE
-+    |  stw CRET2, 4(RA)
-+    |  ins_next2
-     |.endif
-     |.endmacro
-     |
--    |.macro ins_arithdn, intins, fpins
-+    |.macro ins_arithdn, intins, fpins, fpcall
-     |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8
-     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
-     ||switch (vk) {
-     ||case 0:
--    |   lwzux TMP1, RB, BASE
--    |   lwzux TMP2, RC, KBASE
--    |    lwz CARG1, 4(RB)
--    |   checknum cr0, TMP1
--    |    lwz CARG2, 4(RC)
-+    |   lwzux CARG1, RB, BASE
-+    |   lwzux CARG3, RC, KBASE
-+    |    lwz CARG2, 4(RB)
-+    |   checknum cr0, CARG1
-+    |    lwz CARG4, 4(RC)
-+    |   checknum cr1, CARG3
-     ||  break;
-     ||case 1:
--    |   lwzux TMP1, RB, BASE
--    |   lwzux TMP2, RC, KBASE
--    |    lwz CARG2, 4(RB)
--    |   checknum cr0, TMP1
--    |    lwz CARG1, 4(RC)
-+    |   lwzux CARG3, RB, BASE
-+    |   lwzux CARG1, RC, KBASE
-+    |    lwz CARG4, 4(RB)
-+    |   checknum cr0, CARG3
-+    |    lwz CARG2, 4(RC)
-+    |   checknum cr1, CARG1
-     ||  break;
-     ||default:
--    |   lwzux TMP1, RB, BASE
--    |   lwzux TMP2, RC, BASE
--    |    lwz CARG1, 4(RB)
--    |   checknum cr0, TMP1
--    |    lwz CARG2, 4(RC)
-+    |   lwzux CARG1, RB, BASE
-+    |   lwzux CARG3, RC, BASE
-+    |    lwz CARG2, 4(RB)
-+    |   checknum cr0, CARG1
-+    |    lwz CARG4, 4(RC)
-+    |   checknum cr1, CARG3
-     ||  break;
-     ||}
--    |  checknum cr1, TMP2
-     |  bne >5
-     |  bne cr1, >5
--    |  intins CARG1, CARG1, CARG2
-+    |.if "intins" == "intmod"
-+    |  mr CARG1, CARG2
-+    |  mr CARG2, CARG4
-+    |.endif
-+    |  intins CARG1, CARG2, CARG4
-     |  bso >4
-     |1:
-     |  ins_next1
-@@ -3550,29 +4057,40 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  checkov TMP0, <1                       // Ignore unrelated overflow.
-     |  ins_arithfallback b
-     |5:  // FP variant.
-+    |.if FPU
-     ||if (vk == 1) {
-     |  lfd f15, 0(RB)
--    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |  lfd f14, 0(RC)
-     ||} else {
-     |  lfd f14, 0(RB)
--    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |  lfd f15, 0(RC)
-     ||}
-+    |.endif
-+    |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |   ins_arithfallback bge
-     |.if "fpins" == "fpmod_"
-     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
-     |.else
-+    |.if FPU
-     |  fpins f0, f14, f15
--    |  ins_next1
-     |  stfdx f0, BASE, RA
-+    |.else
-+    |.if "fpcall" == "sfpmod"
-+    |  sfpmod
-+    |.else
-+    |  blex fpcall
-+    |.endif
-+    |  stwux CRET1, RA, BASE
-+    |  stw CRET2, 4(RA)
-+    |.endif
-+    |  ins_next1
-     |  b <2
-     |.endif
-     |.endmacro
-     |
--    |.macro ins_arith, intins, fpins
-+    |.macro ins_arith, intins, fpins, fpcall
-     |.if DUALNUM
--    |  ins_arithdn intins, fpins
-+    |  ins_arithdn intins, fpins, fpcall
-     |.else
-     |  ins_arithfp fpins
-     |.endif
-@@ -3587,9 +4105,9 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  addo. TMP0, TMP0, TMP3
-     |  add y, a, b
-     |.endmacro
--    |  ins_arith addo32., fadd
-+    |  ins_arith addo32., fadd, __adddf3
-     |.else
--    |  ins_arith addo., fadd
-+    |  ins_arith addo., fadd, __adddf3
-     |.endif
-     break;
-   case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
-@@ -3601,36 +4119,48 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  subo. TMP0, TMP0, TMP3
-     |  sub y, a, b
-     |.endmacro
--    |  ins_arith subo32., fsub
-+    |  ins_arith subo32., fsub, __subdf3
-     |.else
--    |  ins_arith subo., fsub
-+    |  ins_arith subo., fsub, __subdf3
-     |.endif
-     break;
-   case BC_MULVN: case BC_MULNV: case BC_MULVV:
--    |  ins_arith mullwo., fmul
-+    |  ins_arith mullwo., fmul, __muldf3
-     break;
-   case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
-     |  ins_arithfp fdiv
-     break;
-   case BC_MODVN:
--    |  ins_arith intmod, fpmod
-+    |  ins_arith intmod, fpmod, sfpmod
-     break;
-   case BC_MODNV: case BC_MODVV:
--    |  ins_arith intmod, fpmod_
-+    |  ins_arith intmod, fpmod_, sfpmod
-     break;
-   case BC_POW:
-     |  // NYI: (partial) integer arithmetic.
--    |  lwzx TMP1, BASE, RB
-+    |  lwzx CARG1, BASE, RB
-+    |  lwzx CARG3, BASE, RC
-+    |.if FPU
-     |   lfdx FARG1, BASE, RB
--    |  lwzx TMP2, BASE, RC
-     |   lfdx FARG2, BASE, RC
--    |  checknum cr0, TMP1
--    |  checknum cr1, TMP2
-+    |.else
-+    |   add TMP1, BASE, RB
-+    |   add TMP2, BASE, RC
-+    |   lwz CARG2, 4(TMP1)
-+    |   lwz CARG4, 4(TMP2)
-+    |.endif
-+    |  checknum cr0, CARG1
-+    |  checknum cr1, CARG3
-     |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-     |  bge ->vmeta_arith_vv
-     |  blex pow
-     |  ins_next1
-+    |.if FPU
-     |  stfdx FARG1, BASE, RA
-+    |.else
-+    |  stwux CARG1, RA, BASE
-+    |  stw CARG2, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-@@ -3650,8 +4180,15 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   lp BASE, L->base
-     |  bne ->vmeta_binop
-     |  ins_next1
-+    |.if FPU
-     |  lfdx f0, BASE, SAVE0           // Copy result from RB to RA.
-     |  stfdx f0, BASE, RA
-+    |.else
-+    |  lwzux TMP0, SAVE0, BASE
-+    |  lwz TMP1, 4(SAVE0)
-+    |  stwux TMP0, RA, BASE
-+    |  stw TMP1, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-@@ -3714,8 +4251,15 @@ static void build_ins(BuildCtx *ctx, BCO
-   case BC_KNUM:
-     |  // RA = dst*8, RD = num_const*8
-     |  ins_next1
-+    |.if FPU
-     |  lfdx f0, KBASE, RD
-     |  stfdx f0, BASE, RA
-+    |.else
-+    |  lwzux TMP0, RD, KBASE
-+    |  lwz TMP1, 4(RD)
-+    |  stwux TMP0, RA, BASE
-+    |  stw TMP1, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-   case BC_KPRI:
-@@ -3748,8 +4292,15 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lwzx UPVAL:RB, LFUNC:RB, RD
-     |  ins_next1
-     |  lwz TMP1, UPVAL:RB->v
-+    |.if FPU
-     |  lfd f0, 0(TMP1)
-     |  stfdx f0, BASE, RA
-+    |.else
-+    |  lwz TMP2, 0(TMP1)
-+    |  lwz TMP3, 4(TMP1)
-+    |  stwux TMP2, RA, BASE
-+    |  stw TMP3, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-   case BC_USETV:
-@@ -3757,14 +4308,24 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
-     |    srwi RA, RA, 1
-     |    addi RA, RA, offsetof(GCfuncL, uvptr)
-+    |.if FPU
-     |   lfdux f0, RD, BASE
-+    |.else
-+    |   lwzux CARG1, RD, BASE
-+    |   lwz CARG3, 4(RD)
-+    |.endif
-     |  lwzx UPVAL:RB, LFUNC:RB, RA
-     |  lbz TMP3, UPVAL:RB->marked
-     |   lwz CARG2, UPVAL:RB->v
-     |  andix. TMP3, TMP3, LJ_GC_BLACK // isblack(uv)
-     |    lbz TMP0, UPVAL:RB->closed
-     |   lwz TMP2, 0(RD)
-+    |.if FPU
-     |   stfd f0, 0(CARG2)
-+    |.else
-+    |   stw CARG1, 0(CARG2)
-+    |   stw CARG3, 4(CARG2)
-+    |.endif
-     |    cmplwi cr1, TMP0, 0
-     |   lwz TMP1, 4(RD)
-     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
-@@ -3820,11 +4381,21 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
-     |   srwi RA, RA, 1
-     |   addi RA, RA, offsetof(GCfuncL, uvptr)
-+    |.if FPU
-     |    lfdx f0, KBASE, RD
-+    |.else
-+    |    lwzux TMP2, RD, KBASE
-+    |    lwz TMP3, 4(RD)
-+    |.endif
-     |  lwzx UPVAL:RB, LFUNC:RB, RA
-     |  ins_next1
-     |  lwz TMP1, UPVAL:RB->v
-+    |.if FPU
-     |  stfd f0, 0(TMP1)
-+    |.else
-+    |  stw TMP2, 0(TMP1)
-+    |  stw TMP3, 4(TMP1)
-+    |.endif
-     |  ins_next2
-     break;
-   case BC_USETP:
-@@ -3972,11 +4543,21 @@ static void build_ins(BuildCtx *ctx, BCO
-     |.endif
-     |  ble ->vmeta_tgetv              // Integer key and in array part?
-     |  lwzx TMP0, TMP1, TMP2
-+    |.if FPU
-     |   lfdx f14, TMP1, TMP2
-+    |.else
-+    |   lwzux SAVE0, TMP1, TMP2
-+    |   lwz SAVE1, 4(TMP1)
-+    |.endif
-     |  checknil TMP0; beq >2
-     |1:
-     |  ins_next1
-+    |.if FPU
-     |   stfdx f14, BASE, RA
-+    |.else
-+    |   stwux SAVE0, RA, BASE
-+    |   stw SAVE1, 4(RA)
-+    |.endif
-     |  ins_next2
-     |
-     |2:  // Check for __index if table value is nil.
-@@ -4052,12 +4633,22 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lwz TMP1, TAB:RB->asize
-     |   lwz TMP2, TAB:RB->array
-     |  cmplw TMP0, TMP1; bge ->vmeta_tgetb
-+    |.if FPU
-     |  lwzx TMP1, TMP2, RC
-     |   lfdx f0, TMP2, RC
-+    |.else
-+    |  lwzux TMP1, TMP2, RC
-+    |   lwz TMP3, 4(TMP2)
-+    |.endif
-     |  checknil TMP1; beq >5
-     |1:
-     |  ins_next1
-+    |.if FPU
-     |   stfdx f0, BASE, RA
-+    |.else
-+    |   stwux TMP1, RA, BASE
-+    |   stw TMP3, 4(RA)
-+    |.endif
-     |  ins_next2
-     |
-     |5:  // Check for __index if table value is nil.
-@@ -4087,10 +4678,20 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  cmplw TMP0, CARG2
-     |   slwi TMP2, CARG2, 3
-     |  ble ->vmeta_tgetr              // In array part?
-+    |.if FPU
-     |   lfdx f14, TMP1, TMP2
-+    |.else
-+    |   lwzux SAVE0, TMP2, TMP1
-+    |   lwz SAVE1, 4(TMP2)
-+    |.endif
-     |->BC_TGETR_Z:
-     |  ins_next1
-+    |.if FPU
-     |   stfdx f14, BASE, RA
-+    |.else
-+    |   stwux SAVE0, RA, BASE
-+    |   stw SAVE1, 4(RA)
-+    |.endif
-     |  ins_next2
-     break;
-@@ -4131,11 +4732,22 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  ble ->vmeta_tsetv              // Integer key and in array part?
-     |   lwzx TMP2, TMP1, TMP0
-     |  lbz TMP3, TAB:RB->marked
-+    |.if FPU
-     |    lfdx f14, BASE, RA
-+    |.else
-+    |    add SAVE1, BASE, RA
-+    |    lwz SAVE0, 0(SAVE1)
-+    |    lwz SAVE1, 4(SAVE1)
-+    |.endif
-     |   checknil TMP2; beq >3
-     |1:
-     |  andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table)
-+    |.if FPU
-     |    stfdx f14, TMP1, TMP0
-+    |.else
-+    |    stwux SAVE0, TMP1, TMP0
-+    |    stw SAVE1, 4(TMP1)
-+    |.endif
-     |  bne >7
-     |2:
-     |  ins_next
-@@ -4176,7 +4788,13 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  lwz NODE:TMP2, TAB:RB->node
-     |    stb ZERO, TAB:RB->nomm               // Clear metamethod cache.
-     |  and TMP1, TMP1, TMP0           // idx = str->hash & tab->hmask
-+    |.if FPU
-     |    lfdx f14, BASE, RA
-+    |.else
-+    |    add CARG2, BASE, RA
-+    |    lwz SAVE0, 0(CARG2)
-+    |    lwz SAVE1, 4(CARG2)
-+    |.endif
-     |  slwi TMP0, TMP1, 5
-     |  slwi TMP1, TMP1, 3
-     |  sub TMP1, TMP0, TMP1
-@@ -4192,7 +4810,12 @@ static void build_ins(BuildCtx *ctx, BCO
-     |    checknil CARG2; beq >4               // Key found, but nil value?
-     |2:
-     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
-+    |.if FPU
-     |    stfd f14, NODE:TMP2->val
-+    |.else
-+    |    stw SAVE0, NODE:TMP2->val.u32.hi
-+    |    stw SAVE1, NODE:TMP2->val.u32.lo
-+    |.endif
-     |  bne >7
-     |3:
-     |  ins_next
-@@ -4231,7 +4854,12 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  bl extern lj_tab_newkey                // (lua_State *L, GCtab *t, TValue *k)
-     |  // Returns TValue *.
-     |  lp BASE, L->base
-+    |.if FPU
-     |  stfd f14, 0(CRET1)
-+    |.else
-+    |  stw SAVE0, 0(CRET1)
-+    |  stw SAVE1, 4(CRET1)
-+    |.endif
-     |  b <3                           // No 2nd write barrier needed.
-     |
-     |7:  // Possible table write barrier for the value. Skip valiswhite check.
-@@ -4248,13 +4876,24 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   lwz TMP2, TAB:RB->array
-     |    lbz TMP3, TAB:RB->marked
-     |  cmplw TMP0, TMP1
-+    |.if FPU
-     |   lfdx f14, BASE, RA
-+    |.else
-+    |   add CARG2, BASE, RA
-+    |   lwz SAVE0, 0(CARG2)
-+    |   lwz SAVE1, 4(CARG2)
-+    |.endif
-     |  bge ->vmeta_tsetb
-     |  lwzx TMP1, TMP2, RC
-     |  checknil TMP1; beq >5
-     |1:
-     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
-+    |.if FPU
-     |   stfdx f14, TMP2, RC
-+    |.else
-+    |   stwux SAVE0, RC, TMP2
-+    |   stw SAVE1, 4(RC)
-+    |.endif
-     |  bne >7
-     |2:
-     |  ins_next
-@@ -4294,10 +4933,20 @@ static void build_ins(BuildCtx *ctx, BCO
-     |2:
-     |  cmplw TMP0, CARG3
-     |   slwi TMP2, CARG3, 3
-+    |.if FPU
-     |   lfdx f14, BASE, RA
-+    |.else
-+    |  lwzux SAVE0, RA, BASE
-+    |  lwz SAVE1, 4(RA)
-+    |.endif
-     |  ble ->vmeta_tsetr              // In array part?
-     |  ins_next1
-+    |.if FPU
-     |   stfdx f14, TMP1, TMP2
-+    |.else
-+    |   stwux SAVE0, TMP1, TMP2
-+    |   stw SAVE1, 4(TMP1)
-+    |.endif
-     |  ins_next2
-     |
-     |7:  // Possible table write barrier for the value. Skip valiswhite check.
-@@ -4327,10 +4976,20 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   add TMP1, TMP1, TMP0
-     |    andix. TMP0, TMP3, LJ_GC_BLACK       // isblack(table)
-     |3:  // Copy result slots to table.
-+    |.if FPU
-     |   lfd f0, 0(RA)
-+    |.else
-+    |   lwz SAVE0, 0(RA)
-+    |   lwz SAVE1, 4(RA)
-+    |.endif
-     |  addi RA, RA, 8
-     |  cmpw cr1, RA, TMP2
-+    |.if FPU
-     |   stfd f0, 0(TMP1)
-+    |.else
-+    |   stw SAVE0, 0(TMP1)
-+    |   stw SAVE1, 4(TMP1)
-+    |.endif
-     |    addi TMP1, TMP1, 8
-     |  blt cr1, <3
-     |  bne >7
-@@ -4397,9 +5056,20 @@ static void build_ins(BuildCtx *ctx, BCO
-     |    beq cr1, >3
-     |2:
-     |  addi TMP3, TMP2, 8
-+    |.if FPU
-     |   lfdx f0, RA, TMP2
-+    |.else
-+    |   add CARG3, RA, TMP2
-+    |   lwz CARG1, 0(CARG3)
-+    |   lwz CARG2, 4(CARG3)
-+    |.endif
-     |  cmplw cr1, TMP3, NARGS8:RC
-+    |.if FPU
-     |   stfdx f0, BASE, TMP2
-+    |.else
-+    |   stwux CARG1, TMP2, BASE
-+    |   stw CARG2, 4(TMP2)
-+    |.endif
-     |  mr TMP2, TMP3
-     |  bne cr1, <2
-     |3:
-@@ -4432,14 +5102,28 @@ static void build_ins(BuildCtx *ctx, BCO
-     |  add BASE, BASE, RA
-     |  lwz TMP1, -24(BASE)
-     |   lwz LFUNC:RB, -20(BASE)
-+    |.if FPU
-     |    lfd f1, -8(BASE)
-     |    lfd f0, -16(BASE)
-+    |.else
-+    |    lwz CARG1, -8(BASE)
-+    |    lwz CARG2, -4(BASE)
-+    |    lwz CARG3, -16(BASE)
-+    |    lwz CARG4, -12(BASE)
-+    |.endif
-     |  stw TMP1, 0(BASE)              // Copy callable.
-     |   stw LFUNC:RB, 4(BASE)
-     |  checkfunc TMP1
--    |    stfd f1, 16(BASE)            // Copy control var.
-     |     li NARGS8:RC, 16            // Iterators get 2 arguments.
-+    |.if FPU
-+    |    stfd f1, 16(BASE)            // Copy control var.
-     |    stfdu f0, 8(BASE)            // Copy state.
-+    |.else
-+    |    stw CARG1, 16(BASE)          // Copy control var.
-+    |    stw CARG2, 20(BASE)
-+    |    stwu CARG3, 8(BASE)          // Copy state.
-+    |    stw CARG4, 4(BASE)
-+    |.endif
-     |  bne ->vmeta_call
-     |  ins_call
-     break;
-@@ -4460,7 +5144,12 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   slwi TMP3, RC, 3
-     |  bge >5                         // Index points after array part?
-     |  lwzx TMP2, TMP1, TMP3
-+    |.if FPU
-     |   lfdx f0, TMP1, TMP3
-+    |.else
-+    |   lwzux CARG1, TMP3, TMP1
-+    |   lwz CARG2, 4(TMP3)
-+    |.endif
-     |  checknil TMP2
-     |     lwz INS, -4(PC)
-     |  beq >4
-@@ -4472,7 +5161,12 @@ static void build_ins(BuildCtx *ctx, BCO
-     |.endif
-     |    addi RC, RC, 1
-     |     addis TMP3, PC, -(BCBIAS_J*4 >> 16)
-+    |.if FPU
-     |  stfd f0, 8(RA)
-+    |.else
-+    |  stw CARG1, 8(RA)
-+    |  stw CARG2, 12(RA)
-+    |.endif
-     |     decode_RD4 TMP1, INS
-     |    stw RC, -4(RA)                       // Update control var.
-     |     add PC, TMP1, TMP3
-@@ -4497,17 +5191,38 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   slwi RB, RC, 3
-     |   sub TMP3, TMP3, RB
-     |  lwzx RB, TMP2, TMP3
-+    |.if FPU
-     |  lfdx f0, TMP2, TMP3
-+    |.else
-+    |  add CARG3, TMP2, TMP3
-+    |  lwz CARG1, 0(CARG3)
-+    |  lwz CARG2, 4(CARG3)
-+    |.endif
-     |   add NODE:TMP3, TMP2, TMP3
-     |  checknil RB
-     |     lwz INS, -4(PC)
-     |  beq >7
-+    |.if FPU
-     |   lfd f1, NODE:TMP3->key
-+    |.else
-+    |   lwz CARG3, NODE:TMP3->key.u32.hi
-+    |   lwz CARG4, NODE:TMP3->key.u32.lo
-+    |.endif
-     |     addis TMP2, PC, -(BCBIAS_J*4 >> 16)
-+    |.if FPU
-     |  stfd f0, 8(RA)
-+    |.else
-+    |  stw CARG1, 8(RA)
-+    |  stw CARG2, 12(RA)
-+    |.endif
-     |    add RC, RC, TMP0
-     |     decode_RD4 TMP1, INS
-+    |.if FPU
-     |   stfd f1, 0(RA)
-+    |.else
-+    |   stw CARG3, 0(RA)
-+    |   stw CARG4, 4(RA)
-+    |.endif
-     |    addi RC, RC, 1
-     |     add PC, TMP1, TMP2
-     |    stw RC, -4(RA)                       // Update control var.
-@@ -4573,9 +5288,19 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   subi TMP2, TMP2, 16
-     |   ble >2                                // No vararg slots?
-     |1:  // Copy vararg slots to destination slots.
-+    |.if FPU
-     |  lfd f0, 0(RC)
-+    |.else
-+    |  lwz CARG1, 0(RC)
-+    |  lwz CARG2, 4(RC)
-+    |.endif
-     |   addi RC, RC, 8
-+    |.if FPU
-     |  stfd f0, 0(RA)
-+    |.else
-+    |  stw CARG1, 0(RA)
-+    |  stw CARG2, 4(RA)
-+    |.endif
-     |  cmplw RA, TMP2
-     |   cmplw cr1, RC, TMP3
-     |  bge >3                         // All destination slots filled?
-@@ -4598,9 +5323,19 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   addi MULTRES, TMP1, 8
-     |  bgt >7
-     |6:
-+    |.if FPU
-     |  lfd f0, 0(RC)
-+    |.else
-+    |  lwz CARG1, 0(RC)
-+    |  lwz CARG2, 4(RC)
-+    |.endif
-     |   addi RC, RC, 8
-+    |.if FPU
-     |  stfd f0, 0(RA)
-+    |.else
-+    |  stw CARG1, 0(RA)
-+    |  stw CARG2, 4(RA)
-+    |.endif
-     |  cmplw RC, TMP3
-     |   addi RA, RA, 8
-     |  blt <6                         // More vararg slots?
-@@ -4651,14 +5386,38 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   li TMP1, 0
-     |2:
-     |  addi TMP3, TMP1, 8
-+    |.if FPU
-     |   lfdx f0, RA, TMP1
-+    |.else
-+    |   add CARG3, RA, TMP1
-+    |   lwz CARG1, 0(CARG3)
-+    |   lwz CARG2, 4(CARG3)
-+    |.endif
-     |  cmpw TMP3, RC
-+    |.if FPU
-     |   stfdx f0, TMP2, TMP1
-+    |.else
-+    |   add CARG3, TMP2, TMP1
-+    |   stw CARG1, 0(CARG3)
-+    |   stw CARG2, 4(CARG3)
-+    |.endif
-     |  beq >3
-     |  addi TMP1, TMP3, 8
-+    |.if FPU
-     |   lfdx f1, RA, TMP3
-+    |.else
-+    |   add CARG3, RA, TMP3
-+    |   lwz CARG1, 0(CARG3)
-+    |   lwz CARG2, 4(CARG3)
-+    |.endif
-     |  cmpw TMP1, RC
-+    |.if FPU
-     |   stfdx f1, TMP2, TMP3
-+    |.else
-+    |   add CARG3, TMP2, TMP3
-+    |   stw CARG1, 0(CARG3)
-+    |   stw CARG2, 4(CARG3)
-+    |.endif
-     |  bne <2
-     |3:
-     |5:
-@@ -4700,8 +5459,15 @@ static void build_ins(BuildCtx *ctx, BCO
-     |   subi TMP2, BASE, 8
-     |  decode_RB8 RB, INS
-     if (op == BC_RET1) {
-+      |.if FPU
-       |  lfd f0, 0(RA)
-       |  stfd f0, 0(TMP2)
-+      |.else
-+      |  lwz CARG1, 0(RA)
-+      |  lwz CARG2, 4(RA)
-+      |  stw CARG1, 0(TMP2)
-+      |  stw CARG2, 4(TMP2)
-+      |.endif
-     }
-     |5:
-     |  cmplw RB, RD
-@@ -4762,11 +5528,11 @@ static void build_ins(BuildCtx *ctx, BCO
-       |4:
-       |  stw CARG1, FORL_IDX*8+4(RA)
-     } else {
--      |  lwz TMP3, FORL_STEP*8(RA)
-+      |  lwz SAVE0, FORL_STEP*8(RA)
-       |   lwz CARG3, FORL_STEP*8+4(RA)
-       |  lwz TMP2, FORL_STOP*8(RA)
-       |   lwz CARG2, FORL_STOP*8+4(RA)
--      |  cmplw cr7, TMP3, TISNUM
-+      |  cmplw cr7, SAVE0, TISNUM
-       |  cmplw cr1, TMP2, TISNUM
-       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq
-       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
-@@ -4809,41 +5575,80 @@ static void build_ins(BuildCtx *ctx, BCO
-     if (vk) {
-       |.if DUALNUM
-       |9:  // FP loop.
-+      |.if FPU
-       |  lfd f1, FORL_IDX*8(RA)
-       |.else
-+      |  lwz CARG1, FORL_IDX*8(RA)
-+      |  lwz CARG2, FORL_IDX*8+4(RA)
-+      |.endif
-+      |.else
-       |  lfdux f1, RA, BASE
-       |.endif
-+      |.if FPU
-       |  lfd f3, FORL_STEP*8(RA)
-       |  lfd f2, FORL_STOP*8(RA)
--      |   lwz TMP3, FORL_STEP*8(RA)
-       |  fadd f1, f1, f3
-       |  stfd f1, FORL_IDX*8(RA)
-+      |.else
-+      |  lwz CARG3, FORL_STEP*8(RA)
-+      |  lwz CARG4, FORL_STEP*8+4(RA)
-+      |  mr SAVE1, RD
-+      |  blex __adddf3
-+      |  mr RD, SAVE1
-+      |  stw CRET1, FORL_IDX*8(RA)
-+      |  stw CRET2, FORL_IDX*8+4(RA)
-+      |  lwz CARG3, FORL_STOP*8(RA)
-+      |  lwz CARG4, FORL_STOP*8+4(RA)
-+      |.endif
-+      |   lwz SAVE0, FORL_STEP*8(RA)
-     } else {
-       |.if DUALNUM
-       |9:  // FP loop.
-       |.else
-       |  lwzux TMP1, RA, BASE
--      |  lwz TMP3, FORL_STEP*8(RA)
-+      |  lwz SAVE0, FORL_STEP*8(RA)
-       |  lwz TMP2, FORL_STOP*8(RA)
-       |  cmplw cr0, TMP1, TISNUM
--      |  cmplw cr7, TMP3, TISNUM
-+      |  cmplw cr7, SAVE0, TISNUM
-       |  cmplw cr1, TMP2, TISNUM
-       |.endif
-+      |.if FPU
-       |   lfd f1, FORL_IDX*8(RA)
-+      |.else
-+      |   lwz CARG1, FORL_IDX*8(RA)
-+      |   lwz CARG2, FORL_IDX*8+4(RA)
-+      |.endif
-       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt
-       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
-+      |.if FPU
-       |   lfd f2, FORL_STOP*8(RA)
-+      |.else
-+      |   lwz CARG3, FORL_STOP*8(RA)
-+      |   lwz CARG4, FORL_STOP*8+4(RA)
-+      |.endif
-       |  bge ->vmeta_for
-     }
--    |  cmpwi cr6, TMP3, 0
-+    |  cmpwi cr6, SAVE0, 0
-     if (op != BC_JFORL) {
-       |  srwi RD, RD, 1
-     }
-+    |.if FPU
-     |   stfd f1, FORL_EXT*8(RA)
-+    |.else
-+    |   stw CARG1, FORL_EXT*8(RA)
-+    |   stw CARG2, FORL_EXT*8+4(RA)
-+    |.endif
-     if (op != BC_JFORL) {
-       |  add RD, PC, RD
-     }
-+    |.if FPU
-     |  fcmpu cr0, f1, f2
-+    |.else
-+    |  mr SAVE1, RD
-+    |  blex __ledf2
-+    |  cmpwi CRET1, 0
-+    |  mr RD, SAVE1
-+    |.endif
-     if (op == BC_JFORI) {
-       |  addis PC, RD, -(BCBIAS_J*4 >> 16)
-     }
diff --git a/lang/luajit/patches/050-ppc-softfloat.patch b/lang/luajit/patches/050-ppc-softfloat.patch
deleted file mode 100644 (file)
index 68215bb..0000000
+++ /dev/null
@@ -1,744 +0,0 @@
-From 71b7bc88341945f13f3951e2bb5fd247b639ff7a Mon Sep 17 00:00:00 2001
-From: Mike Pall <mike>
-Date: Sun, 3 Sep 2017 23:20:53 +0200
-Subject: [PATCH] PPC: Add soft-float support to JIT compiler backend.
-
-Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
-Sponsored by Cisco Systems, Inc.
----
- src/lj_arch.h    |   1 -
- src/lj_asm_ppc.h | 321 ++++++++++++++++++++++++++++++++++++++++-------
- 2 files changed, 278 insertions(+), 44 deletions(-)
-
---- a/src/lj_arch.h
-+++ b/src/lj_arch.h
-@@ -273,7 +273,6 @@
- #endif
- #if LJ_ABI_SOFTFP
--#define LJ_ARCH_NOJIT         1  /* NYI */
- #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
- #else
- #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
---- a/src/lj_asm_ppc.h
-+++ b/src/lj_asm_ppc.h
-@@ -226,6 +226,7 @@ static void asm_fusexrefx(ASMState *as,
-   emit_tab(as, pi, rt, left, right);
- }
-+#if !LJ_SOFTFP
- /* Fuse to multiply-add/sub instruction. */
- static int asm_fusemadd(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pir)
- {
-@@ -245,6 +246,7 @@ static int asm_fusemadd(ASMState *as, IR
-   }
-   return 0;
- }
-+#endif
- /* -- Calls --------------------------------------------------------------- */
-@@ -253,13 +255,17 @@ static void asm_gencall(ASMState *as, co
- {
-   uint32_t n, nargs = CCI_XNARGS(ci);
-   int32_t ofs = 8;
--  Reg gpr = REGARG_FIRSTGPR, fpr = REGARG_FIRSTFPR;
-+  Reg gpr = REGARG_FIRSTGPR;
-+#if !LJ_SOFTFP
-+  Reg fpr = REGARG_FIRSTFPR;
-+#endif
-   if ((void *)ci->func)
-     emit_call(as, (void *)ci->func);
-   for (n = 0; n < nargs; n++) {  /* Setup args. */
-     IRRef ref = args[n];
-     if (ref) {
-       IRIns *ir = IR(ref);
-+#if !LJ_SOFTFP
-       if (irt_isfp(ir->t)) {
-       if (fpr <= REGARG_LASTFPR) {
-         lua_assert(rset_test(as->freeset, fpr));  /* Already evicted. */
-@@ -271,7 +277,9 @@ static void asm_gencall(ASMState *as, co
-         emit_spstore(as, ir, r, ofs);
-         ofs += irt_isnum(ir->t) ? 8 : 4;
-       }
--      } else {
-+      } else
-+#endif
-+      {
-       if (gpr <= REGARG_LASTGPR) {
-         lua_assert(rset_test(as->freeset, gpr));  /* Already evicted. */
-         ra_leftov(as, gpr, ref);
-@@ -290,8 +298,10 @@ static void asm_gencall(ASMState *as, co
-     }
-     checkmclim(as);
-   }
-+#if !LJ_SOFTFP
-   if ((ci->flags & CCI_VARARG))  /* Vararg calls need to know about FPR use. */
-     emit_tab(as, fpr == REGARG_FIRSTFPR ? PPCI_CRXOR : PPCI_CREQV, 6, 6, 6);
-+#endif
- }
- /* Setup result reg/sp for call. Evict scratch regs. */
-@@ -299,8 +309,10 @@ static void asm_setupresult(ASMState *as
- {
-   RegSet drop = RSET_SCRATCH;
-   int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
-+#if !LJ_SOFTFP
-   if ((ci->flags & CCI_NOFPRCLOBBER))
-     drop &= ~RSET_FPR;
-+#endif
-   if (ra_hasreg(ir->r))
-     rset_clear(drop, ir->r);  /* Dest reg handled below. */
-   if (hiop && ra_hasreg((ir+1)->r))
-@@ -308,7 +320,7 @@ static void asm_setupresult(ASMState *as
-   ra_evictset(as, drop);  /* Evictions must be performed first. */
-   if (ra_used(ir)) {
-     lua_assert(!irt_ispri(ir->t));
--    if (irt_isfp(ir->t)) {
-+    if (!LJ_SOFTFP && irt_isfp(ir->t)) {
-       if ((ci->flags & CCI_CASTU64)) {
-       /* Use spill slot or temp slots. */
-       int32_t ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
-@@ -377,6 +389,7 @@ static void asm_retf(ASMState *as, IRIns
- /* -- Type conversions ---------------------------------------------------- */
-+#if !LJ_SOFTFP
- static void asm_tointg(ASMState *as, IRIns *ir, Reg left)
- {
-   RegSet allow = RSET_FPR;
-@@ -409,15 +422,23 @@ static void asm_tobit(ASMState *as, IRIn
-   emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);
-   emit_fab(as, PPCI_FADD, tmp, left, right);
- }
-+#endif
- static void asm_conv(ASMState *as, IRIns *ir)
- {
-   IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);
-+#if !LJ_SOFTFP
-   int stfp = (st == IRT_NUM || st == IRT_FLOAT);
-+#endif
-   IRRef lref = ir->op1;
--  lua_assert(irt_type(ir->t) != st);
-   lua_assert(!(irt_isint64(ir->t) ||
-              (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */
-+#if LJ_SOFTFP
-+  /* FP conversions are handled by SPLIT. */
-+  lua_assert(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT));
-+  /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */
-+#else
-+  lua_assert(irt_type(ir->t) != st);
-   if (irt_isfp(ir->t)) {
-     Reg dest = ra_dest(as, ir, RSET_FPR);
-     if (stfp) {  /* FP to FP conversion. */
-@@ -476,7 +497,9 @@ static void asm_conv(ASMState *as, IRIns
-       emit_fb(as, PPCI_FCTIWZ, tmp, left);
-       }
-     }
--  } else {
-+  } else
-+#endif
-+  {
-     Reg dest = ra_dest(as, ir, RSET_GPR);
-     if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */
-       Reg left = ra_alloc1(as, ir->op1, RSET_GPR);
-@@ -496,17 +519,41 @@ static void asm_strto(ASMState *as, IRIn
- {
-   const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];
-   IRRef args[2];
--  int32_t ofs;
-+  int32_t ofs = SPOFS_TMP;
-+#if LJ_SOFTFP
-+  ra_evictset(as, RSET_SCRATCH);
-+  if (ra_used(ir)) {
-+    if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) &&
-+      (ir->s & 1) == LJ_BE && (ir->s ^ 1) == (ir+1)->s) {
-+      int i;
-+      for (i = 0; i < 2; i++) {
-+      Reg r = (ir+i)->r;
-+      if (ra_hasreg(r)) {
-+        ra_free(as, r);
-+        ra_modified(as, r);
-+        emit_spload(as, ir+i, r, sps_scale((ir+i)->s));
-+      }
-+      }
-+      ofs = sps_scale(ir->s & ~1);
-+    } else {
-+      Reg rhi = ra_dest(as, ir+1, RSET_GPR);
-+      Reg rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi));
-+      emit_tai(as, PPCI_LWZ, rhi, RID_SP, ofs);
-+      emit_tai(as, PPCI_LWZ, rlo, RID_SP, ofs+4);
-+    }
-+  }
-+#else
-   RegSet drop = RSET_SCRATCH;
-   if (ra_hasreg(ir->r)) rset_set(drop, ir->r);  /* Spill dest reg (if any). */
-   ra_evictset(as, drop);
-+  if (ir->s) ofs = sps_scale(ir->s);
-+#endif
-   asm_guardcc(as, CC_EQ);
-   emit_ai(as, PPCI_CMPWI, RID_RET, 0);  /* Test return status. */
-   args[0] = ir->op1;      /* GCstr *str */
-   args[1] = ASMREF_TMP1;  /* TValue *n  */
-   asm_gencall(as, ci, args);
-   /* Store the result to the spill slot or temp slots. */
--  ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
-   emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs);
- }
-@@ -530,7 +577,10 @@ static void asm_tvptr(ASMState *as, Reg
-       Reg src = ra_alloc1(as, ref, allow);
-       emit_setgl(as, src, tmptv.gcr);
-     }
--    type = ra_allock(as, irt_toitype(ir->t), allow);
-+    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
-+      type = ra_alloc1(as, ref+1, allow);
-+    else
-+      type = ra_allock(as, irt_toitype(ir->t), allow);
-     emit_setgl(as, type, tmptv.it);
-   }
- }
-@@ -574,11 +624,27 @@ static void asm_href(ASMState *as, IRIns
-   Reg tisnum = RID_NONE, tmpnum = RID_NONE;
-   IRRef refkey = ir->op2;
-   IRIns *irkey = IR(refkey);
-+  int isk = irref_isk(refkey);
-   IRType1 kt = irkey->t;
-   uint32_t khash;
-   MCLabel l_end, l_loop, l_next;
-   rset_clear(allow, tab);
-+#if LJ_SOFTFP
-+  if (!isk) {
-+    key = ra_alloc1(as, refkey, allow);
-+    rset_clear(allow, key);
-+    if (irkey[1].o == IR_HIOP) {
-+      if (ra_hasreg((irkey+1)->r)) {
-+      tmpnum = (irkey+1)->r;
-+      ra_noweak(as, tmpnum);
-+      } else {
-+      tmpnum = ra_allocref(as, refkey+1, allow);
-+      }
-+      rset_clear(allow, tmpnum);
-+    }
-+  }
-+#else
-   if (irt_isnum(kt)) {
-     key = ra_alloc1(as, refkey, RSET_FPR);
-     tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));
-@@ -588,6 +654,7 @@ static void asm_href(ASMState *as, IRIns
-     key = ra_alloc1(as, refkey, allow);
-     rset_clear(allow, key);
-   }
-+#endif
-   tmp2 = ra_scratch(as, allow);
-   rset_clear(allow, tmp2);
-@@ -610,7 +677,7 @@ static void asm_href(ASMState *as, IRIns
-     asm_guardcc(as, CC_EQ);
-   else
-     emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);
--  if (irt_isnum(kt)) {
-+  if (!LJ_SOFTFP && irt_isnum(kt)) {
-     emit_fab(as, PPCI_FCMPU, 0, tmpnum, key);
-     emit_condbranch(as, PPCI_BC, CC_GE, l_next);
-     emit_ab(as, PPCI_CMPLW, tmp1, tisnum);
-@@ -620,7 +687,10 @@ static void asm_href(ASMState *as, IRIns
-       emit_ab(as, PPCI_CMPW, tmp2, key);
-       emit_condbranch(as, PPCI_BC, CC_NE, l_next);
-     }
--    emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
-+    if (LJ_SOFTFP && ra_hasreg(tmpnum))
-+      emit_ab(as, PPCI_CMPW, tmp1, tmpnum);
-+    else
-+      emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
-     if (!irt_ispri(kt))
-       emit_tai(as, PPCI_LWZ, tmp2, dest, (int32_t)offsetof(Node, key.gcr));
-   }
-@@ -629,19 +699,19 @@ static void asm_href(ASMState *as, IRIns
-           (((char *)as->mcp-(char *)l_loop) & 0xffffu);
-   /* Load main position relative to tab->node into dest. */
--  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;
-+  khash = isk ? ir_khash(irkey) : 1;
-   if (khash == 0) {
-     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
-   } else {
-     Reg tmphash = tmp1;
--    if (irref_isk(refkey))
-+    if (isk)
-       tmphash = ra_allock(as, khash, allow);
-     emit_tab(as, PPCI_ADD, dest, dest, tmp1);
-     emit_tai(as, PPCI_MULLI, tmp1, tmp1, sizeof(Node));
-     emit_asb(as, PPCI_AND, tmp1, tmp2, tmphash);
-     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
-     emit_tai(as, PPCI_LWZ, tmp2, tab, (int32_t)offsetof(GCtab, hmask));
--    if (irref_isk(refkey)) {
-+    if (isk) {
-       /* Nothing to do. */
-     } else if (irt_isstr(kt)) {
-       emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, hash));
-@@ -651,13 +721,19 @@ static void asm_href(ASMState *as, IRIns
-       emit_asb(as, PPCI_XOR, tmp1, tmp1, tmp2);
-       emit_rotlwi(as, tmp1, tmp1, (HASH_ROT2+HASH_ROT1)&31);
-       emit_tab(as, PPCI_SUBF, tmp2, dest, tmp2);
--      if (irt_isnum(kt)) {
-+      if (LJ_SOFTFP ? (irkey[1].o == IR_HIOP) : irt_isnum(kt)) {
-+#if LJ_SOFTFP
-+      emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
-+      emit_rotlwi(as, dest, tmp1, HASH_ROT1);
-+      emit_tab(as, PPCI_ADD, tmp1, tmpnum, tmpnum);
-+#else
-       int32_t ofs = ra_spill(as, irkey);
-       emit_asb(as, PPCI_XOR, tmp2, tmp2, tmp1);
-       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
-       emit_tab(as, PPCI_ADD, tmp1, tmp1, tmp1);
-       emit_tai(as, PPCI_LWZ, tmp2, RID_SP, ofs+4);
-       emit_tai(as, PPCI_LWZ, tmp1, RID_SP, ofs);
-+#endif
-       } else {
-       emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
-       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
-@@ -784,8 +860,8 @@ static PPCIns asm_fxloadins(IRIns *ir)
-   case IRT_U8: return PPCI_LBZ;
-   case IRT_I16: return PPCI_LHA;
-   case IRT_U16: return PPCI_LHZ;
--  case IRT_NUM: return PPCI_LFD;
--  case IRT_FLOAT: return PPCI_LFS;
-+  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_LFD;
-+  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_LFS;
-   default: return PPCI_LWZ;
-   }
- }
-@@ -795,8 +871,8 @@ static PPCIns asm_fxstoreins(IRIns *ir)
-   switch (irt_type(ir->t)) {
-   case IRT_I8: case IRT_U8: return PPCI_STB;
-   case IRT_I16: case IRT_U16: return PPCI_STH;
--  case IRT_NUM: return PPCI_STFD;
--  case IRT_FLOAT: return PPCI_STFS;
-+  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_STFD;
-+  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_STFS;
-   default: return PPCI_STW;
-   }
- }
-@@ -839,7 +915,8 @@ static void asm_fstore(ASMState *as, IRI
- static void asm_xload(ASMState *as, IRIns *ir)
- {
--  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
-+  Reg dest = ra_dest(as, ir,
-+    (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
-   lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));
-   if (irt_isi8(ir->t))
-     emit_as(as, PPCI_EXTSB, dest, dest);
-@@ -857,7 +934,8 @@ static void asm_xstore_(ASMState *as, IR
-     Reg src = ra_alloc1(as, irb->op1, RSET_GPR);
-     asm_fusexrefx(as, PPCI_STWBRX, src, ir->op1, rset_exclude(RSET_GPR, src));
-   } else {
--    Reg src = ra_alloc1(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
-+    Reg src = ra_alloc1(as, ir->op2,
-+      (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
-     asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,
-                rset_exclude(RSET_GPR, src), ofs);
-   }
-@@ -871,10 +949,19 @@ static void asm_ahuvload(ASMState *as, I
-   Reg dest = RID_NONE, type = RID_TMP, tmp = RID_TMP, idx;
-   RegSet allow = RSET_GPR;
-   int32_t ofs = AHUREF_LSX;
-+  if (LJ_SOFTFP && (ir+1)->o == IR_HIOP) {
-+    t.irt = IRT_NUM;
-+    if (ra_used(ir+1)) {
-+      type = ra_dest(as, ir+1, allow);
-+      rset_clear(allow, type);
-+    }
-+    ofs = 0;
-+  }
-   if (ra_used(ir)) {
--    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
--    if (!irt_isnum(t)) ofs = 0;
--    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
-+    lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) ||
-+             irt_isint(ir->t) || irt_isaddr(ir->t));
-+    if (LJ_SOFTFP || !irt_isnum(t)) ofs = 0;
-+    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
-     rset_clear(allow, dest);
-   }
-   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
-@@ -883,12 +970,13 @@ static void asm_ahuvload(ASMState *as, I
-     asm_guardcc(as, CC_GE);
-     emit_ab(as, PPCI_CMPLW, type, tisnum);
-     if (ra_hasreg(dest)) {
--      if (ofs == AHUREF_LSX) {
-+      if (!LJ_SOFTFP && ofs == AHUREF_LSX) {
-       tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR,
-                                                      (idx&255)), (idx>>8)));
-       emit_fab(as, PPCI_LFDX, dest, (idx&255), tmp);
-       } else {
--      emit_fai(as, PPCI_LFD, dest, idx, ofs);
-+      emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest, idx,
-+               ofs+4*LJ_SOFTFP);
-       }
-     }
-   } else {
-@@ -911,7 +999,7 @@ static void asm_ahustore(ASMState *as, I
-   int32_t ofs = AHUREF_LSX;
-   if (ir->r == RID_SINK)
-     return;
--  if (irt_isnum(ir->t)) {
-+  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
-     src = ra_alloc1(as, ir->op2, RSET_FPR);
-   } else {
-     if (!irt_ispri(ir->t)) {
-@@ -919,11 +1007,14 @@ static void asm_ahustore(ASMState *as, I
-       rset_clear(allow, src);
-       ofs = 0;
-     }
--    type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
-+    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
-+      type = ra_alloc1(as, (ir+1)->op2, allow);
-+    else
-+      type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
-     rset_clear(allow, type);
-   }
-   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
--  if (irt_isnum(ir->t)) {
-+  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
-     if (ofs == AHUREF_LSX) {
-       emit_fab(as, PPCI_STFDX, src, (idx&255), RID_TMP);
-       emit_slwi(as, RID_TMP, (idx>>8), 3);
-@@ -948,21 +1039,33 @@ static void asm_sload(ASMState *as, IRIn
-   IRType1 t = ir->t;
-   Reg dest = RID_NONE, type = RID_NONE, base;
-   RegSet allow = RSET_GPR;
-+  int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);
-+  if (hiop)
-+    t.irt = IRT_NUM;
-   lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */
--  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));
-+  lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK));
-   lua_assert(LJ_DUALNUM ||
-            !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));
-+#if LJ_SOFTFP
-+  lua_assert(!(ir->op2 & IRSLOAD_CONVERT));  /* Handled by LJ_SOFTFP SPLIT. */
-+  if (hiop && ra_used(ir+1)) {
-+    type = ra_dest(as, ir+1, allow);
-+    rset_clear(allow, type);
-+  }
-+#else
-   if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {
-     dest = ra_scratch(as, RSET_FPR);
-     asm_tointg(as, ir, dest);
-     t.irt = IRT_NUM;  /* Continue with a regular number type check. */
--  } else if (ra_used(ir)) {
-+  } else
-+#endif
-+  if (ra_used(ir)) {
-     lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
--    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
-+    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
-     rset_clear(allow, dest);
-     base = ra_alloc1(as, REF_BASE, allow);
-     rset_clear(allow, base);
--    if ((ir->op2 & IRSLOAD_CONVERT)) {
-+    if (!LJ_SOFTFP && (ir->op2 & IRSLOAD_CONVERT)) {
-       if (irt_isint(t)) {
-       emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);
-       dest = ra_scratch(as, RSET_FPR);
-@@ -994,10 +1097,13 @@ dotypecheck:
-     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
-       Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow);
-       asm_guardcc(as, CC_GE);
--      emit_ab(as, PPCI_CMPLW, RID_TMP, tisnum);
-+#if !LJ_SOFTFP
-       type = RID_TMP;
-+#endif
-+      emit_ab(as, PPCI_CMPLW, type, tisnum);
-     }
--    if (ra_hasreg(dest)) emit_fai(as, PPCI_LFD, dest, base, ofs-4);
-+    if (ra_hasreg(dest)) emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest,
-+                                base, ofs-(LJ_SOFTFP?0:4));
-   } else {
-     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
-       asm_guardcc(as, CC_NE);
-@@ -1119,6 +1225,7 @@ static void asm_obar(ASMState *as, IRIns
- /* -- Arithmetic and logic operations ------------------------------------- */
-+#if !LJ_SOFTFP
- static void asm_fparith(ASMState *as, IRIns *ir, PPCIns pi)
- {
-   Reg dest = ra_dest(as, ir, RSET_FPR);
-@@ -1146,13 +1253,17 @@ static void asm_fpmath(ASMState *as, IRI
-   else
-     asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
- }
-+#endif
- static void asm_add(ASMState *as, IRIns *ir)
- {
-+#if !LJ_SOFTFP
-   if (irt_isnum(ir->t)) {
-     if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD))
-       asm_fparith(as, ir, PPCI_FADD);
--  } else {
-+  } else
-+#endif
-+  {
-     Reg dest = ra_dest(as, ir, RSET_GPR);
-     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
-     PPCIns pi;
-@@ -1191,10 +1302,13 @@ static void asm_add(ASMState *as, IRIns
- static void asm_sub(ASMState *as, IRIns *ir)
- {
-+#if !LJ_SOFTFP
-   if (irt_isnum(ir->t)) {
-     if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB))
-       asm_fparith(as, ir, PPCI_FSUB);
--  } else {
-+  } else
-+#endif
-+  {
-     PPCIns pi = PPCI_SUBF;
-     Reg dest = ra_dest(as, ir, RSET_GPR);
-     Reg left, right;
-@@ -1220,9 +1334,12 @@ static void asm_sub(ASMState *as, IRIns
- static void asm_mul(ASMState *as, IRIns *ir)
- {
-+#if !LJ_SOFTFP
-   if (irt_isnum(ir->t)) {
-     asm_fparith(as, ir, PPCI_FMUL);
--  } else {
-+  } else
-+#endif
-+  {
-     PPCIns pi = PPCI_MULLW;
-     Reg dest = ra_dest(as, ir, RSET_GPR);
-     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
-@@ -1250,9 +1367,12 @@ static void asm_mul(ASMState *as, IRIns
- static void asm_neg(ASMState *as, IRIns *ir)
- {
-+#if !LJ_SOFTFP
-   if (irt_isnum(ir->t)) {
-     asm_fpunary(as, ir, PPCI_FNEG);
--  } else {
-+  } else
-+#endif
-+  {
-     Reg dest, left;
-     PPCIns pi = PPCI_NEG;
-     if (as->flagmcp == as->mcp) {
-@@ -1563,9 +1683,40 @@ static void asm_bitshift(ASMState *as, I
-                      PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31))
- #define asm_bror(as, ir)      lua_assert(0)
-+#if LJ_SOFTFP
-+static void asm_sfpmin_max(ASMState *as, IRIns *ir)
-+{
-+  CCallInfo ci = lj_ir_callinfo[IRCALL_softfp_cmp];
-+  IRRef args[4];
-+  MCLabel l_right, l_end;
-+  Reg desthi = ra_dest(as, ir, RSET_GPR), destlo = ra_dest(as, ir+1, RSET_GPR);
-+  Reg righthi, lefthi = ra_alloc2(as, ir, RSET_GPR);
-+  Reg rightlo, leftlo = ra_alloc2(as, ir+1, RSET_GPR);
-+  PPCCC cond = (IROp)ir->o == IR_MIN ? CC_EQ : CC_NE;
-+  righthi = (lefthi >> 8); lefthi &= 255;
-+  rightlo = (leftlo >> 8); leftlo &= 255;
-+  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
-+  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
-+  l_end = emit_label(as);
-+  if (desthi != righthi) emit_mr(as, desthi, righthi);
-+  if (destlo != rightlo) emit_mr(as, destlo, rightlo);
-+  l_right = emit_label(as);
-+  if (l_end != l_right) emit_jmp(as, l_end);
-+  if (desthi != lefthi) emit_mr(as, desthi, lefthi);
-+  if (destlo != leftlo) emit_mr(as, destlo, leftlo);
-+  if (l_right == as->mcp+1) {
-+    cond ^= 4; l_right = l_end; ++as->mcp;
-+  }
-+  emit_condbranch(as, PPCI_BC, cond, l_right);
-+  ra_evictset(as, RSET_SCRATCH);
-+  emit_cmpi(as, RID_RET, 1);
-+  asm_gencall(as, &ci, args);
-+}
-+#endif
-+
- static void asm_min_max(ASMState *as, IRIns *ir, int ismax)
- {
--  if (irt_isnum(ir->t)) {
-+  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
-     Reg dest = ra_dest(as, ir, RSET_FPR);
-     Reg tmp = dest;
-     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
-@@ -1653,7 +1804,7 @@ static void asm_intcomp_(ASMState *as, I
- static void asm_comp(ASMState *as, IRIns *ir)
- {
-   PPCCC cc = asm_compmap[ir->o];
--  if (irt_isnum(ir->t)) {
-+  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
-     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
-     right = (left >> 8); left &= 255;
-     asm_guardcc(as, (cc >> 4));
-@@ -1674,6 +1825,44 @@ static void asm_comp(ASMState *as, IRIns
- #define asm_equal(as, ir)     asm_comp(as, ir)
-+#if LJ_SOFTFP
-+/* SFP comparisons. */
-+static void asm_sfpcomp(ASMState *as, IRIns *ir)
-+{
-+  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp];
-+  RegSet drop = RSET_SCRATCH;
-+  Reg r;
-+  IRRef args[4];
-+  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
-+  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
-+
-+  for (r = REGARG_FIRSTGPR; r <= REGARG_FIRSTGPR+3; r++) {
-+    if (!rset_test(as->freeset, r) &&
-+      regcost_ref(as->cost[r]) == args[r-REGARG_FIRSTGPR])
-+      rset_clear(drop, r);
-+  }
-+  ra_evictset(as, drop);
-+  asm_setupresult(as, ir, ci);
-+  switch ((IROp)ir->o) {
-+  case IR_ULT:
-+    asm_guardcc(as, CC_EQ);
-+    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
-+  case IR_ULE:
-+    asm_guardcc(as, CC_EQ);
-+    emit_ai(as, PPCI_CMPWI, RID_RET, 1);
-+    break;
-+  case IR_GE: case IR_GT:
-+    asm_guardcc(as, CC_EQ);
-+    emit_ai(as, PPCI_CMPWI, RID_RET, 2);
-+  default:
-+    asm_guardcc(as, (asm_compmap[ir->o] & 0xf));
-+    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
-+    break;
-+  }
-+  asm_gencall(as, ci, args);
-+}
-+#endif
-+
- #if LJ_HASFFI
- /* 64 bit integer comparisons. */
- static void asm_comp64(ASMState *as, IRIns *ir)
-@@ -1703,19 +1892,36 @@ static void asm_comp64(ASMState *as, IRI
- /* Hiword op of a split 64 bit op. Previous op must be the loword op. */
- static void asm_hiop(ASMState *as, IRIns *ir)
- {
--#if LJ_HASFFI
-+#if LJ_HASFFI || LJ_SOFTFP
-   /* HIOP is marked as a store because it needs its own DCE logic. */
-   int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */
-   if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;
-   if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */
-     as->curins--;  /* Always skip the CONV. */
-+#if LJ_HASFFI && !LJ_SOFTFP
-     if (usehi || uselo)
-       asm_conv64(as, ir);
-     return;
-+#endif
-   } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */
-     as->curins--;  /* Always skip the loword comparison. */
-+#if LJ_SOFTFP
-+    if (!irt_isint(ir->t)) {
-+      asm_sfpcomp(as, ir-1);
-+      return;
-+    }
-+#endif
-+#if LJ_HASFFI
-     asm_comp64(as, ir);
-+#endif
-+    return;
-+#if LJ_SOFTFP
-+  } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) {
-+      as->curins--;  /* Always skip the loword min/max. */
-+    if (uselo || usehi)
-+      asm_sfpmin_max(as, ir-1);
-     return;
-+#endif
-   } else if ((ir-1)->o == IR_XSTORE) {
-     as->curins--;  /* Handle both stores here. */
-     if ((ir-1)->r != RID_SINK) {
-@@ -1726,14 +1932,27 @@ static void asm_hiop(ASMState *as, IRIns
-   }
-   if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */
-   switch ((ir-1)->o) {
-+#if LJ_HASFFI
-   case IR_ADD: as->curins--; asm_add64(as, ir); break;
-   case IR_SUB: as->curins--; asm_sub64(as, ir); break;
-   case IR_NEG: as->curins--; asm_neg64(as, ir); break;
-+#endif
-+#if LJ_SOFTFP
-+  case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:
-+  case IR_STRTO:
-+    if (!uselo)
-+      ra_allocref(as, ir->op1, RSET_GPR);  /* Mark lo op as used. */
-+    break;
-+#endif
-   case IR_CALLN:
-+  case IR_CALLS:
-   case IR_CALLXS:
-     if (!uselo)
-       ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */
-     break;
-+#if LJ_SOFTFP
-+  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR:
-+#endif
-   case IR_CNEWI:
-     /* Nothing to do here. Handled by lo op itself. */
-     break;
-@@ -1797,8 +2016,19 @@ static void asm_stack_restore(ASMState *
-     if ((sn & SNAP_NORESTORE))
-       continue;
-     if (irt_isnum(ir->t)) {
-+#if LJ_SOFTFP
-+      Reg tmp;
-+      RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
-+      lua_assert(irref_isk(ref));  /* LJ_SOFTFP: must be a number constant. */
-+      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, allow);
-+      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?4:0));
-+      if (rset_test(as->freeset, tmp+1)) allow = RID2RSET(tmp+1);
-+      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, allow);
-+      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?0:4));
-+#else
-       Reg src = ra_alloc1(as, ref, RSET_FPR);
-       emit_fai(as, PPCI_STFD, src, RID_BASE, ofs);
-+#endif
-     } else {
-       Reg type;
-       RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
-@@ -1811,6 +2041,10 @@ static void asm_stack_restore(ASMState *
-       if ((sn & (SNAP_CONT|SNAP_FRAME))) {
-       if (s == 0) continue;  /* Do not overwrite link to previous frame. */
-       type = ra_allock(as, (int32_t)(*flinks--), allow);
-+#if LJ_SOFTFP
-+      } else if ((sn & SNAP_SOFTFPNUM)) {
-+      type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPR, RID_BASE));
-+#endif
-       } else {
-       type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
-       }
-@@ -1947,14 +2181,15 @@ static Reg asm_setup_call_slots(ASMState
-   int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;
-   asm_collectargs(as, ir, ci, args);
-   for (i = 0; i < nargs; i++)
--    if (args[i] && irt_isfp(IR(args[i])->t)) {
-+    if (!LJ_SOFTFP && args[i] && irt_isfp(IR(args[i])->t)) {
-       if (nfpr > 0) nfpr--; else nslots = (nslots+3) & ~1;
-     } else {
-       if (ngpr > 0) ngpr--; else nslots++;
-     }
-   if (nslots > as->evenspill)  /* Leave room for args in stack slots. */
-     as->evenspill = nslots;
--  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);
-+  return (!LJ_SOFTFP && irt_isfp(ir->t)) ? REGSP_HINT(RID_FPRET) :
-+                                         REGSP_HINT(RID_RET);
- }
- static void asm_setup_target(ASMState *as)
diff --git a/lang/luajit/patches/060-ppc-musl.patch b/lang/luajit/patches/060-ppc-musl.patch
deleted file mode 100644 (file)
index 119fedd..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-From 195e0be62c0aa0f6aaf63a93ee322bb0a630576c Mon Sep 17 00:00:00 2001
-From: Clint Bland <[email protected]>
-Date: Wed, 13 Mar 2019 19:19:16 -0700
-Subject: [PATCH] Have powerpc use fake GOT like MIPS
-
----
- src/lj_dispatch.c | 15 +++++++++++++++
- src/lj_dispatch.h | 29 ++++++++++++++++++++++++++++-
- src/vm_ppc.dasc   |  9 ++++++++-
- 3 files changed, 51 insertions(+), 2 deletions(-)
-
---- a/src/lj_dispatch.c
-+++ b/src/lj_dispatch.c
-@@ -56,6 +56,18 @@ static const ASMFunction dispatch_got[]
- #undef GOTFUNC
- #endif
-+#if LJ_TARGET_PPC
-+#include <math.h>
-+LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,
-+                                                        lua_State *co);
-+
-+#define GOTFUNC(name) (ASMFunction)name,
-+static const ASMFunction dispatch_got[] = {
-+  GOTDEF(GOTFUNC)
-+};
-+#undef GOTFUNC
-+#endif
-+
- /* Initialize instruction dispatch table and hot counters. */
- void lj_dispatch_init(GG_State *GG)
- {
-@@ -77,6 +89,9 @@ void lj_dispatch_init(GG_State *GG)
- #if LJ_TARGET_MIPS
-   memcpy(GG->got, dispatch_got, LJ_GOT__MAX*sizeof(ASMFunction *));
- #endif
-+#if LJ_TARGET_PPC
-+  memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);
-+#endif
- }
- #if LJ_HASJIT
---- a/src/lj_dispatch.h
-+++ b/src/lj_dispatch.h
-@@ -66,6 +66,33 @@ GOTDEF(GOTENUM)
- };
- #endif
-+#if LJ_TARGET_PPC
-+/* Need our own global offset table for the dreaded MIPS calling conventions. */
-+#if LJ_SOFTFP
-+#ifndef _LJ_IRCALL_H
-+extern double __ledf2(double a, double b);
-+extern double __adddf3(double a, double b);
-+extern double __subdf3(double a, double b);
-+extern double __muldf3(double a, double b);
-+extern double __divdf3(double a, double b);
-+#endif
-+#define SFGOTDEF(_)   _(__ledf2) _(__adddf3) _(__subdf3) _(__muldf3) _(__divdf3)
-+#else
-+#define SFGOTDEF(_)
-+#endif
-+#define GOTDEF(_) \
-+  _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \
-+  _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \
-+  _(pow) _(fmod) _(ldexp) _(sqrt) SFGOTDEF(_)
-+
-+enum {
-+#define GOTENUM(name) LJ_GOT_##name,
-+GOTDEF(GOTENUM)
-+#undef GOTENUM
-+  LJ_GOT__MAX
-+};
-+#endif
-+
- /* Type of hot counter. Must match the code in the assembler VM. */
- /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */
- typedef uint16_t HotCount;
-@@ -89,7 +116,7 @@ typedef uint16_t HotCount;
- typedef struct GG_State {
-   lua_State L;                                /* Main thread. */
-   global_State g;                     /* Global state. */
--#if LJ_TARGET_MIPS
-+#if LJ_TARGET_MIPS || LJ_TARGET_PPC
-   ASMFunction got[LJ_GOT__MAX];               /* Global offset table. */
- #endif
- #if LJ_HASJIT
---- a/src/vm_ppc.dasc
-+++ b/src/vm_ppc.dasc
-@@ -59,7 +59,12 @@
- |.define ENV_OFS,     8
- |.endif
- |.else  // No TOC.
--|.macro blex, target; bl extern target@plt; .endmacro
-+|.macro blex, target
-+|  lwz TMP0, DISPATCH_GOT(target)(DISPATCH)
-+|  mtctr TMP0
-+|  bctrl
-+|  //bl extern target@plt
-+|.endmacro
- |.macro .toc, a, b; .endmacro
- |.endif
- |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro
-@@ -482,6 +487,8 @@
- |// Assumes DISPATCH is relative to GL.
- #define DISPATCH_GL(field)    (GG_DISP2G + (int)offsetof(global_State, field))
- #define DISPATCH_J(field)     (GG_DISP2J + (int)offsetof(jit_State, field))
-+#define GG_DISP2GOT           (GG_OFS(got) - GG_OFS(dispatch))
-+#define DISPATCH_GOT(name)    (GG_DISP2GOT + 4*LJ_GOT_##name)
- |
- #define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))
- |
diff --git a/lang/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch b/lang/luajit/patches/300-PPC-e500-with-SPE-enabled-use-soft-float.patch
deleted file mode 100644 (file)
index e63c5dd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 2c8b9d5807a515a0ff859899065f512beabcbaed Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C5=A0imon=20Bo=C5=99ek?= <[email protected]>
-Date: Sat, 16 Jul 2022 18:39:55 +0200
-Subject: [PATCH] PPC/e500 with SPE enabled: use soft float instead of failing
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows building LuaJit for systems with Power ISA SPE
-extension[^1] support by using soft float on LuaJit side.
-
-While e500 CPU cores support SPE instruction set extension
-allowing them to perform floating point arithmetic natively,
-this isn't required. They can function with software floating
-point to integer arithmetic translation as well,
-just like FPU-less PowerPC CPUs without SPE support.
-
-Therefore I see no need to prevent them from running LuaJit
-explicitly.
-
-[^1]: https://www.nxp.com/docs/en/reference-manual/SPEPEM.pdf
-
-Signed-off-by: Pali Rohár <[email protected]>
-Signed-off-by: Å imon BoÅ™ek <[email protected]>
----
- src/lj_arch.h | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/src/lj_arch.h
-+++ b/src/lj_arch.h
-@@ -256,7 +256,7 @@
- #define LJ_ARCH_NAME          "ppc"
- #if !defined(LJ_ARCH_HASFPU)
--#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
-+#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
- #define LJ_ARCH_HASFPU                0
- #else
- #define LJ_ARCH_HASFPU                1
-@@ -264,7 +264,7 @@
- #endif
- #if !defined(LJ_ABI_SOFTFP)
--#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
-+#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) || defined(__NO_FPRS__)
- #define LJ_ABI_SOFTFP         1
- #else
- #define LJ_ABI_SOFTFP         0
-@@ -442,9 +442,6 @@
- #if LJ_ARCH_PPC64
- #error "No support for PowerPC 64 bit mode (yet)"
- #endif
--#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
--#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
--#endif
- #elif LJ_TARGET_MIPS32
- #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32))
- #error "Only o32 ABI supported for MIPS32"
diff --git a/lang/luajit2/Makefile b/lang/luajit2/Makefile
deleted file mode 100644 (file)
index 5e74097..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luajit2
-PKG_SOURCE_DATE:=2025-10-30
-PKG_VERSION:=2.1.$(subst -,.,$(PKG_SOURCE_DATE))
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/openresty/luajit2
-PKG_MIRROR_HASH:=7b986a40ef091df5168eaa8b2012d3a95110fafeb69a7c199e3fca9795bae631
-PKG_SOURCE_VERSION:=71fae383f6c4637d64b03a6d0ec76ae8c19d6821
-
-PKG_MAINTAINER:=Javier Marcet <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYRIGHT
-
-PKG_BUILD_FLAGS:=no-mips16
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/host-build.mk
-
-# HAS_LUAJIT_ARCH config is defined in luajit and is used to define
-# arch deoendency for luajit. Since luajit2 is an improved version of
-# luajit, they share the same arch dependency. Refer there to update
-# dependency for them.
-define Package/luajit2
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Lua
- TITLE:=LuaJIT from OpenResty
- URL:=https://www.luajit.org
- DEPENDS:=@HAS_LUAJIT_ARCH
- PROVIDES:=luajit
-endef
-
-define Package/luajit2/description
- OpenResty's maintained branch of LuaJIT, a Just-In-Time (JIT) compiler for the Lua programming language
-endef
-
-ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
-  ifeq ($(CONFIG_ARCH_64BIT),)
-    HOST_BITS := -m32
-  endif
-endif
-
-define Build/Compile
-       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-               HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
-               CROSS="$(TARGET_CROSS)" \
-               DESTDIR=$(PKG_INSTALL_DIR) \
-               PREFIX=/usr \
-               TARGET_SYS=Linux \
-               TARGET_CFLAGS="$(TARGET_CFLAGS)" \
-               BUILDMODE=dynamic
-       $(RM) -rf $(PKG_INSTALL_DIR)
-       mkdir -p $(PKG_INSTALL_DIR)
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR=$(PKG_INSTALL_DIR) \
-               PREFIX=/usr \
-               TARGET_SYS=Linux \
-               install
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
-endef
-
-define Package/luajit2/install
-       $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
-endef
-
-define Host/Compile
-       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               DPREFIX=$(STAGING_DIR_HOSTPKG) \
-               TARGET_CFLAGS="$(HOST_CFLAGS)" \
-               TARGET_LDFLAGS="$(HOST_LDFLAGS)"
-endef
-
-define Host/Install
-       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               DPREFIX=$(STAGING_DIR_HOSTPKG) \
-               install
-       $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-* $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
-endef
-
-$(eval $(call HostBuild,luajit2))
-$(eval $(call BuildPackage,luajit2))
diff --git a/lang/luajit2/patches/010-lua-path.patch b/lang/luajit2/patches/010-lua-path.patch
deleted file mode 100644 (file)
index f9658dc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/luaconf.h
-+++ b/src/luaconf.h
-@@ -34,8 +34,8 @@
- #ifndef LUA_LMULTILIB
- #define LUA_LMULTILIB "lib"
- #endif
--#define LUA_LROOT     "/usr/local"
--#define LUA_LUADIR    "/lua/5.1/"
-+#define LUA_LROOT     "/usr"
-+#define LUA_LUADIR    "/lua/"
- #ifdef LUA_ROOT
- #define LUA_JROOT     LUA_ROOT
diff --git a/lang/lualanes/Makefile b/lang/lualanes/Makefile
deleted file mode 100644 (file)
index 764b8dd..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Copyright (C) 2007-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lualanes
-PKG_VERSION:=3.16.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/LuaLanes/lanes/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=22cfa836de4be14fe588b9cd34e936d6f61ec6f4096d8ae30d4ec35855d9608f
-PKG_BUILD_DIR:=$(BUILD_DIR)/lanes-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Vladimir Malyutin <[email protected]>
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=COPYRIGHT
-
-PKG_BUILD_DEPENDS:=lua/host
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lualanes
-       SUBMENU:=Lua
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=LuaLanes
-       URL:=http://lualanes.github.io/lanes/
-       DEPENDS:=+lua +luac +liblua +libpthread
-endef
-
-define Package/lualanes/description
-Lua Lanes is a Lua extension library providing the possibility to run
-multiple Lua states in parallel. It is intended to be used for optimizing
-performance on multicore CPU's and to study ways to make Lua programs
-naturally parallel to begin with.
-
-Lanes is included into your software by the regular require "lanes" method.
-No C side programming is needed; all APIs are Lua side, and most existing
-extension modules should work seamlessly together with the multiple lanes.
-
-Lanes supports Lua 5.1, 5.2 and 5.3
-endef
-
-define Package/lualanes/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/lua/lmod/lanes.lua $(1)/usr/lib/lua/
-       $(INSTALL_DIR) $(1)/usr/lib/lua/lanes
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/lua/cmod/core.so $(1)/usr/lib/lua/lanes/core.so
-endef
-
-$(eval $(call BuildPackage,lualanes))
diff --git a/lang/luaossl/Makefile b/lang/luaossl/Makefile
deleted file mode 100644 (file)
index 8223033..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-# Copyright (C) 2021 Siger Yang <[email protected]>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luaossl
-PKG_VERSION:=20220711
-PKG_RELEASE:=2
-PKG_MAINTAINER:=Siger Yang <[email protected]>
-
-PKG_MIRROR_HASH:=7abb1070da36906f9ef310af1a12827543bb5de4bbe239068420fd8b3e3858d2
-PKG_SOURCE_URL:=https://github.com/wahern/luaossl.git
-PKG_SOURCE_VERSION:=rel-$(PKG_VERSION)
-PKG_SOURCE_PROTO:=git
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luaossl/default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Comprehensive binding to OpenSSL for $(1)
-  URL:=http://25thandclement.com/~william/projects/luaossl.html
-  DEPENDS:=+libopenssl
-endef
-
-define Package/luaossl/default/description
- luaossl is a comprehensive binding to OpenSSL for Lua 5.1, 5.2, and
- later. It includes support for certificate and key management, key
- generation, signature verification, and deep bindings to the
- distinguished name, alternative name, and X.509v3 extension interfaces. 
-endef
-
-TARGET_CFLAGS += $(FPIC)
-TARGET_LDFLAGS += $(FPIC)
-
-define Package/luaossl
-  $(call Package/luaossl/default,lua5.1)
-  DEPENDS+=+liblua
-  VARIANT:=lua51
-endef
-define Package/luaossl-lua5.3
-  $(call Package/luaossl/default,lua5.3)
-  DEPENDS+=+liblua5.3
-  VARIANT:=lua53
-endef
-define Package/luaossl-lua5.4
-  $(call Package/luaossl/default,lua5.4)
-  DEPENDS+=+liblua5.4
-  VARIANT:=lua54
-endef
-
-Package/luaossl/description = $(Package/luaossl/default/description)
-Package/luaossl-lua5.3/description = $(Package/luaossl/default/description)
-Package/luaossl-lua5.4/description = $(Package/luaossl/default/description)
-
-ifeq ($(BUILD_VARIANT),lua51)
-  MAKE_FLAGS += \
-       LUA_APIS="5.1" \
-       LUA51_CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
-       lua51cpath="/usr/lib/lua" \
-       lua51path="/usr/lib/lua"
-endif
-ifeq ($(BUILD_VARIANT),lua53)
-  MAKE_FLAGS += \
-       LUA_APIS="5.3" \
-       LUA53_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.3" \
-       lua53cpath="/usr/local/lib/lua/5.3" \
-       lua53path="/usr/local/lib/lua/5.3"
-endif
-ifeq ($(BUILD_VARIANT),lua54)
-  MAKE_FLAGS += \
-       LUA_APIS="5.4" \
-       LUA54_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.4" \
-       lua54cpath="/usr/local/lib/lua/5.4" \
-       lua54path="/usr/local/lib/lua/5.4"
-endif
-
-define Package/luaossl/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/_openssl.so $(1)/usr/lib/lua/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/openssl.lua $(1)/usr/lib/lua/
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/openssl $(1)/usr/lib/lua/
-endef
-define Package/luaossl-lua5.3/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/_openssl.so $(1)/usr/local/lib/lua/5.3/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/openssl.lua $(1)/usr/local/lib/lua/5.3/
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.3/openssl $(1)/usr/local/lib/lua/5.3/
-endef
-define Package/luaossl-lua5.4/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.4
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/_openssl.so $(1)/usr/local/lib/lua/5.4/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/openssl.lua $(1)/usr/local/lib/lua/5.4/
-
-       $(CP) $(PKG_INSTALL_DIR)/usr/local/lib/lua/5.4/openssl $(1)/usr/local/lib/lua/5.4/
-endef
-
-$(eval $(call BuildPackage,luaossl))
-$(eval $(call BuildPackage,luaossl-lua5.3))
-$(eval $(call BuildPackage,luaossl-lua5.4))
diff --git a/lang/luaossl/patches/900_fix_build_on_macos.patch b/lang/luaossl/patches/900_fix_build_on_macos.patch
deleted file mode 100644 (file)
index 5ceb99b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-commit 8686cae32fc04045c1404c2febf84242c298bf0d
-Author: Sergey V. Lobanov <[email protected]>
-Date:   Fri Jan 7 23:00:03 2022 +0300
-
-    fix build on macos
-    
-    OpenWrt is always Linux. Disable OS detection
-
---- a/mk/vendor.os
-+++ b/mk/vendor.os
-@@ -1,3 +1,3 @@
- #!/bin/sh
--uname -s
-+echo Linux
diff --git a/lang/luaposix/Makefile b/lang/luaposix/Makefile
deleted file mode 100644 (file)
index c49d205..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luaposix
-PKG_VERSION:=36.3
-PKG_RELEASE:=2
-
-PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=82cd9a96c41a4a3205c050206f0564ff4456f773a8f9ffc9235ff8f1907ca5e6
-PKG_MAINTAINER:=Maxim Storchak <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYING
-
-PKG_BUILD_DEPENDS:=luarocks/host
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luaposix
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=POSIX binding for LuaJIT, Lua 5.1, 5.2 and 5.3
-  URL:=https://github.com/luaposix/luaposix
-  DEPENDS:= +USE_GLIBC:libcrypt-compat +lua +lua-bit32
-endef
-
-define Package/luaposix/description
-  luaposix is a general POSIX library for Lua providing access
-  to various low level libc functions.
-endef
-
-TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
-
-TARGET_CFLAGS += \
-       -I$(STAGING_DIR)/usr/include
-
-define Build/Compile
-  cd $(PKG_BUILD_DIR) && \
-       LDFLAGS="$(TARGET_LDFLAGS) $(FPIC)" \
-       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
-    LUA_PKGNAME=lua5.1 \
-    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-    luarocks make --force --deps-mode=none --pack-binary-rock luaposix-$(PKG_VERSION)-1.rockspec \
-    LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-    LUA_PKGNAME=lua5.1 \
-    CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
-       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-       LDFLAGS="$(TARGET_LDFLAGS)"
-endef
-
-define Package/luaposix/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/posix/sys
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/*.so $(1)/usr/lib/lua/posix/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/sys/*.so $(1)/usr/lib/lua/posix/sys/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix/*.lua $(1)/usr/lib/lua/posix/
-       rm -f $(1)/usr/lib/lua/posix/{deprecated,compat}.lua
-endef
-
-$(eval $(call BuildPackage,luaposix))
diff --git a/lang/luaposix/patches/102-disable-compat-deprecated.patch b/lang/luaposix/patches/102-disable-compat-deprecated.patch
deleted file mode 100644 (file)
index efaa37b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/lib/posix/init.lua
-+++ b/lib/posix/init.lua
-@@ -437,14 +437,6 @@ do
-       end
-    end
--   -- Inject deprecated APIs (overwriting submodules) for backwards compatibility.
--   for k, v in next, (require 'posix.deprecated') do
--      rawset(M, k, v)
--   end
--   for k, v in next, (require 'posix.compat') do
--      rawset(M, k, v)
--   end
--
-    --- Metamethods
-    -- @section metamethods
diff --git a/lang/luaposix/scripts/uname b/lang/luaposix/scripts/uname
deleted file mode 100755 (executable)
index 787b647..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-echo Linux
diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile
deleted file mode 100644 (file)
index e6d6797..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luarocks
-PKG_VERSION:=2.2.2
-PKG_RELEASE:=4
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks
-PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-PKG_MIRROR_HASH:=9b2f880e0ff57a0d7e3a9d8d5365c73e6f546891bc39d2c6ef4c3443a8ca4b45
-
-PKG_MAINTAINER:=Amr Hassan <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYING
-
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=lua/host
-HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
-HOST_BUILD_PARALLEL:=1
-
-HOST_BUILD_PREFIX:=$(STAGING_DIR)/host
-HOST_BUILD_DIR:=$(BUILD_DIR)/host/$(PKG_NAME)-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luarocks
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=luarocks
-  URL:=https://github.com/keplerproject/luarocks
-  DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
-endef
-
-define Package/luarocks/description
-       LuaRocks is a deployment and management system for Lua modules.
-endef
-
-# My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
-CONFIGURE_ARGS = \
-    --prefix=$(CONFIGURE_PREFIX) \
-    --sysconfdir=/etc \
-    --with-lua=$(STAGING_DIR_HOSTPKG)
-
-HOST_CONFIGURE_ARGS= \
-    --prefix=$(STAGING_DIR)/host \
-    --sysconfdir=$(STAGING_DIR)/host/etc \
-    --with-lua=$(STAGING_DIR_HOSTPKG)
-
-CONFIGURE_VARS = \
-       LUAROCKS_UNAME_S="Linux" \
-       LUAROCKS_UNAME_M="$(ARCH)"
-
-HOST_CONFIGURE_VARS = \
-       LUAROCKS_UNAME_S="Linux" \
-       LUAROCKS_UNAME_M="$(ARCH)"
-
-define Build/Compile
-       $(call Build/Compile/Default,build)
-endef
-
-define Host/Compile
-  $(call Host/Compile/Default,build)
-endef
-
-define Package/luarocks/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
-       $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
-       $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
-endef
-
-define Host/Install
-  $(MAKE) -C $(HOST_BUILD_DIR) install
-endef
-
-$(eval $(call BuildPackage,luarocks))
-
-$(eval $(call HostBuild))
diff --git a/lang/luarocks/patches/01_dont_modify_bin_shebang.diff b/lang/luarocks/patches/01_dont_modify_bin_shebang.diff
deleted file mode 100644 (file)
index ab48a96..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -89,7 +89,7 @@ build_bins: cleanup_bins
-       for f in $(BIN_FILES) ;\
-       do \
-          sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
--         echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
-+         echo "#!/usr/bin/env lua5.1" > src/bin/$$f ;\
-          echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
-          cat src/bin/$$f.bak >> src/bin/$$f ;\
-          chmod +x src/bin/$$f ;\
diff --git a/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch b/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch
deleted file mode 100644 (file)
index d6da3fe..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -388,18 +388,22 @@ then
- fi
- echo_n "Configuring for system... "
--if uname -s
--then
--   LUAROCKS_UNAME_S=`uname -s`
--else
--   die "Could not determine operating system. 'uname -s' failed."
-+if [ -z "$LUAROCKS_UNAME_S" ]; then
-+    if uname -s
-+    then
-+        LUAROCKS_UNAME_S=`uname -s`
-+    else
-+        die "Could not determine operating system. 'uname -s' failed."
-+    fi
- fi
- echo_n "Configuring for architecture... "
--if uname -m
--then
--   LUAROCKS_UNAME_M=`uname -m`
--else
--   die "Could not determine processor architecture. 'uname -m' failed."
-+if [ -z "$LUAROCKS_UNAME_M" ]; then
-+    if uname -m
-+    then
-+        LUAROCKS_UNAME_M=`uname -m`
-+    else
-+        die "Could not determine processor architecture. 'uname -m' failed."
-+    fi
- fi
- for v in 5.1 5.2 5.3; do
diff --git a/lang/luasec/Makefile b/lang/luasec/Makefile
deleted file mode 100644 (file)
index 9d60604..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (C) 2009-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luasec
-PKG_VERSION:=1.3.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/brunoos/luasec/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=97293092ba385ab390decb6678bc8cbeffd5899bfbc49eb7ef4aa00f5e31c3d4
-
-MAINTAINER:=W. Michael Petullo <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luasec
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=LuaSec
-  URL:=https://github.com/brunoos/luasec
-  DEPENDS:=+lua +libopenssl +luasocket
-endef
-
-define Package/luasec/description
-  LuaSec is a binding for OpenSSL library to provide TLS/SSL communication.
-endef
-
-define Build/Configure
-endef
-
-TARGET_CFLAGS += $(FPIC)
-TARGET_LDFLAGS += $(FPIC)
-
-MAKE_FLAGS += \
-       LD="$(TARGET_CC)" \
-       INC_PATH="" \
-       LIB_PATH="" \
-       LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \
-       LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua"
-
-define Build/Compile
-$(call Build/Compile/Default,linux)
-endef
-
-define Package/luasec/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.so $(1)/usr/lib/lua/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.lua $(1)/usr/lib/lua/
-       $(INSTALL_DIR) $(1)/usr/lib/lua/ssl
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl/https.lua $(1)/usr/lib/lua/ssl/
-endef
-
-$(eval $(call BuildPackage,luasec))
diff --git a/lang/luasec/patches/100-fix-compilation.patch b/lang/luasec/patches/100-fix-compilation.patch
deleted file mode 100644 (file)
index 1c3bc3b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -16,8 +16,8 @@ WARN=-Wall -pedantic
- BSD_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
- BSD_LDFLAGS=-O -fPIC -shared $(LIBDIR)
--LNX_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
--LNX_LDFLAGS=-O -fPIC -shared $(LIBDIR)
-+LNX_CFLAGS=$(INCDIR) $(DEFS)
-+LNX_LDFLAGS=-shared $(LIBDIR)
- MAC_ENV=env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
- MAC_CFLAGS=-O2 -fno-common $(WARN) $(INCDIR) $(DEFS)
-@@ -34,10 +34,10 @@ LDFLAGS += $(MYLDFLAGS)
- all:
- install: $(CMOD) $(LMOD)
--      $(INSTALL) -d $(DESTDIR)$(LUAPATH)/ssl $(DESTDIR)$(LUACPATH)
--      $(INSTALL) $(CMOD) $(DESTDIR)$(LUACPATH)
--      $(INSTALL) -m644 $(LMOD) $(DESTDIR)$(LUAPATH)
--      $(INSTALL) -m644 https.lua $(DESTDIR)$(LUAPATH)/ssl
-+      $(INSTALL) -d $(LUAPATH)/ssl $(LUACPATH)
-+      $(INSTALL) $(CMOD) $(LUACPATH)
-+      $(INSTALL) -m644 $(LMOD) $(LUAPATH)
-+      $(INSTALL) -m644 https.lua $(LUAPATH)/ssl
- linux:
-       @$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)" EXTRA="$(EXTRA)"
diff --git a/lang/luasoap/Makefile b/lang/luasoap/Makefile
deleted file mode 100644 (file)
index 20e5a3d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luasoap
-PKG_VERSION:=4.0.2
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/tomasguisasola/luasoap
-PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_MIRROR_HASH:=ecd82fe9d7c62c6870f042ba65ce57054d68193779af9461cb4d95b83983bf80
-
-PKG_MAINTAINER:=Liu Peng <[email protected]>
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luasoap
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=LuaSOAP
-  URL:=https://github.com/tomasguisasola/luasoap
-  DEPENDS:=+lua +luaexpat +luasec +luasocket
-  PKGARCH:=all
-endef
-
-define Package/luasoap/description
-  LuaSOAP is a library of functions to deal with SOAP.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/luasoap/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/soap.lua $(1)/usr/lib/lua/
-       $(INSTALL_DIR) $(1)/usr/lib/lua/soap
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{client,server}.lua $(1)/usr/lib/lua/soap/
-       $(INSTALL_DIR) $(1)/usr/lib/lua/soap/tests
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/test{,-http,-server,-wsdl}.lua $(1)/usr/lib/lua/soap/tests/
-endef
-
-$(eval $(call BuildPackage,luasoap))
diff --git a/lang/luasocket/Makefile b/lang/luasocket/Makefile
deleted file mode 100644 (file)
index 9538d7a..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# Copyright (C) 2009-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luasocket
-PKG_VERSION:=3.1.0
-PKG_RELEASE:=2
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/lunarmodules/luasocket
-PKG_MIRROR_HASH:=1ee81f1f5a63d0d14c8c8571e8940604cbf1443c3b18ee7d3d1bac6791f853fc
-
-PKG_MAINTAINER:=W. Michael Petullo <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luasocket/default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  URL:=http://w3.impa.br/~diego/software/luasocket
-endef
-
-define Package/luasocket
-  $(Package/luasocket/default)
-  TITLE:=LuaSocket
-  DEPENDS:=+lua
-  VARIANT:=lua-51
-  DEFAULT_VARIANT:=1
-endef
-
-define Package/luasocket5.3
-  $(Package/luasocket/default)
-  TITLE:=LuaSocket 5.3
-  DEPENDS:=+liblua5.3
-  VARIANT:=lua-53
-endef
-
-ifeq ($(BUILD_VARIANT),lua-51)
-  LUA_VERSION=5.1
-endif
-
-ifeq ($(BUILD_VARIANT),lua-53)
-  LUA_VERSION=5.3
-endif
-
-
-define Package/luasocket/default/description
-  LuaSocket is the most comprehensive networking support
-  library for the Lua language. It provides easy access to
-  TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more.
-endef
-Package/luasocket/description     = $(Package/luasocket/default/description)
-Package/luasocket5.3/description = $(Package/luasocket/default/description)
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)/ \
-               LIBDIR="$(TARGET_LDFLAGS)" \
-               CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
-               LD="$(TARGET_CROSS)ld -shared" \
-               LUAV=$(LUA_VERSION) LUAINC_linux_base=$(STAGING_DIR)/usr/include \
-               all
-endef
-
-define Package/luasocket/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ltn12,mime,socket}.lua $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mime-1.0.3.so $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/socket-3.0.0.so $(1)/usr/lib/lua
-       $(INSTALL_DIR) $(1)/usr/lib/lua/mime
-       ln -sf ../mime-1.0.3.so $(1)/usr/lib/lua/mime/core.so
-       $(INSTALL_DIR) $(1)/usr/lib/lua/socket
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/serial.so $(1)/usr/lib/lua/socket
-       ln -sf ../socket-3.0.0.so $(1)/usr/lib/lua/socket/core.so
-endef
-
-
-define Package/luasocket5.3/install
-       $(MAKE) -C $(PKG_BUILD_DIR)/src \
-               DESTDIR="$(1)" \
-               LUAV=$(LUA_VERSION) \
-               install
-endef
-
-
-$(eval $(call BuildPackage,luasocket))
-$(eval $(call BuildPackage,luasocket5.3))
diff --git a/lang/luasocket/patches/0001-Add-interface-support.patch b/lang/luasocket/patches/0001-Add-interface-support.patch
deleted file mode 100644 (file)
index d7bfe2b..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-From 96fdf07acf78ecfc9be76a8b0591f38fe6f1a875 Mon Sep 17 00:00:00 2001
-From: Steven Barth <[email protected]>
-Date: Sat, 9 Nov 2013 12:01:42 +0100
-Subject: [PATCH] Add interface resolving
-
----
- src/if.c        | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/if.h        |  27 ++++++++++++++
- src/luasocket.c |   2 +
- src/makefile    |   2 +
- src/options.c   |   9 +++++
- 5 files changed, 153 insertions(+)
- create mode 100644 src/if.c
- create mode 100644 src/if.h
-
---- /dev/null
-+++ b/src/if.c
-@@ -0,0 +1,117 @@
-+/*
-+ * $Id: if.c $
-+ *
-+ * Author: Markus Stenberg <[email protected]>
-+ *
-+ * Copyright (c) 2012 cisco Systems, Inc.
-+ *
-+ * Created:       Tue Dec  4 14:50:34 2012 mstenber
-+ * Last modified: Wed Dec  5 18:51:08 2012 mstenber
-+ * Edit time:     24 min
-+ *
-+ */
-+
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <net/if.h>
-+
-+#include "if.h"
-+
-+#include "lauxlib.h"
-+
-+static int if_global_indextoname(lua_State *L);
-+static int if_global_nametoindex(lua_State *L);
-+static int if_global_nameindex(lua_State *L);
-+
-+static luaL_Reg func[] = {
-+    { "indextoname", if_global_indextoname},
-+    { "nametoindex", if_global_nametoindex},
-+    { "nameindex", if_global_nameindex},
-+    { NULL, NULL}
-+};
-+
-+int if_open(lua_State *L)
-+{
-+    lua_pushstring(L, "iface");
-+    lua_newtable(L);
-+#if LUA_VERSION_NUM < 503
-+    luaL_openlib(L, NULL, func, 0);
-+#else
-+    luaL_setfuncs(L, func, 0);
-+#endif
-+    lua_settable(L, -3);
-+    return 0;
-+}
-+
-+int if_global_indextoname(lua_State *L)
-+{
-+  unsigned int ifnumber;
-+  const char *name;
-+  char buf[IF_NAMESIZE+1];
-+
-+  if (!lua_isnumber(L, 1))
-+    {
-+      lua_pushnil(L);
-+      lua_pushstring(L, "indextoname expects only number argument");
-+      return 2;
-+    }
-+  ifnumber = lua_tonumber(L, 1);
-+  if (!(name = if_indextoname(ifnumber, buf)))
-+    {
-+      lua_pushnil(L);
-+      lua_pushstring(L, "nonexistent interface");
-+      return 2;
-+    }
-+  lua_pushstring(L, name);
-+  return 1;
-+}
-+
-+int if_global_nametoindex(lua_State *L)
-+{
-+  unsigned int ifnumber;
-+  if (!lua_isstring(L, 1))
-+    {
-+      lua_pushnil(L);
-+      lua_pushstring(L, "nametoindex expects only string argument");
-+      return 2;
-+    }
-+  if (!(ifnumber = if_nametoindex(lua_tostring(L, 1))))
-+    {
-+      lua_pushnil(L);
-+      lua_pushstring(L, "nonexistent interface");
-+      return 2;
-+    }
-+  lua_pushnumber(L, ifnumber);
-+  return 1;
-+}
-+
-+int if_global_nameindex(lua_State *L)
-+{
-+  struct if_nameindex *ni, *oni;
-+  int i = 1;
-+  oni = ni = if_nameindex();
-+  lua_newtable(L);
-+  while (ni && ni->if_index && *(ni->if_name))
-+    {
-+      /* at result[i], we store.. */
-+      lua_pushnumber(L, i);
-+
-+      /* new table with two items - index, name*/
-+      lua_newtable(L);
-+      lua_pushstring(L, "index");
-+      lua_pushnumber(L, ni->if_index);
-+      lua_settable(L, -3);
-+
-+      lua_pushstring(L, "name");
-+      lua_pushstring(L, ni->if_name);
-+      lua_settable(L, -3);
-+
-+      /* Then, actually store it */
-+      lua_settable(L, -3);
-+
-+      i++;
-+      ni++;
-+    }
-+  if_freenameindex(oni);
-+  return 1;
-+}
---- /dev/null
-+++ b/src/if.h
-@@ -0,0 +1,27 @@
-+/*
-+ * $Id: if.h $
-+ *
-+ * Author: Markus Stenberg <[email protected]>
-+ *
-+ *  Copyright (c) 2012 cisco Systems, Inc.
-+ *
-+ * Created:       Tue Dec  4 14:37:24 2012 mstenber
-+ * Last modified: Tue Dec  4 14:51:43 2012 mstenber
-+ * Edit time:     7 min
-+ *
-+ */
-+
-+/* This module provides Lua wrapping for the advanced socket API
-+ * defined in RFC3542, or mainly, the access to the system's interface
-+ * list. It is necessary for use of recvmsg/sendmsg.
-+ *
-+ * TODO - Do something clever with Windows?
-+ */
-+#ifndef IF_H
-+#define IF_H
-+
-+#include "lua.h"
-+
-+int if_open(lua_State *L);
-+
-+#endif /* IF_H */
---- a/src/luasocket.c
-+++ b/src/luasocket.c
-@@ -21,6 +21,7 @@
- #include "tcp.h"
- #include "udp.h"
- #include "select.h"
-+#include "if.h"
- /*-------------------------------------------------------------------------*\
- * Internal function prototypes
-@@ -41,6 +42,7 @@ static const luaL_Reg mod[] = {
-     {"tcp", tcp_open},
-     {"udp", udp_open},
-     {"select", select_open},
-+    {"iface", if_open},
-     {NULL, NULL}
- };
---- a/src/makefile
-+++ b/src/makefile
-@@ -303,6 +303,7 @@ SOCKET_OBJS= \
-       compat.$(O) \
-       options.$(O) \
-       inet.$(O) \
-+      if.$(O) \
-       $(SOCKET) \
-       except.$(O) \
-       select.$(O) \
-@@ -440,6 +441,7 @@ auxiliar.$(O): auxiliar.c auxiliar.h
- buffer.$(O): buffer.c buffer.h io.h timeout.h
- except.$(O): except.c except.h
- inet.$(O): inet.c inet.h socket.h io.h timeout.h usocket.h
-+if.$(O): if.c if.h
- io.$(O): io.c io.h timeout.h
- luasocket.$(O): luasocket.c luasocket.h auxiliar.h except.h \
-       timeout.h buffer.h io.h inet.h socket.h usocket.h tcp.h \
---- a/src/options.c
-+++ b/src/options.c
-@@ -7,7 +7,10 @@
- #include "options.h"
- #include "inet.h"
- #include <string.h>
--
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <net/if.h>
-+ 
- /*=========================================================================*\
- * Internal functions prototypes
- \*=========================================================================*/
-@@ -414,6 +417,12 @@ static int opt_ip6_setmembership(lua_Sta
-     if (!lua_isnil(L, -1)) {
-         if (lua_isnumber(L, -1)) {
-             val.ipv6mr_interface = (unsigned int) lua_tonumber(L, -1);
-+        } else if (lua_isstring(L, -1)) {
-+            if (!(val.ipv6mr_interface = if_nametoindex(lua_tostring(L, -1)))) {
-+                lua_pushnil(L);
-+                lua_pushstring(L, "nonexistent interface");
-+                return 2;
-+            }
-         } else
-           luaL_argerror(L, -1, "number 'interface' field expected");
-     }
diff --git a/lang/luasocket/patches/0301-Fix-mpc85xx-build.patch b/lang/luasocket/patches/0301-Fix-mpc85xx-build.patch
deleted file mode 100644 (file)
index 14ba072..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/src/makefile
-+++ b/src/makefile
-@@ -397,18 +397,18 @@ none:
- all: $(SOCKET_SO) $(MIME_SO)
- $(SOCKET_SO): $(SOCKET_OBJS)
--      $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
-+      $(CC) $(SOCKET_OBJS) $(LDFLAGS)$@
- $(MIME_SO): $(MIME_OBJS)
--      $(LD) $(MIME_OBJS) $(LDFLAGS)$@
-+      $(CC) $(MIME_OBJS) $(LDFLAGS)$@
- all-unix: all $(UNIX_SO) $(SERIAL_SO)
- $(UNIX_SO): $(UNIX_OBJS)
--      $(LD) $(UNIX_OBJS) $(LDFLAGS)$@
-+      $(CC) $(UNIX_OBJS) $(LDFLAGS)$@
- $(SERIAL_SO): $(SERIAL_OBJS)
--      $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
-+      $(CC) $(SERIAL_OBJS) $(LDFLAGS)$@
- install:
-       $(INSTALL_DIR) $(INSTALL_TOP_LDIR)
diff --git a/lang/luasql/Makefile b/lang/luasql/Makefile
deleted file mode 100644 (file)
index 1a807eb..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-# Copyright (C) 2010-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luasql
-PKG_VERSION:=2.4.0
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/keplerproject/luasql/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=db2458a8c8c5f3bc717e4030fe2878f1ad8d71e437ec6149c381eebad5d525c5
-
-PKG_MAINTAINER:=
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=doc/us/license.html
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luasql/Default
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua SQL binding
-  URL:=https://keplerproject.github.io/luasql/
-  DEPENDS:= +lua
-endef
-
-define Package/luasql/Default/description
- LuaSQL is a simple interface from Lua to a DBMS.
-endef
-
-
-define Package/luasql-mysql
-$(call Package/luasql/Default)
-  TITLE+= for MySQL
-  DEPENDS+= +libmysqlclient
-  VARIANT:=mysql
-endef
-
-define Package/luasql-mysql/description
-$(call Package/luasql/Default/description)
- .
- This package contains the MySQL binding.
-endef
-
-
-define Package/luasql-pgsql
-$(call Package/luasql/Default)
-  TITLE+= for PostgreSQL
-  DEPENDS+= +libpq
-  VARIANT:=postgres
-endef
-
-define Package/luasql-pgsql/description
-$(call Package/luasql/Default/description)
- .
- This package contains the PostgreSQL binding.
-endef
-
-
-define Package/luasql-sqlite3
-$(call Package/luasql/Default)
-  TITLE+= for SQLite 3
-  DEPENDS+= +libsqlite3
-  VARIANT:=sqlite3
-endef
-
-define Package/luasql-sqlite3/description
-$(call Package/luasql/Default/description)
- .
- This package contains the SQLite 3 binding.
-endef
-
-
-TARGET_CFLAGS += $(FPIC) -std=gnu99
-TARGET_CPPFLAGS += -DLUA_USE_LINUX
-
-ifeq ($(BUILD_VARIANT),mysql)
-  MAKE_FLAGS += DRIVER_INCS_mysql='-I$(STAGING_DIR)/usr/include/mysql' \
-               DRIVER_LIBS_mysql='$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz'
-endif
-
-ifeq ($(BUILD_VARIANT),postgres)
-  MAKE_FLAGS += DRIVER_LIBS_postgres='$(TARGET_LDFLAGS) -lpq'
-endif
-
-ifeq ($(BUILD_VARIANT),sqlite3)
-  MAKE_FLAGS += DRIVER_LIBS_sqlite='$(TARGET_LDFLAGS) -lsqlite3 -lpthread'
-endif
-
-MAKE_FLAGS += \
-       LIB_OPTION="-shared" \
-       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
-       $(BUILD_VARIANT)
-
-define Package/Install/Default
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luasql
-       $(CP) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/lua/luasql/
-endef
-
-Package/luasql-mysql/install = $(Package/Install/Default)
-Package/luasql-pgsql/install = $(Package/Install/Default)
-Package/luasql-sqlite3/install = $(Package/Install/Default)
-
-$(eval $(call BuildPackage,luasql-mysql))
-$(eval $(call BuildPackage,luasql-pgsql))
-$(eval $(call BuildPackage,luasql-sqlite3))
diff --git a/lang/luasrcdiet/Makefile b/lang/luasrcdiet/Makefile
deleted file mode 100644 (file)
index f1ed10c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luasrcdiet
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Matthias Schiffer <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYRIGHT
-
-PKG_SOURCE_URL:=https://github.com/jirutka/luasrcdiet.git
-PKG_SOURCE_VERSION:=f138fc9359821d9201cd6b57cfa2fcbed5b9af97
-PKG_SOURCE_PROTO:=git
-PKG_MIRROR_HASH:=a3e316f273d4daf4bc5caea295d050efb2624125960de593c72b3aef0126583c
-
-HOST_BUILD_DEPENDS:=lua/host
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/host-build.mk
-
-define Package/luasrcdiet
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=luasrcdiet
-  URL:=https://github.com/jirutka/luasrcdiet
-  DEPENDS:=+lua
-  PKGARCH:=all
-endef
-
-define Package/luasrcdiet/description
-  Compresses Lua source code by removing unnecessary characters
-endef
-
-define Build/Compile
-endef
-
-define Package/luasrcdiet/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/luasrcdiet $(1)/usr/bin/luasrcdiet
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(CP) $(PKG_BUILD_DIR)/luasrcdiet $(1)/usr/lib/lua/
-endef
-
-define Host/Compile
-endef
-
-define Host/Install
-       $(INSTALL_DIR) $(1)/bin
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/luasrcdiet $(1)/bin/
-
-       $(INSTALL_DIR) $(1)/lib/lua/5.1
-       $(CP) $(HOST_BUILD_DIR)/luasrcdiet $(1)/lib/lua/5.1/
-endef
-
-$(eval $(call HostBuild))
-$(eval $(call BuildPackage,luasrcdiet))
diff --git a/lang/luv/Config.in b/lang/luv/Config.in
deleted file mode 100644 (file)
index 076473f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-menu "Configuration"
-       depends on PACKAGE_luv
-
-config LUV_USE_LUAJIT_ENGINE
-       bool "Use luajit engine"
-       select PACKAGE_luajit
-       help
-               If selected, luv will be compiled against luajit. If not selected, luv will use Lua as engine.
-       default n
-
-endmenu
diff --git a/lang/luv/Makefile b/lang/luv/Makefile
deleted file mode 100644 (file)
index cf9f1dd..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luv
-PKG_REAL_VERSION:=1.51.0-1
-PKG_VERSION:=$(subst -,.,$(PKG_REAL_VERSION))
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_REAL_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/luvit/luv/releases/download/$(PKG_REAL_VERSION)
-PKG_HASH:=dc706d9141c185bdce08b6fc8a9d4df05c3ac3676809ee4e9e37e1553d821237
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_REAL_VERSION)
-
-PKG_MAINTAINER:=Morteza Milani <[email protected]>
-PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/luv
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Luv
-  URL:=https://github.com/luvit/luv
-  DEPENDS:=+libuv +!LUV_USE_LUAJIT_ENGINE:lua
-endef
-
-define Package/luv/description
-  Bare libuv bindings for lua
-endef
-
-define Package/luv/config
-       source "$(SOURCE)/Config.in"
-endef
-
-CMAKE_OPTIONS += \
-       -DLUA_BUILD_TYPE=System \
-       -DWITH_SHARED_LIBUV=ON \
-       -DBUILD_MODULE=OFF \
-       -DBUILD_SHARED_LIBS=ON \
-       -DWITH_LUA_ENGINE=$(if $(CONFIG_LUV_USE_LUAJIT_ENGINE),Luajit,Lua)
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/luv
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/luv/*.h $(1)/usr/include/luv
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libluv.so* $(1)/usr/lib
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libluv.pc $(1)/usr/lib/pkgconfig
-       $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libluv.pc
-       $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libluv.pc
-endef
-
-define Package/luv/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libluv.so.1.51.0 $(1)/usr/lib/lua/luv.so
-endef
-
-
-$(eval $(call BuildPackage,luv))
diff --git a/lang/lyaml/Makefile b/lang/lyaml/Makefile
deleted file mode 100755 (executable)
index ac7311a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lyaml
-PKG_VERSION:=6.2.7
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/gvvaughan/lyaml/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=9bb489cefae48b150d66f6bab4141d8d5831fcb7465bfc52a9845fa01efc63b0
-
-PKG_MAINTAINER:=Mathew McBride <[email protected]>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_DEPENDS:=lua/host luarocks/host HOST_OS_MACOS:fakeuname/host
-
-include $(INCLUDE_DIR)/package.mk
-ifeq ($(CONFIG_HOST_OS_MACOS),y)
-    include ../../utils/fakeuname/fakeuname.mk
-endif
-
-define Package/lyaml
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua lib-yaml bindings
-  URL:=https://github.com/gvvaughan/lyaml
-  DEPENDS:= +lua +libyaml
-endef
-
-define Package/lyaml/description
-  Lua bindings for libyaml
-endef
-
-TARGET_CFLAGS += \
-       -I$(STAGING_DIR)/usr/include
-
-# Note: the duplicate environment exports are not a typo!
-# First is for luarocks, then the second is for the compilation
-# invoked by luarocks
-# (Same setup as luaposix)
-define Build/Compile
-       cd $(PKG_BUILD_DIR) && \
-       LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-       LUA_PKGNAME=lua5.1 \
-       CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-       CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
-       $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(TARGET_PATH_PKG)) \
-       luarocks make --pack-binary-rock lyaml-$(PKG_VERSION)-1.rockspec \
-               LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
-               YAML_DIR=$(STAGING_DIR)/usr \
-               LUA_INCDIR=$(STAGING_DIR)/usr/include \
-               LUA_PKGNAME=lua5.1 \
-               CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
-               LDFLAGS="$(TARGET_LDFLAGS)" \
-               CC="$(TARGET_CC)" LD="$(TARGET_CC)"
-endef
-
-define Package/lyaml/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/lyaml
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/yaml.so $(1)/usr/lib/lua/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lyaml/*.lua $(1)/usr/lib/lua/lyaml/
-endef
-
-$(eval $(call BuildPackage,lyaml))
diff --git a/lang/lzmq/Makefile b/lang/lzmq/Makefile
deleted file mode 100644 (file)
index f401af3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lzmq
-PKG_VERSION:=0.4.4
-PKG_RELEASE:=2
-PKG_MAINTAINER:=Dirk Chang <[email protected]>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/zeromq/lzmq/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=cf70200045b8bcb0e929c338ad421b6a291cf1038053532888dc201af3224d8b
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/lzmq
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Lua ZeroMQ binding
-  URL:=https://github.com/zeromq/lzmq
-  DEPENDS:= +lua +libzmq
-endef
-
-define Package/lzmq/description
- LZMQ is a Lua binding to ZeroMQ.
-endef
-
-CMAKE_OPTIONS += \
-       -DUSE_LUA=ON
-
-define Package/lzmq/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq.so $(1)/usr/lib/lua/
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/lzmq
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq/timer.so $(1)/usr/lib/lua/lzmq
-       $(CP) -R $(PKG_BUILD_DIR)/src/lua/lzmq/* $(1)/usr/lib/lua/lzmq
-endef
-
-$(eval $(call BuildPackage,lzmq))
diff --git a/lang/lzmq/patches/010-gcc14.patch b/lang/lzmq/patches/010-gcc14.patch
deleted file mode 100644 (file)
index 8be0b65..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/lzmq.c
-+++ b/src/lzmq.c
-@@ -23,6 +23,7 @@
- #include <assert.h>\r
- #include "zsupport.h"\r
- #include <memory.h>\r
-+#include <stdlib.h>\r
\r
- #define LUAZMQ_MODULE_NAME      "lzmq"\r
- #define LUAZMQ_MODULE_LICENSE   "MIT"\r
diff --git a/lang/uuid/Makefile b/lang/uuid/Makefile
deleted file mode 100644 (file)
index d1ca407..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=uuid
-PKG_VERSION:=0.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_HASH:=142b60b266d90db6177eb07919d8b71ac4a3bb17859540d4655c02f395526962
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/Tieske/uuid.git
-PKG_SOURCE_VERSION:=version_$(PKG_VERSION)
-
-PKG_MAINTAINER:=Amr Hassan <[email protected]>
-PKG_LICENSE=Apache-2.0
-
-LUA_MODULE_PATH:=/usr/lib/lua
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/uuid
-  SUBMENU:=Lua
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=uuid
-  URL:=https://github.com/Tieske/uuid
-  DEPENDS:=+lua +luasocket
-  PKGARCH:=all
-endef
-
-define Package/uuid/description
-       A pure Lua uuid generator
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/uuid/install
-       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/uuid.lua $(1)/$(LUA_MODULE_PATH)/uuid.lua
-endef
-
-$(eval $(call BuildPackage,uuid))