2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/ \
17 http
://ftp.gwdg.de
/pub
/languages
/lua
/ \
18 http
://mirrors.dotsrc.org
/lua
/ \
19 http
://www.tecgraf.puc-rio.br
/lua
/ftp
/
20 PKG_MD5SUM
:=687ce4c2a1ddff18f1008490fdc4e5e0
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/lua
/Default
32 TITLE
:=LUA programming language
34 Lua is a powerful light-weight programming language designed for extending
\\\
35 applications. Lua is also frequently used
as a general-purpose
, stand-alone
\\\
36 language. Lua is free software.
37 URL
:=http
://www.lua.org
/
41 $(call Package
/lua
/Default
)
48 This package contains the LUA shared libraries
, needed by other programs.
52 $(call Package
/lua
/Default
)
53 DEPENDS
:=+liblua
+libreadline
+libncurses
57 This package contains the LUA language interpreter.
61 $(call Package
/lua
/Default
)
66 This package contains the LUA language compiler.
69 define Package
/lua-examples
70 $(call Package
/lua
/Default
)
75 This package contains LUA language examples.
78 define Build
/Configure
82 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
83 CC
="$(TARGET_CROSS)gcc" \
84 LD
="$(TARGET_CROSS)ld" \
85 AR
="$(TARGET_CROSS)ar rcu" \
86 RANLIB
="$(TARGET_CROSS)ranlib" \
88 MYCFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
89 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
90 PKG_VERSION
=$(PKG_VERSION
) \
92 rm -rf
$(PKG_INSTALL_DIR
)
93 mkdir
-p
$(PKG_INSTALL_DIR
)
94 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
95 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
99 define Build
/InstallDev
100 mkdir
-p
$(1)/usr
/include
101 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
102 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
103 mkdir
-p
$(1)/usr
/lib
104 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so.
*} $(1)/usr
/lib
/
105 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblua.so
106 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
109 define Build
/UninstallDev
111 $(STAGING_DIR
)/usr
/include/lua
{,lib
,conf
}.h \
112 $(STAGING_DIR
)/usr
/include/lauxlib.h \
113 $(STAGING_DIR
)/usr
/lib
/liblua.
{a
,so
*}
116 define Package
/liblua
/install
117 $(INSTALL_DIR
) $(1)/usr
/lib
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
121 define Package
/lua
/install
122 $(INSTALL_DIR
) $(1)/usr
/bin
123 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
126 define Package
/luac
/install
127 $(INSTALL_DIR
) $(1)/usr
/bin
128 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
131 define Package
/lua-examples
/install
132 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
133 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
134 $(1)/usr
/share
/lua
/examples
/
137 $(eval
$(call BuildPackage
,liblua
))
138 $(eval
$(call BuildPackage
,lua
))
139 $(eval
$(call BuildPackage
,luac
))
140 $(eval
$(call BuildPackage
,lua-examples
))