2015-10-15 22:12:13 +00:00
|
|
|
#
|
2014-11-06 19:35:34 +00:00
|
|
|
# Copyright (C) 2006-2014 OpenWrt.org
|
2008-04-13 01:06:12 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=lua
|
2012-10-10 17:53:46 +00:00
|
|
|
PKG_VERSION:=5.1.5
|
2021-12-31 10:19:57 +00:00
|
|
|
PKG_RELEASE:=10
|
2008-04-13 01:06:12 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
build: prefer HTTPS if available (for packages)
Changes PKG_SOURCE_URL's for arptables, bsdiff, dnsmasq,
fortify-headers, ipset, ipset-dns, libaudit, libpcap, libressl,
lua, lua5.3, tcpdump and valgrind, to HTTPS
Signed-off-by: Daniel Cousens <github@dcousens.com>
2022-09-30 00:13:46 +00:00
|
|
|
PKG_SOURCE_URL:=https://www.lua.org/ftp/ \
|
|
|
|
https://www.tecgraf.puc-rio.br/lua/ftp/
|
2016-12-16 16:32:10 +00:00
|
|
|
PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
|
2012-10-10 20:48:31 +00:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2008-04-13 01:06:12 +00:00
|
|
|
|
2012-10-19 15:34:28 +00:00
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=COPYRIGHT
|
2023-09-18 20:53:14 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:lua:lua
|
2012-10-19 15:34:28 +00:00
|
|
|
|
2023-10-07 12:16:47 +00:00
|
|
|
PKG_BUILD_FLAGS:=no-lto
|
|
|
|
|
2009-10-27 21:18:58 +00:00
|
|
|
HOST_PATCH_DIR := ./patches-host
|
|
|
|
|
2008-04-13 01:06:12 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2009-10-27 21:18:58 +00:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2008-04-13 01:06:12 +00:00
|
|
|
|
|
|
|
define Package/lua/Default
|
2009-04-25 20:36:30 +00:00
|
|
|
SUBMENU:=Lua
|
2008-04-13 01:06:12 +00:00
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
2009-04-25 20:36:30 +00:00
|
|
|
TITLE:=Lua programming language
|
build: prefer HTTPS if available (for packages)
Changes PKG_SOURCE_URL's for arptables, bsdiff, dnsmasq,
fortify-headers, ipset, ipset-dns, libaudit, libpcap, libressl,
lua, lua5.3, tcpdump and valgrind, to HTTPS
Signed-off-by: Daniel Cousens <github@dcousens.com>
2022-09-30 00:13:46 +00:00
|
|
|
URL:=https://www.lua.org/
|
2016-06-07 09:42:32 +00:00
|
|
|
MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/Default/description
|
|
|
|
Lua is a powerful light-weight programming language designed for extending
|
|
|
|
applications. Lua is also frequently used as a general-purpose, stand-alone
|
|
|
|
language. Lua is free software.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
SUBMENU:=
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
|
|
|
TITLE+= (libraries)
|
2019-01-22 18:17:32 +00:00
|
|
|
ABI_VERSION:=5.1.5
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-25 20:36:30 +00:00
|
|
|
This package contains the Lua shared libraries, needed by other programs.
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua
|
|
|
|
$(call Package/lua/Default)
|
2008-04-13 14:34:36 +00:00
|
|
|
DEPENDS:=+liblua
|
2008-04-13 01:06:12 +00:00
|
|
|
TITLE+= (interpreter)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-25 20:36:30 +00:00
|
|
|
This package contains the Lua language interpreter.
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
DEPENDS:=+liblua
|
|
|
|
TITLE+= (compiler)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-25 20:36:30 +00:00
|
|
|
This package contains the Lua language compiler.
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
DEPENDS:=lua
|
|
|
|
TITLE+= (examples)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-25 20:36:30 +00:00
|
|
|
This package contains Lua language examples.
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
2009-04-19 13:44:40 +00:00
|
|
|
define Build/Configure
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-26 03:01:12 +00:00
|
|
|
TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
|
2008-05-04 17:48:26 +00:00
|
|
|
|
2008-04-13 01:06:12 +00:00
|
|
|
define Build/Compile
|
2012-10-10 20:48:31 +00:00
|
|
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
2008-04-13 01:06:12 +00:00
|
|
|
CC="$(TARGET_CROSS)gcc" \
|
|
|
|
AR="$(TARGET_CROSS)ar rcu" \
|
|
|
|
RANLIB="$(TARGET_CROSS)ranlib" \
|
|
|
|
INSTALL_ROOT=/usr \
|
2008-08-06 22:10:29 +00:00
|
|
|
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
2022-12-18 16:32:46 +00:00
|
|
|
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
2008-04-13 01:06:12 +00:00
|
|
|
PKG_VERSION=$(PKG_VERSION) \
|
2008-11-11 02:48:31 +00:00
|
|
|
linux
|
2008-04-13 01:06:12 +00:00
|
|
|
rm -rf $(PKG_INSTALL_DIR)
|
|
|
|
mkdir -p $(PKG_INSTALL_DIR)
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
|
|
|
|
install
|
|
|
|
endef
|
|
|
|
|
2009-10-27 21:28:15 +00:00
|
|
|
define Host/Configure
|
2017-01-10 17:43:57 +00:00
|
|
|
$(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
|
2009-10-27 21:18:58 +00:00
|
|
|
endef
|
|
|
|
|
2009-10-28 00:11:59 +00:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
LUA_OS:=macosx
|
|
|
|
else
|
|
|
|
ifeq ($(HOST_OS),FreeBSD)
|
|
|
|
LUA_OS:=freebsd
|
|
|
|
else
|
|
|
|
LUA_OS:=linux
|
|
|
|
endif
|
|
|
|
endif
|
2009-10-27 21:18:58 +00:00
|
|
|
|
|
|
|
define Host/Compile
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
2021-12-31 10:19:57 +00:00
|
|
|
CC="$(HOSTCC) $(HOST_FPIC) -std=gnu99" \
|
2009-10-27 21:18:58 +00:00
|
|
|
$(LUA_OS)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Install
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
2017-01-10 17:43:57 +00:00
|
|
|
INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
|
2009-10-27 21:18:58 +00:00
|
|
|
install
|
2019-08-28 18:47:02 +00:00
|
|
|
|
2021-07-10 19:21:26 +00:00
|
|
|
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/pkgconfig
|
|
|
|
$(CP) $(HOST_BUILD_DIR)/etc/lua.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua5.1.pc
|
|
|
|
|
|
|
|
$(LN) lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
|
|
|
|
$(LN) luac5.1 $(STAGING_DIR_HOSTPKG)/bin/luac
|
|
|
|
$(LN) lua5.1.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua.pc
|
2009-10-27 21:18:58 +00:00
|
|
|
endef
|
|
|
|
|
2008-04-13 01:06:12 +00:00
|
|
|
define Build/InstallDev
|
2009-05-14 17:59:06 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include
|
2008-04-13 01:06:12 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
|
2019-06-05 12:22:15 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lua.hpp $(1)/usr/include/
|
2008-04-13 01:06:12 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
|
2008-05-22 20:26:23 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
|
2009-05-14 17:59:06 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2008-11-11 02:48:31 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
|
2014-11-06 19:35:34 +00:00
|
|
|
$(LN) liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
|
2009-05-14 17:59:06 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/etc/lua.pc $(1)/usr/lib/pkgconfig/
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2008-11-11 02:48:31 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2019-06-21 12:30:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.1 $(1)/usr/bin/
|
|
|
|
$(LN) lua5.1 $(1)/usr/bin/lua
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2019-06-21 12:30:01 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.1 $(1)/usr/bin/
|
|
|
|
$(LN) luac5.1 $(1)/usr/bin/luac
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/lua/examples
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
|
|
|
|
$(1)/usr/share/lua/examples/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,liblua))
|
|
|
|
$(eval $(call BuildPackage,lua))
|
|
|
|
$(eval $(call BuildPackage,luac))
|
|
|
|
$(eval $(call BuildPackage,lua-examples))
|
2009-10-27 21:18:58 +00:00
|
|
|
$(eval $(call HostBuild))
|
|
|
|
|