Skip to content

Commit

Permalink
EAPI=6 support; removed support befor media-video/vdr-2
Browse files Browse the repository at this point in the history
  • Loading branch information
hd-brummy committed May 7, 2016
1 parent 3d0621e commit 935b315
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions eclass/vdr-plugin-2.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,27 @@
# @CODE

# Applying your own local/user patches:
# This is done by using the epatch_user() function of the eutils.eclass.
# This is done by using the
# (EAPI = 4,5) epatch_user() function of the eutils.eclass,
# (EAPI = 6) eapply_user function integrated in EAPI = 6.
# Simply add your patches into one of these directories:
# /etc/portage/patches/<CATEGORY>/<PF|P|PN>/
# Quote: where the first of these three directories to exist will be the one to
# use, ignoring any more general directories which might exist as well.
#
# For more details about it please take a look at the eutils.class.

inherit eutils flag-o-matic multilib toolchain-funcs unpacker
[[ ${EAPI} == [45] ]] && inherit eutils multilib
inherit flag-o-matic toolchain-funcs unpacker

case ${EAPI:-0} in
4|5) ;;
4|5)
;;
6)
ewarn "EAPI 6 support for test purpose only, plz report bugs to [email protected]"
;;
*) die "EAPI ${EAPI} unsupported."
;;
esac

EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config
Expand Down Expand Up @@ -388,17 +396,10 @@ vdr-plugin-2_pkg_setup() {
fi

# Where should the plugins live in the filesystem
if has_version ">=media-video/vdr-1.7.34"; then
VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
else
# obsolete, as we have only >=media-video/vdr-2
VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
fi
VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)

VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"

# was /usr/lib/... some time ago
# since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
VDR_RC_DIR="/usr/share/vdr/rcscript"

# Pathes to includes
Expand All @@ -407,12 +408,7 @@ vdr-plugin-2_pkg_setup() {

TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"

if has_version ">=media-video/vdr-1.7.34"; then
LOCDIR=$(pkg-config --variable=locdir vdr)
else
# obsolete, as we have only >=media-video/vdr-2
LOCDIR="/usr/share/locale"
fi
LOCDIR=$(pkg-config --variable=locdir vdr)

if ! has_vdr; then
# set to invalid values to detect abuses
Expand All @@ -428,15 +424,8 @@ vdr-plugin-2_pkg_setup() {
return
fi

if has_version ">=media-video/vdr-1.7.34"; then
VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
APIVERSION=$(pkg-config --variable=apiversion vdr)
else
# obsolete, as we have only >=media-video/vdr-2
VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
[[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
fi
VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
APIVERSION=$(pkg-config --variable=apiversion vdr)

einfo "Compiling against"
einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
Expand Down Expand Up @@ -464,7 +453,11 @@ vdr-plugin-2_src_util() {
;;
add_local_patch)
cd "${S}" || die "Could not change to plugin-source-directory!"
epatch_user
if [[ ${EAPI} == 6 ]]; then
eapply_user
else
epatch_user
fi
;;
patchmakefile)
cd "${S}" || die "Could not change to plugin-source-directory!"
Expand Down

0 comments on commit 935b315

Please sign in to comment.