Make sure lua will get built
[openwrt/svn-archive/archive.git] / net / weechat / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=weechat
12 PKG_VERSION:=0.2.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://weechat.flashtux.org/download/
17 PKG_MD5SUM:=ccdecf663b0050a23049acb4b9a76193
18
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/weechat/Default
24 SUBMENU:=Instant Messaging
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=Lightweight IRC client
28 URL:=http://weechat.flashtux.org/
29 endef
30
31 define Package/weechat/Default/description
32 Weechat is fast, light & extensible IRC client.
33 endef
34
35
36 define Package/weechat
37 $(call Package/weechat/Default)
38 MENU=1
39 DEPENDS:=+libiconv +libgnutls +libncurses
40 endef
41
42 define Package/weechat/description
43 $(call Package/weechat/Default/description)
44 endef
45
46
47 define Package/weechat-mod-charset
48 $(call Package/weechat/Default)
49 TITLE+= (charset plugin)
50 DEPENDS:=weechat
51 endef
52
53 define Package/weechat-mod-charset/description
54 $(call Package/weechat/Default/description)
55 This packages contains a charset plugin for Weechat.
56 endef
57
58
59 define Package/weechat-mod-lua
60 $(call Package/weechat/Default)
61 TITLE+= (LUA plugin)
62 DEPENDS:=weechat +liblua
63 endef
64
65 define Package/weechat-mod-lua/description
66 $(call Package/weechat/Default/description)
67 This packages contains an LUA scripting plugin for Weechat.
68 endef
69
70
71 CONFIGURE_ARGS+= \
72 --with-debug=0 \
73 --with-libgnutls-prefix=$(STAGING_DIR)/usr \
74 --without-doc-xsl-prefix \
75 --with-libiconv-prefix="$(STAGING_DIR)/usr/lib/libiconv" \
76 --without-libintl-prefix \
77 --disable-aspell \
78 --disable-perl \
79 --disable-python \
80 --disable-ruby \
81 LUACONFIG="" \
82
83 CONFIGURE_VARS+= \
84 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
85
86 ifneq ($(SDK)$(CONFIG_PACKAGE_weechat-mod-lua),)
87 CONFIGURE_ARGS+= \
88 --enable-lua \
89 --enable-plugins \
90 --with-plugins="lua" \
91 --with-lua-inc="$(STAGING_DIR)/usr/include" \
92 --with-lua-lib="$(STAGING_DIR)/usr/lib" \
93 LUA_CFLAGS="-I$(STAGING_DIR)/usr/include/"
94 LUA_LFLAGS="-L$(STAGING_DIR)/usr/lib -llualib50 -llua50"
95 CONFIGURE_VARS+= \
96 LIBS="-ldl -lm"
97 else
98 CONFIGURE_ARGS+= \
99 --disable-lua
100 endif
101
102 define Build/Compile
103 $(MAKE) -C $(PKG_BUILD_DIR) \
104 $(LUA_FLAGS) \
105 DESTDIR="$(PKG_INSTALL_DIR)" \
106 LUACONFIG="" \
107 all install
108 endef
109
110 define Package/weechat/install
111 $(INSTALL_DIR) $(1)/usr/bin
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/weechat-curses $(1)/usr/bin/
113 $(INSTALL_DIR) $(1)/usr/lib/weechat/plugins
114 endef
115
116 define BuildPlugin
117
118 define Package/weechat-mod-$(1)/install
119 $(INSTALL_DIR) $$(1)/usr/lib/weechat/plugins
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/weechat/plugins/$(1).so* $$(1)/usr/lib/weechat/plugins/
121 endef
122
123 $$(eval $$(call BuildPackage,weechat-mod-$(1)))
124 endef
125
126 $(eval $(call BuildPackage,weechat))
127 $(eval $(call BuildPlugin,charset))
128 $(eval $(call BuildPlugin,lua))