2015-10-16 06:12:13 +08:00
|
|
|
#
|
2014-11-07 03:35:34 +08:00
|
|
|
# Copyright (C) 2006-2014 OpenWrt.org
|
2008-04-13 09:06:12 +08: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-11 01:53:46 +08:00
|
|
|
PKG_VERSION:=5.1.5
|
|
|
|
PKG_RELEASE:=1
|
2008-04-13 09:06:12 +08:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
|
|
|
|
http://ftp.gwdg.de/pub/languages/lua/ \
|
|
|
|
http://mirrors.dotsrc.org/lua/ \
|
|
|
|
http://www.tecgraf.puc-rio.br/lua/ftp/
|
2016-12-17 00:32:10 +08:00
|
|
|
PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
|
2012-10-11 04:48:31 +08:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2008-04-13 09:06:12 +08:00
|
|
|
|
2012-10-19 23:34:28 +08:00
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=COPYRIGHT
|
|
|
|
|
2009-10-28 05:18:58 +08:00
|
|
|
HOST_PATCH_DIR := ./patches-host
|
|
|
|
|
2008-04-13 09:06:12 +08:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2009-10-28 05:18:58 +08:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2008-04-13 09:06:12 +08:00
|
|
|
|
|
|
|
define Package/lua/Default
|
2009-04-26 04:36:30 +08:00
|
|
|
SUBMENU:=Lua
|
2008-04-13 09:06:12 +08:00
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
2009-04-26 04:36:30 +08:00
|
|
|
TITLE:=Lua programming language
|
2008-04-13 09:06:12 +08:00
|
|
|
URL:=http://www.lua.org/
|
2016-06-07 17:42:32 +08:00
|
|
|
MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
2008-04-13 09:06:12 +08: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)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-26 04:36:30 +08:00
|
|
|
This package contains the Lua shared libraries, needed by other programs.
|
2008-04-13 09:06:12 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua
|
|
|
|
$(call Package/lua/Default)
|
2008-04-13 22:34:36 +08:00
|
|
|
DEPENDS:=+liblua
|
2008-04-13 09:06:12 +08:00
|
|
|
TITLE+= (interpreter)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/description
|
|
|
|
$(call Package/lua/Default/description)
|
2009-04-26 04:36:30 +08:00
|
|
|
This package contains the Lua language interpreter.
|
2008-04-13 09:06:12 +08: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-26 04:36:30 +08:00
|
|
|
This package contains the Lua language compiler.
|
2008-04-13 09:06:12 +08: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-26 04:36:30 +08:00
|
|
|
This package contains Lua language examples.
|
2008-04-13 09:06:12 +08:00
|
|
|
endef
|
|
|
|
|
2009-04-19 21:44:40 +08:00
|
|
|
define Build/Configure
|
2008-04-13 09:06:12 +08:00
|
|
|
endef
|
|
|
|
|
2009-10-26 11:01:12 +08:00
|
|
|
TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
|
2008-05-05 01:48:26 +08:00
|
|
|
|
2008-04-13 09:06:12 +08:00
|
|
|
define Build/Compile
|
2012-10-11 04:48:31 +08:00
|
|
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
2008-04-13 09:06:12 +08:00
|
|
|
CC="$(TARGET_CROSS)gcc" \
|
|
|
|
AR="$(TARGET_CROSS)ar rcu" \
|
|
|
|
RANLIB="$(TARGET_CROSS)ranlib" \
|
|
|
|
INSTALL_ROOT=/usr \
|
2008-08-07 06:10:29 +08:00
|
|
|
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
2008-04-13 09:06:12 +08:00
|
|
|
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
PKG_VERSION=$(PKG_VERSION) \
|
2008-11-11 10:48:31 +08:00
|
|
|
linux
|
2008-04-13 09:06:12 +08: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-28 05:28:15 +08:00
|
|
|
define Host/Configure
|
2017-01-11 01:43:57 +08:00
|
|
|
$(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
|
2009-10-28 05:18:58 +08:00
|
|
|
endef
|
|
|
|
|
2009-10-28 08:11:59 +08:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
LUA_OS:=macosx
|
|
|
|
else
|
|
|
|
ifeq ($(HOST_OS),FreeBSD)
|
|
|
|
LUA_OS:=freebsd
|
|
|
|
else
|
|
|
|
LUA_OS:=linux
|
|
|
|
endif
|
|
|
|
endif
|
2009-10-28 05:18:58 +08: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-11 01:43:57 +08:00
|
|
|
INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
|
2009-10-28 05:18:58 +08:00
|
|
|
install
|
|
|
|
endef
|
|
|
|
|
2008-04-13 09:06:12 +08:00
|
|
|
define Build/InstallDev
|
2009-05-15 01:59:06 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include
|
2008-04-13 09:06:12 +08: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-23 04:26:23 +08:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
|
2009-05-15 01:59:06 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2008-11-11 10:48:31 +08:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
|
2014-11-07 03:35:34 +08:00
|
|
|
$(LN) liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
|
2009-05-15 01:59:06 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/etc/lua.pc $(1)/usr/lib/pkgconfig/
|
2008-04-13 09:06:12 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2008-11-11 10:48:31 +08:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
|
2008-04-13 09:06:12 +08: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-28 05:18:58 +08:00
|
|
|
$(eval $(call HostBuild))
|
|
|
|
|