2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/ \
16 http
://www.tecgraf.puc-rio.br
/lua
/ftp
/
17 PKG_HASH
:=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
21 PKG_LICENSE_FILES
:=COPYRIGHT
23 HOST_PATCH_DIR
:= .
/patches-host
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/host-build.mk
28 define Package
/lua5.3
/Default
32 TITLE
:=Lua programming language
33 URL
:=http
://www.lua.org
/
34 MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>
37 define Package
/lua5.3
/Default
/description
38 Lua is a powerful
, efficient
, lightweight
, embeddable scripting language. It
39 supports procedural programming
, object-oriented programming
, functional
40 programming
, data-driven programming
, and data description.
44 $(call Package
/lua5.3
/Default
)
48 define Package
/lua5.3
/description
49 $(call Package
/lua5.3
/Default
/description
)
50 This package contains the Lua language interpreter.
53 define Package
/luac5.3
54 $(call Package
/lua5.3
/Default
)
58 define Package
/luac5.3
/description
59 $(call Package
/lua5.3
/Default
/description
)
60 This package contains the Lua language compiler.
63 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
) -std
=gnu99
66 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
67 CC
="$(TARGET_CROSS)gcc" \
68 AR
="$(TARGET_CROSS)ar rcu" \
69 RANLIB
="$(TARGET_CROSS)ranlib" \
71 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
72 PKG_VERSION
=$(PKG_VERSION
) \
74 rm -rf
$(PKG_INSTALL_DIR
)
75 mkdir
-p
$(PKG_INSTALL_DIR
)
76 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
77 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
82 $(SED
) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR
)/src
/luaconf.h
85 ifeq ($(HOST_OS
),Darwin
)
88 ifeq ($(HOST_OS
),FreeBSD
)
96 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
97 CC
="$(HOSTCC) -std=gnu99" \
102 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
103 INSTALL_TOP
="$(STAGING_DIR_HOSTPKG)" \
107 define Build
/InstallDev
108 $(INSTALL_DIR
) $(1)/usr
/include
109 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua5.3
/lua
{,lib
,conf
}.h
$(1)/usr
/include/
110 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua5.3
/lauxlib.h
$(1)/usr
/include/
113 define Package
/lua5.3
/install
114 $(INSTALL_DIR
) $(1)/usr
/bin
115 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua5.3
$(1)/usr
/bin
/
118 define Package
/luac5.3
/install
119 $(INSTALL_DIR
) $(1)/usr
/bin
120 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac5.3
$(1)/usr
/bin
/
123 $(eval
$(call BuildPackage
,lua5.3
))
124 $(eval
$(call BuildPackage
,luac5.3
))
125 $(eval
$(call HostBuild
))