/[gentoo-x86]/eclass/vdr-plugin.eclass
Gentoo

Diff of /eclass/vdr-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.69 Revision 1.71
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.69 2009/03/24 21:10:13 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.71 2009/10/11 11:49:05 maekke Exp $
4# 4#
5# Author: 5# Author:
6# Matthias Schwarzott <zzam@gentoo.org> 6# Matthias Schwarzott <zzam@gentoo.org>
7# Joerg Bornkessel <hd_brummy@gentoo.org> 7# Joerg Bornkessel <hd_brummy@gentoo.org>
8 8
9# vdr-plugin.eclass 9# vdr-plugin.eclass
10# 10#
11# eclass to create ebuilds for vdr plugins 11# eclass to create ebuilds for vdr plugins
12# 12#
13 13
14# Example ebuild (vdr-femon): 14# Example ebuild (basic version without patching):
15# 15#
16# EAPI="2"
16# inherit vdr-plugin 17# inherit vdr-plugin
17# IUSE="" 18# IUSE=""
18# SLOT="0" 19# SLOT="0"
19# DESCRIPTION="vdr Plugin: DVB Frontend Status Monitor (signal strengt/noise)" 20# DESCRIPTION="vdr Plugin: DVB Frontend Status Monitor (signal strengt/noise)"
20# HOMEPAGE="http://www.saunalahti.fi/~rahrenbe/vdr/femon/" 21# HOMEPAGE="http://www.saunalahti.fi/~rahrenbe/vdr/femon/"
21# SRC_URI="http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${P}.tgz" 22# SRC_URI="http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${P}.tgz"
22# LICENSE="GPL-2" 23# LICENSE="GPL-2"
23# KEYWORDS="~x86" 24# KEYWORDS="~x86"
24# DEPEND=">=media-video/vdr-1.3.27" 25# DEPEND=">=media-video/vdr-1.6.0"
25# 26#
26# 27#
28
29# For patching you should modify src_prepare phase:
30#
31# src_prepare() {
32# epatch "${FILESDIR}"/${P}-xxx.patch
33# vdr-plugin_src_prepare
34# }
27 35
28# Installation of a config file for the plugin 36# Installation of a config file for the plugin
29# 37#
30# If ${VDR_CONFD_FILE} is set install this file 38# If ${VDR_CONFD_FILE} is set install this file
31# else install ${FILESDIR}/confd if it exists. 39# else install ${FILESDIR}/confd if it exists.
163 done 171 done
164} 172}
165 173
166fix_vdr_libsi_include() 174fix_vdr_libsi_include()
167{ 175{
168 einfo "Fixing include of libsi-headers" 176 #einfo "Fixing include of libsi-headers"
169 local f 177 local f
170 for f; do 178 for f; do
171 sed -i "${f}" \ 179 sed -i "${f}" \
172 -e '/#include/s:"\(.*libsi.*\)":<\1>:' \ 180 -e '/#include/s:"\(.*libsi.*\)":<\1>:' \
173 -e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:' 181 -e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
193 # To satisfy 1-3 we do this: 201 # To satisfy 1-3 we do this:
194 # Set VDRDIR=/usr/include/vdr 202 # Set VDRDIR=/usr/include/vdr
195 # Set VDRINCDIR=/usr/include 203 # Set VDRINCDIR=/usr/include
196 # Change $(VDRDIR)/include to $(VDRINCDIR) 204 # Change $(VDRDIR)/include to $(VDRINCDIR)
197 205
198 ebegin " Setting paths"
199 sed -i Makefile \ 206 sed -i Makefile \
200 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ 207 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
201 -e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \ 208 -e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \
202 -e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \ 209 -e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
203 \ 210 \
204 -e 's:-I$(DVBDIR)/include::' \ 211 -e 's:-I$(DVBDIR)/include::' \
205 -e 's:-I$(DVBDIR)::' 212 -e 's:-I$(DVBDIR)::'
206 eend 0
207 213
208 # maybe needed for multiproto: 214 # maybe needed for multiproto:
209 #sed -i Makefile \ 215 #sed -i Makefile \
210 # -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ 216 # -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
211 # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' 217 # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
227 233
228 # Disabling file stripping, useful for debugging 234 # Disabling file stripping, useful for debugging
229 sed -i Makefile \ 235 sed -i Makefile \
230 -e '/@.*strip/d' \ 236 -e '/@.*strip/d' \
231 -e '/strip \$(LIBDIR)\/\$@/d' \ 237 -e '/strip \$(LIBDIR)\/\$@/d' \
232 -e '/@.*\$(STRIP)/d' 238 -e 's/STRIP.*=.*$/STRIP = true/'
233 239
234 # Use a file instead of a variable as single-stepping via ebuild 240 # Use a file instead of a variable as single-stepping via ebuild
235 # destroys environment. 241 # destroys environment.
236 touch "${WORKDIR}"/.vdr-plugin_makefile_patched 242 touch "${WORKDIR}"/.vdr-plugin_makefile_patched
237} 243}
293 return 1 299 return 1
294 fi 300 fi
295} 301}
296 302
297vdr_i18n_disable_gettext() { 303vdr_i18n_disable_gettext() {
298 ebegin "Disabling gettext support in plugin" 304 #einfo "Disabling gettext support in plugin"
305
299 # Remove i18n Target if using older vdr 306 # Remove i18n Target if using older vdr
300 sed -i Makefile \ 307 sed -i Makefile \
301 -e '/^all:/s/ i18n//' 308 -e '/^all:/s/ i18n//'
302 eend 0
303} 309}
304 310
305vdr_i18n() { 311vdr_i18n() {
306 if vdr_has_gettext; then 312 if vdr_has_gettext; then
307 einfo "VDR has gettext support" 313 #einfo "VDR has gettext support"
308 if plugin_has_gettext; then 314 if plugin_has_gettext; then
309 einfo "Plugin has gettext support, fine" 315 #einfo "Plugin has gettext support, fine"
310 if [[ ${NO_GETTEXT_HACK} == "1" ]]; then 316 if [[ ${NO_GETTEXT_HACK} == "1" ]]; then
311 ewarn "Please remove left over NO_GETTEXT_HACK." 317 ewarn "Please remove unneeded NO_GETTEXT_HACK from ebuild."
312 fi 318 fi
313 else 319 else
314 vdr_i18n_convert_to_gettext 320 vdr_i18n_convert_to_gettext
315 if [[ $? != 0 ]]; then 321 if [[ $? != 0 ]]; then
316 eerror "" 322 eerror ""
317 eerror "Plugin will have only english OSD texts" 323 eerror "Plugin will have only english OSD texts"
318 eerror "it needs manual fixing." 324 eerror "it needs manual fixing."
319 fi 325 fi
320 fi 326 fi
321 else 327 else
322 einfo "VDR has no gettext support" 328 #einfo "VDR has no gettext support"
323 if plugin_has_gettext; then 329 if plugin_has_gettext; then
324 vdr_i18n_disable_gettext 330 vdr_i18n_disable_gettext
325 fi 331 fi
326 fi 332 fi
327} 333}
402 # if vdr is required 408 # if vdr is required
403 die "VDR not found!" 409 die "VDR not found!"
404 fi 410 fi
405 return 411 return
406 fi 412 fi
407 413
408 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) 414 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
409 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) 415 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
410 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" 416 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
411 417
412 einfo "Compiling against" 418 einfo "Compiling against"

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.71

  ViewVC Help
Powered by ViewVC 1.1.20