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.
43 define Package
/liblua5.3
44 $(call Package
/lua53
/Default
)
52 define Package
/liblua5.3
/description
53 $(call Package
/lua53
/Default
/description
)
54 This package contains the Lua shared libraries
, needed by other programs.
58 $(call Package
/lua5.3
/Default
)
63 define Package
/lua5.3
/description
64 $(call Package
/lua5.3
/Default
/description
)
65 This package contains the Lua language interpreter.
68 define Package
/luac5.3
69 $(call Package
/lua5.3
/Default
)
74 define Package
/luac5.3
/description
75 $(call Package
/lua5.3
/Default
/description
)
76 This package contains the Lua language compiler.
79 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
) -std
=gnu99
82 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
83 CC
="$(TARGET_CROSS)gcc" \
84 AR
="$(TARGET_CROSS)ar rcu" \
85 RANLIB
="$(TARGET_CROSS)ranlib" \
87 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
88 PKG_VERSION
=$(PKG_VERSION
) \
90 rm -rf
$(PKG_INSTALL_DIR
)
91 mkdir
-p
$(PKG_INSTALL_DIR
)
92 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
93 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
98 $(SED
) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR
)/src
/luaconf.h
101 ifeq ($(HOST_OS
),Darwin
)
104 ifeq ($(HOST_OS
),FreeBSD
)
112 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
113 CC
="$(HOSTCC) -std=gnu99" \
118 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
119 INSTALL_TOP
="$(STAGING_DIR_HOSTPKG)" \
123 define Build
/InstallDev
124 $(INSTALL_DIR
) $(1)/usr
/include/lua5.3
$(1)/usr
/lib
125 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua5.3
/lua
{,lib
,conf
}.h
$(1)/usr
/include/lua5.3
/
126 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua5.3
/lauxlib.h
$(1)/usr
/include/lua5.3
/
127 $(INSTALL_DIR
) $(1)/usr
/lib
128 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua5.3.
{a
,so
*} $(1)/usr
/lib
/
129 $(LN
) liblua5.3.so
.0.0.0 $(1)/usr
/lib
/liblualib5.3.so
132 define Package
/liblua5.3
/install
133 $(INSTALL_DIR
) $(1)/usr
/lib
134 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua5.3.so
* $(1)/usr
/lib
/
137 define Package
/lua5.3
/install
138 $(INSTALL_DIR
) $(1)/usr
/bin
139 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua5.3
$(1)/usr
/bin
/
142 define Package
/luac5.3
/install
143 $(INSTALL_DIR
) $(1)/usr
/bin
144 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac5.3
$(1)/usr
/bin
/
147 $(eval
$(call BuildPackage
,liblua5.3
))
148 $(eval
$(call BuildPackage
,lua5.3
))
149 $(eval
$(call BuildPackage
,luac5.3
))
150 $(eval
$(call HostBuild
))