lua5.3: drop unwanted & unneeded PROVIDES
[openwrt/staging/luka.git] / package / utils / lua5.3 / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lua
11 PKG_VERSION:=5.3.5
12 PKG_RELEASE:=1
13
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
18 PKG_BUILD_PARALLEL:=1
19
20 PKG_LICENSE:=MIT
21 PKG_LICENSE_FILES:=COPYRIGHT
22
23 HOST_PATCH_DIR := ./patches-host
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/host-build.mk
27
28 define Package/lua5.3/Default
29 SUBMENU:=Lua
30 SECTION:=lang
31 CATEGORY:=Languages
32 TITLE:=Lua programming language
33 URL:=http://www.lua.org/
34 MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
35 endef
36
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.
41 endef
42
43 define Package/lua5.3
44 $(call Package/lua5.3/Default)
45 TITLE+= (interpreter)
46 endef
47
48 define Package/lua5.3/description
49 $(call Package/lua5.3/Default/description)
50 This package contains the Lua language interpreter.
51 endef
52
53 define Package/luac5.3
54 $(call Package/lua5.3/Default)
55 TITLE+= (compiler)
56 endef
57
58 define Package/luac5.3/description
59 $(call Package/lua5.3/Default/description)
60 This package contains the Lua language compiler.
61 endef
62
63 TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
64
65 define Build/Compile
66 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
67 CC="$(TARGET_CROSS)gcc" \
68 AR="$(TARGET_CROSS)ar rcu" \
69 RANLIB="$(TARGET_CROSS)ranlib" \
70 INSTALL_ROOT=/usr \
71 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
72 PKG_VERSION=$(PKG_VERSION) \
73 linux
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" \
78 install
79 endef
80
81 define Host/Configure
82 $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
83 endef
84
85 ifeq ($(HOST_OS),Darwin)
86 LUA_OS:=macosx
87 else
88 ifeq ($(HOST_OS),FreeBSD)
89 LUA_OS:=freebsd
90 else
91 LUA_OS:=linux
92 endif
93 endif
94
95 define Host/Compile
96 $(MAKE) -C $(HOST_BUILD_DIR) \
97 CC="$(HOSTCC) -std=gnu99" \
98 $(LUA_OS)
99 endef
100
101 define Host/Install
102 $(MAKE) -C $(HOST_BUILD_DIR) \
103 INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
104 install
105 endef
106
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/
111 endef
112
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/
116 endef
117
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/
121 endef
122
123 $(eval $(call BuildPackage,lua5.3))
124 $(eval $(call BuildPackage,luac5.3))
125 $(eval $(call HostBuild))