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
|
2019-01-22 18:17:32 +00:00
|
|
|
PKG_RELEASE:=2
|
2008-04-13 01:06:12 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
|
|
|
|
http://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
|
|
|
|
|
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
|
2008-04-13 01:06:12 +00:00
|
|
|
URL:=http://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)" \
|
2008-04-13 01:06:12 +00:00
|
|
|
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
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) \
|
|
|
|
CC="$(HOSTCC) -std=gnu99" \
|
|
|
|
$(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
|
|
|
|
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/
|
|
|
|
$(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
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
|
|
|
|
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))
|
|
|
|
|