fix weechat compile with the lua plugin
[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 -Wl,-rpath-link,$(STAGING_DIR)/usr/lib" \
85
86 ifneq ($(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 CONFIGURE_VARS+= \
94 LIBS="-ldl -lm"
95 TARGET_LDFLAGS += -lcrypt
96 else
97 CONFIGURE_ARGS+= \
98 --disable-lua
99 endif
100
101 define Build/Compile
102 $(MAKE) -C $(PKG_BUILD_DIR) \
103 $(LUA_FLAGS) \
104 DESTDIR="$(PKG_INSTALL_DIR)" \
105 LUACONFIG="" \
106 all install
107 endef
108
109 define Package/weechat/install
110 $(INSTALL_DIR) $(1)/usr/bin
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/weechat-curses $(1)/usr/bin/
112 $(INSTALL_DIR) $(1)/usr/lib/weechat/plugins
113 endef
114
115 define BuildPlugin
116
117 define Package/weechat-mod-$(1)/install
118 $(INSTALL_DIR) $$(1)/usr/lib/weechat/plugins
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/weechat/plugins/$(1).so* $$(1)/usr/lib/weechat/plugins/
120 endef
121
122 $$(eval $$(call BuildPackage,weechat-mod-$(1)))
123 endef
124
125 $(eval $(call BuildPackage,weechat))
126 $(eval $(call BuildPlugin,charset))
127 $(eval $(call BuildPlugin,lua))