2 # Copyright (C) 2007-2015 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
12 PKG_VERSION:=r$(PKG_REV)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
17 PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
37 $(if $(CONFIG_BROKEN),HD44780) \
38 $(if $(CONFIG_BROKEN),HD44780-I2C) \
40 $(if $(CONFIG_BROKEN),LCDLinux) \
44 $(if $(CONFIG_BROKEN),LUIse) \
60 $(if $(CONFIG_TARGET_rb532),RouterBoard) \
61 $(if $(CONFIG_BROKEN),SamsungSPF) \
67 $(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
113 $(if $(CONFIG_BROKEN),wireless) \
117 PKG_FIXUP:=autoreconf
120 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
122 PKG_BUILD_DEPENDS:= \
135 PKG_CONFIG_DEPENDS:= \
136 $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
137 $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
139 include $(INCLUDE_DIR)/package.mk
140 include $(INCLUDE_DIR)/nls.mk
142 define Package/lcd4linux/Default
145 PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
146 TITLE:=LCD display utility
147 URL:=http://lcd4linux.bulix.org/
150 define Package/lcd4linux/Default/description
151 LCD4Linux is a small program that grabs information from the kernel and
152 some subsystems and displays it on an external liquid crystal display.
156 define Package/lcd4linux-custom
157 $(call Package/lcd4linux/Default)
159 +LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \
160 +LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \
161 $(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \
162 +LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \
163 +LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \
164 +LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \
165 +LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \
166 +LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \
167 +LCD4LINUX_CUSTOM_NEEDS_libusb:libusb-compat \
168 # +LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \
169 # +LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \
170 # +LCD4LINUX_CUSTOM_NEEDS_python:python
176 define Package/lcd4linux-custom/config
177 source "$(SOURCE)/Config.in"
180 define Package/lcd4linux-custom/description
181 $(call Package/lcd4linux/Default/description)
183 This package contains a customized version of LCD4Linux.
187 define Package/lcd4linux-full
188 $(call Package/lcd4linux/Default)
192 $(if $(ICONV_FULL),+libiconv-full) \
205 define Package/lcd4linux-full/description
206 $(call Package/lcd4linux/Default/description)
208 This package contains a version of LCD4Linux built with all supported
216 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
218 ifeq ($(BUILD_VARIANT),custom)
220 LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
221 $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
223 ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
224 LCD4LINUX_CUSTOM_DRIVERS:=Sample
227 LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
228 $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
230 ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
231 LCD4LINUX_CUSTOM_PLUGINS:=sample
235 --with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
236 --with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
238 ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
239 CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
241 CONFIGURE_ARGS+= --without-libiconv-prefix
244 ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
245 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
248 # ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
249 # CONFIGURE_ARGS+= --with-python
251 CONFIGURE_ARGS+= --without-python
254 # ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
255 # CONFIGURE_ARGS+= --with-x
257 CONFIGURE_ARGS+= --without-x
262 ifeq ($(BUILD_VARIANT),full)
264 LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
268 LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
273 --with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
274 --with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
275 --with-libiconv-prefix="$(ICONV_PREFIX)" \
279 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
284 define Package/lcd4linux/conffiles
288 define Package/lcd4linux/install
289 $(INSTALL_DIR) $(1)/usr/bin
290 $(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/
291 $(INSTALL_DIR) $(1)/etc
292 $(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf
293 $(INSTALL_DIR) $(1)/etc/init.d
294 $(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux
295 $(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \
296 -e "s|^\(Layout 'TestLayer'\)|#\1|g" \
297 -e "s|^#\(Display 'Image'\)|\1|g" \
298 -e "s|^#\(Layout 'Default'\)|\1|g" \
299 $(1)/etc/lcd4linux.conf
302 Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
303 Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
305 Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
306 Package/lcd4linux-full/install = $(Package/lcd4linux/install)
308 $(eval $(call BuildPackage,lcd4linux-custom))
309 $(eval $(call BuildPackage,lcd4linux-full))