| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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/vdr-plugin.eclass,v 1.82 2012/03/09 22:44:58 hd_brummy Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.90 2012/09/27 16:35:42 axs Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: vdr-plugin.eclass |
5 | # @ECLASS: vdr-plugin.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # vdr@gentoo.org |
7 | # vdr@gentoo.org |
| 8 | # @BLURB: common vdr plugin ebuild functions |
8 | # @BLURB: common vdr plugin ebuild functions |
| … | |
… | |
| 43 | # |
43 | # |
| 44 | # For more details about it please take a look at the eutils.class. |
44 | # For more details about it please take a look at the eutils.class. |
| 45 | |
45 | |
| 46 | inherit base multilib eutils flag-o-matic |
46 | inherit base multilib eutils flag-o-matic |
| 47 | |
47 | |
| 48 | if ! has "${EAPI:-0}" 0 1 2 3 4; then |
48 | if ! has "${EAPI:-0}" 0 1 2 3 4 5; then |
| 49 | die "API of vdr-plugin.eclass in EAPI=\"${EAPI}\" not established" |
49 | die "API of vdr-plugin.eclass in EAPI=\"${EAPI}\" not established" |
| 50 | fi |
50 | fi |
| 51 | |
51 | |
| 52 | IUSE="" |
52 | IUSE="" |
| 53 | |
53 | |
| … | |
… | |
| 292 | ewarn "Please remove unneeded NO_GETTEXT_HACK from ebuild." |
292 | ewarn "Please remove unneeded NO_GETTEXT_HACK from ebuild." |
| 293 | fi |
293 | fi |
| 294 | else |
294 | else |
| 295 | vdr_i18n_convert_to_gettext |
295 | vdr_i18n_convert_to_gettext |
| 296 | if [[ $? != 0 ]]; then |
296 | if [[ $? != 0 ]]; then |
| 297 | eerror "" |
|
|
| 298 | eerror "Plugin will have only english OSD texts" |
297 | einfo "Plugin has no OSD texts or will have only english OSD texts" |
| 299 | eerror "it needs manual fixing." |
|
|
| 300 | fi |
298 | fi |
| 301 | fi |
299 | fi |
| 302 | else |
300 | else |
| 303 | #einfo "VDR has no gettext support" |
301 | #einfo "VDR has no gettext support" |
| 304 | if plugin_has_gettext; then |
302 | if plugin_has_gettext; then |
| … | |
… | |
| 358 | append-flags -fPIC |
356 | append-flags -fPIC |
| 359 | |
357 | |
| 360 | # Plugins need to be compiled with position independent code, otherwise linking |
358 | # Plugins need to be compiled with position independent code, otherwise linking |
| 361 | # VDR against it will fail |
359 | # VDR against it will fail |
| 362 | if has_version ">=media-video/vdr-1.7.13"; then |
360 | if has_version ">=media-video/vdr-1.7.13"; then |
| 363 | append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
361 | append-lfs-flags |
| 364 | fi |
362 | fi |
| 365 | |
363 | |
| 366 | # Where should the plugins live in the filesystem |
364 | # Where should the plugins live in the filesystem |
| 367 | VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" |
365 | VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" |
| 368 | VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" |
366 | VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" |
| … | |
… | |
| 374 | # Pathes to includes |
372 | # Pathes to includes |
| 375 | VDR_INCLUDE_DIR="/usr/include/vdr" |
373 | VDR_INCLUDE_DIR="/usr/include/vdr" |
| 376 | DVB_INCLUDE_DIR="/usr/include" |
374 | DVB_INCLUDE_DIR="/usr/include" |
| 377 | |
375 | |
| 378 | TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" |
376 | TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" |
| 379 | if has_version ">=media-video/vdr-1.6.0_p2-r7"; then |
|
|
| 380 | LOCDIR="/usr/share/locale" |
377 | LOCDIR="/usr/share/locale" |
| 381 | else |
|
|
| 382 | LOCDIR="/usr/share/vdr/locale" |
|
|
| 383 | fi |
|
|
| 384 | |
378 | |
| 385 | if ! has_vdr; then |
379 | if ! has_vdr; then |
| 386 | # set to invalid values to detect abuses |
380 | # set to invalid values to detect abuses |
| 387 | VDRVERSION="eclass_no_vdr_installed" |
381 | VDRVERSION="eclass_no_vdr_installed" |
| 388 | APIVERSION="eclass_no_vdr_installed" |
382 | APIVERSION="eclass_no_vdr_installed" |
| … | |
… | |
| 432 | patchmakefile) |
426 | patchmakefile) |
| 433 | cd "${S}" || die "Could not change to plugin-source-directory!" |
427 | cd "${S}" || die "Could not change to plugin-source-directory!" |
| 434 | vdr_patchmakefile |
428 | vdr_patchmakefile |
| 435 | ;; |
429 | ;; |
| 436 | i18n) |
430 | i18n) |
|
|
431 | # i18n-to-gettext tool removed starting with version 1.7.27 |
|
|
432 | if has_version "<media-video/vdr-1.7.27"; then |
| 437 | cd "${S}" || die "Could not change to plugin-source-directory!" |
433 | cd "${S}" || die "Could not change to plugin-source-directory!" |
| 438 | vdr_i18n |
434 | vdr_i18n |
|
|
435 | fi |
| 439 | ;; |
436 | ;; |
| 440 | esac |
437 | esac |
| 441 | |
438 | |
| 442 | shift |
439 | shift |
| 443 | done |
440 | done |
| … | |
… | |
| 451 | eerror "Please report this at bugs.gentoo.org." |
448 | eerror "Please report this at bugs.gentoo.org." |
| 452 | die "vdr-plugin_pkg_setup not called!" |
449 | die "vdr-plugin_pkg_setup not called!" |
| 453 | fi |
450 | fi |
| 454 | if [ -z "$1" ]; then |
451 | if [ -z "$1" ]; then |
| 455 | case "${EAPI:-0}" in |
452 | case "${EAPI:-0}" in |
| 456 | 2|3|4) |
453 | 2|3|4|5) |
| 457 | vdr-plugin_src_util unpack |
454 | vdr-plugin_src_util unpack |
| 458 | ;; |
455 | ;; |
| 459 | *) |
456 | *) |
| 460 | vdr-plugin_src_util all |
457 | vdr-plugin_src_util all |
| 461 | ;; |
458 | ;; |
| … | |
… | |
| 588 | |
585 | |
| 589 | vdr-plugin_pkg_postrm() { |
586 | vdr-plugin_pkg_postrm() { |
| 590 | delete_orphan_plugindb_file |
587 | delete_orphan_plugindb_file |
| 591 | } |
588 | } |
| 592 | |
589 | |
|
|
590 | vdr-plugin_pkg_config() { |
|
|
591 | : |
|
|
592 | } |
|
|
593 | |
| 593 | case "${EAPI:-0}" in |
594 | case "${EAPI:-0}" in |
| 594 | 2|3|4) |
595 | 2|3|4|5) |
| 595 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config |
596 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config |
| 596 | ;; |
597 | ;; |
| 597 | *) |
598 | *) |
| 598 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |
599 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |
| 599 | ;; |
600 | ;; |