First Commit
[librecmc/package-feed.git] / utils / lcd4linux / Makefile
1 #
2 # Copyright (C) 2007-2015 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:=lcd4linux
11 PKG_REV:=1203
12 PKG_VERSION:=r$(PKG_REV)
13 PKG_RELEASE:=3
14
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)
19 PKG_SOURCE_PROTO:=svn
20
21 LCD4LINUX_DRIVERS:= \
22         ASTUSB \
23         BeckmannEgle \
24         BWCT \
25         CrystalFontz \
26         Curses \
27         Cwlinux \
28         D4D \
29         DPF \
30         EA232graphic \
31         EFN \
32         FutabaVFD \
33         FW8888 \
34         G15 \
35         GLCD2USB \
36         IRLCD \
37         $(if $(CONFIG_BROKEN),HD44780) \
38         $(if $(CONFIG_BROKEN),HD44780-I2C) \
39         LCD2USB \
40         $(if $(CONFIG_BROKEN),LCDLinux) \
41         LCDTerm \
42         LEDMatrix \
43         LPH7508 \
44         $(if $(CONFIG_BROKEN),LUIse) \
45         LW_ABP \
46         M50530 \
47         MatrixOrbital \
48         MatrixOrbitalGX \
49         MilfordInstruments \
50         Newhaven \
51         Noritake \
52         NULL \
53         Pertelian \
54         PHAnderson \
55         PICGraphic \
56         picoLCD \
57         picoLCDGraphic \
58         PNG \
59         PPM \
60         $(if $(CONFIG_TARGET_rb532),RouterBoard) \
61         $(if $(CONFIG_BROKEN),SamsungSPF) \
62         ShuttleVFD \
63         SimpleLCD \
64         st2205 \
65         T6963 \
66         TeakLCM \
67         $(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
68         Trefon \
69         USBHUB \
70         USBLCD \
71         VNC \
72         WincorNixdorf \
73 #       ULA200 \
74 #       X11 \
75
76 LCD4LINUX_PLUGINS:= \
77         apm \
78         asterisk \
79         button_exec \
80         cpuinfo \
81         dbus \
82         diskstats \
83         dvb \
84         event \
85         exec \
86         fifo \
87         file \
88         gps \
89         hddtemp \
90         huawei \
91         i2c_sensors \
92         iconv \
93         imon \
94         isdn \
95         kvv \
96         loadavg \
97         netdev \
98         netinfo \
99         meminfo \
100         mpd \
101         mpris_dbus \
102         mysql \
103         netdev \
104         pop3 \
105         ppp \
106         proc_stat \
107         qnaplog \
108         seti \
109         statfs \
110         uname \
111         uptime \
112         w1retap \
113         $(if $(CONFIG_BROKEN),wireless) \
114         xmms \
115 #       python \
116
117 PKG_FIXUP:=autoreconf
118 PKG_INSTALL:=1
119
120 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
121
122 PKG_BUILD_DEPENDS:= \
123         libdbus \
124         libgd \
125         libmpdclient \
126         libmysqlclient \
127         libncurses \
128         libnmeap \
129         libsqlite3 \
130         ppp \
131 #       libftdi \
132 #       libX11 \
133 #       python \
134
135 PKG_CONFIG_DEPENDS:= \
136         $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
137         $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
138
139 include $(INCLUDE_DIR)/package.mk
140 include $(INCLUDE_DIR)/nls.mk
141
142 define Package/lcd4linux/Default
143   SECTION:=utils
144   CATEGORY:=Utilities
145   PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
146   TITLE:=LCD display utility
147   URL:=http://lcd4linux.bulix.org/
148 endef
149
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.
153 endef
154
155
156 define Package/lcd4linux-custom
157 $(call Package/lcd4linux/Default)
158   DEPENDS:= \
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
171   MENU:=1
172   PROVIDES:=lcd4linux
173   VARIANT=custom
174 endef
175
176 define Package/lcd4linux-custom/config
177         source "$(SOURCE)/Config.in"
178 endef
179
180 define Package/lcd4linux-custom/description
181 $(call Package/lcd4linux/Default/description)
182  .
183  This package contains a customized version of LCD4Linux.
184 endef
185
186
187 define Package/lcd4linux-full
188 $(call Package/lcd4linux/Default)
189   DEPENDS:= @DEVEL \
190         +libdbus \
191         +libgd \
192         $(if $(ICONV_FULL),+libiconv-full) \
193         +libmpdclient \
194         +libmysqlclient \
195         +libncurses \
196         +libsqlite3 \
197         +libusb-compat \
198 #       +libftdi \
199 #       +libX11 \
200 #       +python
201   PROVIDES:=lcd4linux
202   VARIANT=full
203 endef
204
205 define Package/lcd4linux-full/description
206 $(call Package/lcd4linux/Default/description)
207  .
208  This package contains a version of LCD4Linux built with all supported
209  drivers and plugins.
210 endef
211
212
213 CONFIGURE_ARGS+= \
214         --disable-rpath \
215
216 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
217
218 ifeq ($(BUILD_VARIANT),custom)
219
220   LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
221     $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
222  ))
223   ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
224     LCD4LINUX_CUSTOM_DRIVERS:=Sample
225   endif
226
227   LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
228     $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
229   ))
230   ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
231     LCD4LINUX_CUSTOM_PLUGINS:=sample
232   endif
233
234   CONFIGURE_ARGS+= \
235         --with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
236         --with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
237
238   ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
239     CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
240   else
241     CONFIGURE_ARGS+= --without-libiconv-prefix
242   endif
243
244   ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
245     EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
246   endif
247
248 #  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
249 #    CONFIGURE_ARGS+= --with-python
250 #  else
251     CONFIGURE_ARGS+= --without-python
252 #  endif
253
254 #  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
255 #    CONFIGURE_ARGS+= --with-x
256 #  else
257     CONFIGURE_ARGS+= --without-x
258 #  endif
259
260 endif
261
262 ifeq ($(BUILD_VARIANT),full)
263
264   LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
265     $(c) \
266   ))
267
268   LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
269     $(c) \
270   ))
271
272   CONFIGURE_ARGS+= \
273         --with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
274         --with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
275         --with-libiconv-prefix="$(ICONV_PREFIX)" \
276         --without-python \
277         --without-x \
278
279   EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
280
281 endif
282
283
284 define Package/lcd4linux/conffiles
285 /etc/lcd4linux.conf
286 endef
287
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
300 endef
301
302 Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
303 Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
304
305 Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
306 Package/lcd4linux-full/install = $(Package/lcd4linux/install)
307
308 $(eval $(call BuildPackage,lcd4linux-custom))
309 $(eval $(call BuildPackage,lcd4linux-full))