1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit multilib versionator
7 MY_PV=$(replace_version_separator 3 '-')
11 DESCRIPTION="Client/Server suite to drive all kinds of LCD (-like) devices"
12 HOMEPAGE="http://lcdproc.org/"
13 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
17 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
19 IUSE="doc debug hid nfs samba seamless-hbars usb lirc irman joystick ftdi"
21 # The following array holds the USE_EXPANDed keywords
22 IUSE_LCD_DEVICES=(ncurses bayrad cfontz cfontz633 cfontzpacket
23 cwlinux eyeboxone g15 graphlcd glk
24 hd44780 icpa106 imon imonlcd iowarrior
26 md8800 mdm166a ms6931 mtcs16209x mtxorb noritakevfd
27 pyramid sed1330 sed1520 serialvfd sli
28 stv5730 SureElec svga t6963 text tyan
29 ula200 xosd ea65 picolcd serialpos
30 i2500vfd irtrans lis shuttlevfd )
32 # Iterate through the array and add the lcd_devices_* that we support
33 NUM_DEVICES=${#IUSE_LCD_DEVICES[@]}
35 while [ "${index}" -lt "${NUM_DEVICES}" ] ; do
36 IUSE="${IUSE} lcd_devices_${IUSE_LCD_DEVICES[${index}]}"
37 let "index = ${index} + 1"
40 REQUIRED_USE="lcd_devices_mdm166a? ( hid )"
43 usb? ( virtual/libusb:0 )
44 ftdi? ( dev-embedded/libftdi:0 )
45 lirc? ( app-misc/lirc )
46 irman? ( media-libs/libirman )
47 hid? ( >=dev-libs/libhid-0.2.16 )
49 lcd_devices_graphlcd? ( app-misc/graphlcd-base app-misc/glcdprocdriver )
50 lcd_devices_g15? ( dev-libs/libg15 dev-libs/libg15render )
51 lcd_devices_ncurses? ( sys-libs/ncurses )
52 lcd_devices_svga? ( media-libs/svgalib )
53 lcd_devices_ula200? ( dev-embedded/libftdi:0 )
54 lcd_devices_xosd? ( x11-libs/xosd x11-libs/libX11 x11-libs/libXext )
55 lcd_devices_cfontzpacket? ( virtual/libusb:0 )
56 lcd_devices_cwlinux? ( virtual/libusb:0 )
57 lcd_devices_pyramid? ( virtual/libusb:0 )
58 lcd_devices_picolcd? ( virtual/libusb:0 )
59 lcd_devices_i2500vfd? ( dev-embedded/libftdi:0 )
60 lcd_devices_lis? ( dev-embedded/libftdi:0 virtual/libusb:0 )
61 lcd_devices_shuttlevfd? ( virtual/libusb:0 )"
64 app-text/docbook-xml-dtd:4.5 )"
66 lcd_devices_g15? ( app-misc/g15daemon )"
69 if [ -n "${LCDPROC_DRIVERS}" ] ; then
70 ewarn "Setting the drivers to compile via LCDPROC_DRIVERS is not supported anymore."
71 ewarn "Please use LCD_DEVICES now and see emerge -pv output for the options."
76 sed -i "37s:server/drivers:/usr/$(get_libdir)/lcdproc:" LCDd.conf || die
77 einfo "Patching LCDd.conf to use DriverPath=/usr/$(get_libdir)/lcdproc/"
81 # This array contains the driver names required by configure --with-drivers=
82 # The positions must be the same as the corresponding use_expand flags
83 local DEVICE_DRIVERS=(curses bayrad CFontz CFontz633 CFontzPacket
84 CwLnx EyeboxOne g15 glcdlib glk
85 hd44780 icp_a106 imon imonlcd IOWarrior
87 MD8800 mdm166a ms6931 mtc_s16209x MtxOrb NoritakeVFD
88 pyramid sed1330 sed1520 serialVFD sli
89 stv5730 SureElec svga t6963 text tyan
90 ula200 xosd ea65 picolcd serialPOS
91 i2500vfd irtrans lis shuttleVFD )
93 # Generate comma separated list of drivers
98 while [ "${index}" -lt "${NUM_DEVICES}" ] ; do
99 if use "lcd_devices_${IUSE_LCD_DEVICES[${index}]}" ; then
100 append-driver "${DEVICE_DRIVERS[${index}]}"
102 let "index = ${index} + 1"
105 # Append the not-lcd-drivers (input)
106 use lirc && append-driver "lirc"
107 use irman && append-driver "irman"
108 use joystick && append-driver "joy"
110 if [ -z "${COMMA_DRIVERS}" ] ; then
111 ewarn "You are compiling LCDd without support for any LCD drivers at all."
113 # Patch the config to contain a driver that is actually installed instead of the default
114 elog "Compiling the following drivers for LCDd: ${COMMA_DRIVERS}"
115 elog "Setting Driver=${FIRST_DRIVER} in LCDd.conf"
116 sed -i "53s:curses:${FIRST_DRIVER}:" LCDd.conf || die
120 if use lcd_devices_cfontzpacket || use lcd_devices_cwlinux || use lcd_devices_pyramid || \
121 use lcd_devices_picolcd || use lcd_devices_lis || use lcd_devices_shuttlevfd ; then
122 EXTRA_CONF="--enable-libusb"
124 EXTRA_CONF="$(use_enable usb libusb)"
127 if use lcd_devices_ula200 || use lcd_devices_i2500vfd || use lcd_devices_lis ; then
128 EXTRA_CONF="${EXTRA_CONF} --enable-libftdi"
130 EXTRA_CONF="${EXTRA_CONF} $(use_enable ftdi libftdi)"
133 econf --enable-extra-charmaps \
134 $(use_enable debug) \
135 $(use_enable nfs stat-nfs) \
136 $(use_enable samba stat-smbfs ) \
137 $(use_enable seamless-hbars) \
139 "--enable-drivers=${COMMA_DRIVERS}"
146 ebegin "Creating user documentation"
147 cd "${S}"/docs/lcdproc-user
148 xmlto html --skip-validation lcdproc-user.docbook
151 ebegin "Creating dev documentation"
152 cd "${S}"/docs/lcdproc-dev
153 xmlto html --skip-validation lcdproc-dev.docbook
159 [[ -z $* ]] && return 0
160 if [ -z "${COMMA_DRIVERS}" ] ; then
165 # Second, third, ... include a comma at the front
166 COMMA_DRIVERS="${COMMA_DRIVERS},$*"
172 emake DESTDIR="${D}" install
174 # move example clients installed to /usr/bin
175 rm -f "${D}"/usr/bin/{tail,lcdmetar,iosock,fortune,x11amp}.pl
176 insinto /usr/share/lcdproc/clients
177 doins clients/examples/*.pl
178 doins clients/metar/*.pl
180 newinitd "${FILESDIR}/0.5.1-LCDd.initd" LCDd
181 newinitd "${FILESDIR}/0.5.2-r2-lcdproc.initd" lcdproc
183 dodoc README CREDITS ChangeLog INSTALL TODO
186 insinto /usr/share/doc/${PF}/lcdproc-user
187 doins docs/lcdproc-user/*.html
188 insinto /usr/share/doc/${PF}/lcdproc-dev
189 doins docs/lcdproc-dev/*.html