* [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
@ 2016-05-16 9:39 Joerg Bornkessel
2016-05-17 6:17 ` Michał Górny
0 siblings, 1 reply; 6+ messages in thread
From: Joerg Bornkessel @ 2016-05-16 9:39 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 5463 bytes --]
Hallo,
after my last commit disaster,
i bring my changes to review before i break some things again.
- Added changes to make it work with eapi=6
- removed some unneeded code parts (never they was used in any
ebuilds, i though they was integrated to make the eclass more
flexibel,...)
<snipp .diff>
-- vdr-plugin-2.eclass 2016-05-15 22:03:21.807417485 +0200
+++ vdr-plugin-2.eclass.new 2016-05-15 22:01:10.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -90,7 +90,7 @@
# @CODE
# Applying your own local/user patches:
-# This is done by using the
+# 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:
@@ -104,10 +104,7 @@
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
- 4|5)
- ;;
- 6)
- ewarn "EAPI 6 support for test purpose only, plz report bugs to
vdr@gentoo.org"
+ 4|5|6)
;;
*) die "EAPI ${EAPI} unsupported."
;;
@@ -156,6 +153,7 @@
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
+# obsolet? fix me later...
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
@@ -232,6 +230,7 @@
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
+ # obsolet? fix me later...
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
@@ -289,7 +288,7 @@
linguas_support() {
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will be
-# "compiled" and installed.
+# compiled and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
@@ -311,12 +310,9 @@
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely
and some
-# plugins will fail to "compile" because they're still using the old
variant.
+# plugins will fail to compile because they're still using the old
variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
-#
-# Plugins that are still using the old method will be pmasked until
they're
-# fixed or in case of maintainer timeout they'll be masked for removal.
gettext_missing
@@ -391,6 +387,7 @@
# Plugins need to be compiled with position independent code,
otherwise linking
# VDR against it will fail
+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me
later...
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
fi
@@ -500,7 +497,9 @@
die "vdr-plugin-2_src_prepare not called!"
fi
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == "6" ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
+
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
@@ -522,14 +521,12 @@
fi
cd "${S}"
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
- emake ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- LOCALEDIR="${TMP_LOCALE_DIR}" \
- LOCDIR="${TMP_LOCALE_DIR}" \
- LIBDIR="${S}" \
- TMPDIR="${T}" \
- || die "emake failed"
+ emake all ${BUILD_PARAMS} \
+ LOCALEDIR="${TMP_LOCALE_DIR}" \
+ LOCDIR="${TMP_LOCALE_DIR}" \
+ LIBDIR="${S}" \
+ TMPDIR="${T}" \
+ || die "emake all failed"
;;
esac
@@ -570,12 +567,11 @@
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
- einstall ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- TMPDIR="${T}" \
- DESTDIR="${D}" \
- || die "einstall (makefile target) failed"
+ emake install \
+ ${BUILD_PARAMS} \
+ TMPDIR="${T}" \
+ DESTDIR="${D}" \
+ || die "emake install (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
@@ -609,9 +605,14 @@
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
- local docfile
- for docfile in README* HISTORY CHANGELOG; do
- [[ -f ${docfile} ]] && dodoc ${docfile}
+ local commondoc=( README* HISTORY CHANGELOG )
+ for docfile in "${commondoc[@]}"; do
+ if [[ ${EAPI} == "6" ]]; then
+ local DOCS="${DOCS} ${docfile}"
+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
+ else
+ [[ -f ${docfile} ]] && dodoc ${docfile}
+ fi
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
</snapp>
Attached:
vdr-plugin-2.eclass
vdr-plugin-2.eclass.diff
vdr-plugin-2.eclass.new
Cheers
/dev/joerg
--
Joerg Bornkessel <hd_brummy@gentoo.org>
GnuPG Key: 0x93EB5F4DAA5832A1
Fingerprint: 0E0A A1EE 1DF4 41D7 A3F5 21C2 93EB 5F4D AA58 32A1
[-- Attachment #2: vdr-plugin-2.eclass --]
[-- Type: text/plain, Size: 17634 bytes --]
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: vdr-plugin-2.eclass
# @MAINTAINER:
# Gentoo VDR Project <vdr@gentoo.org>
# @AUTHOR:
# Matthias Schwarzott <zzam@gentoo.org>
# Joerg Bornkessel <hd_brummy@gentoo.org>
# Christian Ruppert <idl0r@gentoo.org>
# (undisclosed contributors)
# @BLURB: common vdr plugin ebuild functions
# @DESCRIPTION:
# Eclass for easing maintenance of vdr plugin ebuilds
# @ECLASS-VARIABLE: VDR_CONFD_FILE
# @DEFAULT_UNSET
# @DESCRIPTION:
# A plugin config file can be specified through the $VDR_CONFD_FILE variable, it
# defaults to ${FILESDIR}/confd. Each config file will be installed as e.g.
# ${D}/etc/conf.d/vdr.${VDRPLUGIN}
# @ECLASS-VARIABLE: VDR_RCADDON_FILE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Installing rc-addon files is basically the same as for plugin config files
# (see above), it's just using the $VDR_RCADDON_FILE variable instead.
# The default value when $VDR_RCADDON_FILE is undefined is:
# ${FILESDIR}/rc-addon.sh and will be installed as
# ${VDR_RC_DIR}/plugin-${VDRPLUGIN}.sh
#
# The rc-addon files will be sourced by the startscript when the specific plugin
# has been enabled.
# rc-addon files may be used to prepare everything that is necessary for the
# plugin start/stop, like passing extra command line options and so on.
#
# NOTE: rc-addon files must be valid shell scripts!
# @ECLASS-VARIABLE: GENTOO_VDR_CONDITIONAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# This is a hack for ebuilds like vdr-xineliboutput that want to
# conditionally install a vdr-plugin
# @ECLASS-VARIABLE: PO_SUBDIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# By default, translation are found in"${S}"/po but this
# default can be overridden by defining PO_SUBDIR.
#
# Example:
# @CODE
# PO_SUBDIR="bla foo/bla"
# @CODE
# @ECLASS-VARIABLE: VDR_MAINTAINER_MODE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Output from function dev_check if it is defined in ebuild or eclass,
# helpfull for gentoo ebuild developer
#
# This will also install any debug files in /usr/share/vdr/maintainer-data
#
# This is intended to be set by user in make.conf. Ebuilds must not set
# it.
#
# VDR_MAINTAINER_MODE=1
# @FUNCTION: fix_vdr_libsi_include
# @DESCRIPTION:
# Plugins failed on compile with wrong path of libsi includes,
# this can be fixed by 'function + space separated list of files'
#
# Example:
# @CODE
# fix_vdr_libsi_include bla.c foo.c
# @CODE
# @FUNCTION: remove_i18n_include
# @DESCRIPTION:
# Compile will fail if plugin still use the old i18n language handling,
# most parts are fixed by vdr-plugin-2.eclass internal functions itself.
# Remove unneeded i18.n includes from files, if they are still wrong there,
# this can be fixed by 'function + space separated list of files"
#
# Example:
# @CODE
# remove_i18n_include bla.n foo.n
# @CODE
# Applying your own local/user patches:
# 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.
[[ ${EAPI} == [45] ]] && inherit eutils multilib
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
4|5)
;;
6)
ewarn "EAPI 6 support for test purpose only, plz report bugs to vdr@gentoo.org"
;;
*) die "EAPI ${EAPI} unsupported."
;;
esac
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config
IUSE=""
# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
VDRPLUGIN="${PN/#vdrplugin-/}"
VDRPLUGIN="${VDRPLUGIN/#vdr-/}"
VDRPLUGIN="${VDRPLUGIN/%-cvs/}"
DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin-2.eclass)"
# Works in most cases
S="${WORKDIR}/${VDRPLUGIN}-${PV}"
# depend on headers for DVB-driver
COMMON_DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2"
DEPEND="${COMMON_DEPEND}
virtual/linuxtv-dvb-headers"
RDEPEND="${COMMON_DEPEND}
>=app-eselect/eselect-vdr-0.0.2"
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then
IUSE="${IUSE} vdr"
DEPEND="vdr? ( ${DEPEND} )"
RDEPEND="vdr? ( ${RDEPEND} )"
fi
# New method of storing plugindb
# Called from src_install
# file maintained by normal portage-methods
create_plugindb_file() {
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
insinto "${NEW_VDRPLUGINDB_DIR}"
# BUG: portage-2.1.4_rc9 will delete the EBUILD= line, so we cannot use this code.
# cat <<-EOT > "${D}/${DB_FILE}"
# VDRPLUGIN_DB=1
# CREATOR=ECLASS
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
echo "EBUILD=${CATEGORY}/${PN}"
echo "EBUILD_V=${PVR}"
echo "PLUGINS=\"$@\""
} > "${D}/${DB_FILE}"
}
create_header_checksum_file() {
# Danger: Not using $ROOT here, as compile will also not use it !!!
# If vdr in $ROOT and / differ, plugins will not run anyway
local CHKSUM="header-md5-vdr"
if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then
cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}"
elif type -p md5sum >/dev/null 2>&1; then
(
cd "${VDR_INCLUDE_DIR}"
md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
) > "${CHKSUM}"
else
die "Could not create md5 checksum of headers"
fi
insinto "${VDR_CHECKSUM_DIR}"
local p_name
for p_name; do
newins "${CHKSUM}" "header-md5-${p_name}"
done
}
fix_vdr_libsi_include() {
dev_check "Fixing include of libsi-headers"
local f
for f; do
sed -i "${f}" \
-e '/#include/s:"\(.*libsi.*\)":<\1>:' \
-e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
done
}
vdr_patchmakefile() {
einfo "Patching Makefile"
[[ -e Makefile ]] || die "Makefile of plugin can not be found!"
cp Makefile "${WORKDIR}"/Makefile.before
# plugin makefiles use VDRDIR in strange ways
# assumptions:
# 1. $(VDRDIR) contains Make.config
# 2. $(VDRDIR) contains config.h
# 3. $(VDRDIR)/include/vdr contains the headers
# 4. $(VDRDIR) contains main vdr Makefile
# 5. $(VDRDIR)/locale exists
# 6. $(VDRDIR) allows to access vdr source files
#
# We only have one directory (for now /usr/include/vdr),
# that contains vdr-headers and Make.config.
# To satisfy 1-3 we do this:
# Set VDRDIR=/usr/include/vdr
# Set VDRINCDIR=/usr/include
# Change $(VDRDIR)/include to $(VDRINCDIR)
sed -i Makefile \
-e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
-e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \
-e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
\
-e 's:-I$(DVBDIR)/include::' \
-e 's:-I$(DVBDIR)::'
# may be needed for multiproto:
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
sed -i Makefile \
-e 's:^APIVERSION = :APIVERSION ?= :' \
-e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
-e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)'
eend $?
fi
# Correcting Compile-Flags
# Do not overwrite CXXFLAGS, add LDFLAGS if missing
sed -i Makefile \
-e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
-e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
# Disabling file stripping, the package manager takes care of it
sed -i Makefile \
-e '/@.*strip/d' \
-e '/strip \$(LIBDIR)\/\$@/d' \
-e 's/STRIP.*=.*$/STRIP = true/'
# Use a file instead of a variable as single-stepping via ebuild
# destroys environment.
touch "${WORKDIR}"/.vdr-plugin_makefile_patched
}
dev_check() {
# A lot useful debug infos
# set VDR_MAINTAINER_MODE="1" in make.conf
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
eerror "\t Gentoo Developer Debug: $@"
fi
}
gettext_missing() {
# plugins without converting to gettext
local GETTEXT_MISSING=$( grep xgettext Makefile )
if [[ -z ${GETTEXT_MISSING} ]]; then
dev_check "Plugin isn't converted to gettext handling \n"
fi
}
detect_po_dir() {
# helper function
[[ -f po ]] && local po_dir="${S}"
local po_subdir=( ${S}/${PO_SUBDIR} )
local f
pofile_dir=( ${po_dir} ${po_subdir[*]} )
}
linguas_support() {
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will be
# "compiled" and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
detect_po_dir
for f in ${pofile_dir[*]}; do
PLUGIN_LINGUAS=$( ls ${f}/po --ignore="*.pot" | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
einfo "LINGUAS=\"${PLUGIN_LINGUAS}\""
sed -i ${f}/Makefile \
-e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \
|| die "sed failed for Linguas"
done
strip-linguas ${PLUGIN_LINGUAS} en
}
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
# plugins will fail to "compile" because they're still using the old variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
#
# Plugins that are still using the old method will be pmasked until they're
# fixed or in case of maintainer timeout they'll be masked for removal.
gettext_missing
local I18N_OBJECT=$( grep i18n.o Makefile )
if [[ -n ${I18N_OBJECT} ]]; then
if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
dev_check "Forced to keep i18n.o"
else
sed -i "s:i18n.o::g" Makefile
dev_check "OBJECT i18n.o found"
dev_check "removed per sed \n"
fi
else
dev_check "OBJECT i18n.o not found in Makefile"
dev_check "all fine or manual review needed? \n"
fi
local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h )
if [[ -n ${I18N_STRING} ]]; then
sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h
dev_check "obsolete tI18nPhrase found"
dev_check "disabled per sed, please recheck \n"
else
dev_check "obsolete tI18nPhrase not found, fine..."
dev_check "please review, may be in subdir... \n"
fi
}
remove_i18n_include() {
# remove uneeded i18.n includes
local f
for f; do
sed -i "${f}" \
-e "s:^#include[[:space:]]*\"i18n.h\"://:"
done
dev_check "removed i18n.h include in ${@}"
}
vdr-plugin-2_print_enable_command() {
local p_name c=0 l=""
for p_name in ${vdr_plugin_list}; do
c=$(( c+1 ))
l="$l ${p_name#vdr-}"
done
elog
case $c in
1) elog "Installed plugin${l}" ;;
*) elog "Installed $c plugins:${l}" ;;
esac
elog "To activate a plugin execute this command:"
elog "\teselect vdr-plugin enable <plugin_name> ..."
elog
}
has_vdr() {
[[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
}
## exported functions
vdr-plugin-2_pkg_setup() {
# missing ${chost}- tag
tc-export CC CXX
# -fPIC is needed for shared objects on some platforms (amd64 and others)
append-flags -fPIC
# Plugins need to be compiled with position independent code, otherwise linking
# VDR against it will fail
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
fi
# Where should the plugins live in the filesystem
VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
VDR_RC_DIR="/usr/share/vdr/rcscript"
# Pathes to includes
VDR_INCLUDE_DIR="/usr/include/vdr"
DVB_INCLUDE_DIR="/usr/include"
TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
LOCDIR=$(pkg-config --variable=locdir vdr)
if ! has_vdr; then
# set to invalid values to detect abuses
VDRVERSION="eclass_no_vdr_installed"
APIVERSION="eclass_no_vdr_installed"
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
einfo "VDR not found!"
else
# if vdr is required
die "VDR not found!"
fi
return
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}]"
if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
eerror "Please move all your patches into"
eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
die
fi
}
vdr-plugin-2_src_util() {
while [ "$1" ]; do
case "$1" in
all)
vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
;;
prepare)
vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
;;
unpack)
unpacker_src_unpack
;;
add_local_patch)
cd "${S}" || die "Could not change to plugin-source-directory!"
if [[ ${EAPI} == 6 ]]; then
eapply_user
else
epatch_user
fi
;;
patchmakefile)
cd "${S}" || die "Could not change to plugin-source-directory!"
vdr_patchmakefile
;;
i18n)
vdr_i18n
;;
linguas_patch)
linguas_support
;;
esac
shift
done
}
vdr-plugin-2_src_unpack() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_unpack not called!"
fi
if [ -z "$1" ]; then
vdr-plugin-2_src_util unpack
else
vdr-plugin-2_src_util $@
fi
}
vdr-plugin-2_src_prepare() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_prepare not called!"
fi
[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
}
vdr-plugin-2_src_compile() {
[ -z "$1" ] && vdr-plugin-2_src_compile compile
while [ "$1" ]; do
case "$1" in
compile)
if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without"
eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_compile not called!"
fi
cd "${S}"
BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
emake ${BUILD_PARAMS} \
${BUILD_TARGETS} \
LOCALEDIR="${TMP_LOCALE_DIR}" \
LOCDIR="${TMP_LOCALE_DIR}" \
LIBDIR="${S}" \
TMPDIR="${T}" \
|| die "emake failed"
;;
esac
shift
done
}
vdr-plugin-2_src_install() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_install not called!"
fi
cd "${WORKDIR}"
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
local mname="${P}-Makefile"
cp "${S}"/Makefile "${mname}.patched"
cp Makefile.before "${mname}.before"
diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
insinto "/usr/share/vdr/maintainer-data/makefile-changes"
doins "${mname}.diff"
insinto "/usr/share/vdr/maintainer-data/makefile-before"
doins "${mname}.before"
insinto "/usr/share/vdr/maintainer-data/makefile-patched"
doins "${mname}.patched"
fi
cd "${S}"
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
einstall ${BUILD_PARAMS} \
${BUILD_TARGETS} \
TMPDIR="${T}" \
DESTDIR="${D}" \
|| die "einstall (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
doins libvdr-*.so.*
fi
if [[ -d ${TMP_LOCALE_DIR} ]]; then
einfo "Installing locales"
cd "${TMP_LOCALE_DIR}"
local linguas
for linguas in ${LINGUAS[*]}; do
insinto "${LOCDIR}"
cp -r --parents ${linguas}* ${D}/${LOCDIR}
done
fi
cd "${D}/usr/$(get_libdir)/vdr/plugins"
# create list of all created plugin libs
vdr_plugin_list=""
local p_name
for p in libvdr-*.so.*; do
p_name="${p%.so*}"
p_name="${p_name#lib}"
vdr_plugin_list="${vdr_plugin_list} ${p_name}"
done
cd "${S}"
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
local docfile
for docfile in README* HISTORY CHANGELOG; do
[[ -f ${docfile} ]] && dodoc ${docfile}
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
[[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
if [[ -n ${VDR_CONFD_FILE} ]]; then
newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
fi
# if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
[[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
if [[ -n ${VDR_RCADDON_FILE} ]]; then
insinto "${VDR_RC_DIR}"
newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
fi
}
vdr-plugin-2_pkg_postinst() {
vdr-plugin-2_print_enable_command
if [[ -n "${VDR_CONFD_FILE}" ]]; then
elog "Please have a look at the config-file"
elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
elog
fi
}
vdr-plugin-2_pkg_postrm() {
:
}
vdr-plugin-2_pkg_config() {
:
}
[-- Attachment #3: vdr-plugin-2.eclass.diff --]
[-- Type: text/plain, Size: 4489 bytes --]
--- vdr-plugin-2.eclass 2016-05-15 22:03:21.807417485 +0200
+++ vdr-plugin-2.eclass.new 2016-05-15 22:01:10.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -90,7 +90,7 @@
# @CODE
# Applying your own local/user patches:
-# This is done by using the
+# 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:
@@ -104,10 +104,7 @@
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
- 4|5)
- ;;
- 6)
- ewarn "EAPI 6 support for test purpose only, plz report bugs to vdr@gentoo.org"
+ 4|5|6)
;;
*) die "EAPI ${EAPI} unsupported."
;;
@@ -156,6 +153,7 @@
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
+# obsolet? fix me later...
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
@@ -232,6 +230,7 @@
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
+ # obsolet? fix me later...
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
@@ -289,7 +288,7 @@
linguas_support() {
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will be
-# "compiled" and installed.
+# compiled and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
@@ -311,12 +310,9 @@
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
-# plugins will fail to "compile" because they're still using the old variant.
+# plugins will fail to compile because they're still using the old variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
-#
-# Plugins that are still using the old method will be pmasked until they're
-# fixed or in case of maintainer timeout they'll be masked for removal.
gettext_missing
@@ -391,6 +387,7 @@
# Plugins need to be compiled with position independent code, otherwise linking
# VDR against it will fail
+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me later...
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
fi
@@ -500,7 +497,9 @@
die "vdr-plugin-2_src_prepare not called!"
fi
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == "6" ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
+
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
@@ -522,14 +521,12 @@
fi
cd "${S}"
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
- emake ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- LOCALEDIR="${TMP_LOCALE_DIR}" \
- LOCDIR="${TMP_LOCALE_DIR}" \
- LIBDIR="${S}" \
- TMPDIR="${T}" \
- || die "emake failed"
+ emake all ${BUILD_PARAMS} \
+ LOCALEDIR="${TMP_LOCALE_DIR}" \
+ LOCDIR="${TMP_LOCALE_DIR}" \
+ LIBDIR="${S}" \
+ TMPDIR="${T}" \
+ || die "emake all failed"
;;
esac
@@ -570,12 +567,11 @@
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
- einstall ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- TMPDIR="${T}" \
- DESTDIR="${D}" \
- || die "einstall (makefile target) failed"
+ emake install \
+ ${BUILD_PARAMS} \
+ TMPDIR="${T}" \
+ DESTDIR="${D}" \
+ || die "emake install (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
@@ -609,9 +605,14 @@
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
- local docfile
- for docfile in README* HISTORY CHANGELOG; do
- [[ -f ${docfile} ]] && dodoc ${docfile}
+ local commondoc=( README* HISTORY CHANGELOG )
+ for docfile in "${commondoc[@]}"; do
+ if [[ ${EAPI} == "6" ]]; then
+ local DOCS="${DOCS} ${docfile}"
+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
+ else
+ [[ -f ${docfile} ]] && dodoc ${docfile}
+ fi
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
[-- Attachment #4: vdr-plugin-2.eclass.new --]
[-- Type: text/plain, Size: 17606 bytes --]
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: vdr-plugin-2.eclass
# @MAINTAINER:
# Gentoo VDR Project <vdr@gentoo.org>
# @AUTHOR:
# Matthias Schwarzott <zzam@gentoo.org>
# Joerg Bornkessel <hd_brummy@gentoo.org>
# Christian Ruppert <idl0r@gentoo.org>
# (undisclosed contributors)
# @BLURB: common vdr plugin ebuild functions
# @DESCRIPTION:
# Eclass for easing maintenance of vdr plugin ebuilds
# @ECLASS-VARIABLE: VDR_CONFD_FILE
# @DEFAULT_UNSET
# @DESCRIPTION:
# A plugin config file can be specified through the $VDR_CONFD_FILE variable, it
# defaults to ${FILESDIR}/confd. Each config file will be installed as e.g.
# ${D}/etc/conf.d/vdr.${VDRPLUGIN}
# @ECLASS-VARIABLE: VDR_RCADDON_FILE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Installing rc-addon files is basically the same as for plugin config files
# (see above), it's just using the $VDR_RCADDON_FILE variable instead.
# The default value when $VDR_RCADDON_FILE is undefined is:
# ${FILESDIR}/rc-addon.sh and will be installed as
# ${VDR_RC_DIR}/plugin-${VDRPLUGIN}.sh
#
# The rc-addon files will be sourced by the startscript when the specific plugin
# has been enabled.
# rc-addon files may be used to prepare everything that is necessary for the
# plugin start/stop, like passing extra command line options and so on.
#
# NOTE: rc-addon files must be valid shell scripts!
# @ECLASS-VARIABLE: GENTOO_VDR_CONDITIONAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# This is a hack for ebuilds like vdr-xineliboutput that want to
# conditionally install a vdr-plugin
# @ECLASS-VARIABLE: PO_SUBDIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# By default, translation are found in"${S}"/po but this
# default can be overridden by defining PO_SUBDIR.
#
# Example:
# @CODE
# PO_SUBDIR="bla foo/bla"
# @CODE
# @ECLASS-VARIABLE: VDR_MAINTAINER_MODE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Output from function dev_check if it is defined in ebuild or eclass,
# helpfull for gentoo ebuild developer
#
# This will also install any debug files in /usr/share/vdr/maintainer-data
#
# This is intended to be set by user in make.conf. Ebuilds must not set
# it.
#
# VDR_MAINTAINER_MODE=1
# @FUNCTION: fix_vdr_libsi_include
# @DESCRIPTION:
# Plugins failed on compile with wrong path of libsi includes,
# this can be fixed by 'function + space separated list of files'
#
# Example:
# @CODE
# fix_vdr_libsi_include bla.c foo.c
# @CODE
# @FUNCTION: remove_i18n_include
# @DESCRIPTION:
# Compile will fail if plugin still use the old i18n language handling,
# most parts are fixed by vdr-plugin-2.eclass internal functions itself.
# Remove unneeded i18.n includes from files, if they are still wrong there,
# this can be fixed by 'function + space separated list of files"
#
# Example:
# @CODE
# remove_i18n_include bla.n foo.n
# @CODE
# Applying your own local/user patches:
# 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.
[[ ${EAPI} == [45] ]] && inherit eutils multilib
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
4|5|6)
;;
*) die "EAPI ${EAPI} unsupported."
;;
esac
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config
IUSE=""
# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
VDRPLUGIN="${PN/#vdrplugin-/}"
VDRPLUGIN="${VDRPLUGIN/#vdr-/}"
VDRPLUGIN="${VDRPLUGIN/%-cvs/}"
DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin-2.eclass)"
# Works in most cases
S="${WORKDIR}/${VDRPLUGIN}-${PV}"
# depend on headers for DVB-driver
COMMON_DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2"
DEPEND="${COMMON_DEPEND}
virtual/linuxtv-dvb-headers"
RDEPEND="${COMMON_DEPEND}
>=app-eselect/eselect-vdr-0.0.2"
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then
IUSE="${IUSE} vdr"
DEPEND="vdr? ( ${DEPEND} )"
RDEPEND="vdr? ( ${RDEPEND} )"
fi
# New method of storing plugindb
# Called from src_install
# file maintained by normal portage-methods
create_plugindb_file() {
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
insinto "${NEW_VDRPLUGINDB_DIR}"
# BUG: portage-2.1.4_rc9 will delete the EBUILD= line, so we cannot use this code.
# cat <<-EOT > "${D}/${DB_FILE}"
# VDRPLUGIN_DB=1
# CREATOR=ECLASS
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
# obsolet? fix me later...
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
echo "EBUILD=${CATEGORY}/${PN}"
echo "EBUILD_V=${PVR}"
echo "PLUGINS=\"$@\""
} > "${D}/${DB_FILE}"
}
create_header_checksum_file() {
# Danger: Not using $ROOT here, as compile will also not use it !!!
# If vdr in $ROOT and / differ, plugins will not run anyway
local CHKSUM="header-md5-vdr"
if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then
cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}"
elif type -p md5sum >/dev/null 2>&1; then
(
cd "${VDR_INCLUDE_DIR}"
md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
) > "${CHKSUM}"
else
die "Could not create md5 checksum of headers"
fi
insinto "${VDR_CHECKSUM_DIR}"
local p_name
for p_name; do
newins "${CHKSUM}" "header-md5-${p_name}"
done
}
fix_vdr_libsi_include() {
dev_check "Fixing include of libsi-headers"
local f
for f; do
sed -i "${f}" \
-e '/#include/s:"\(.*libsi.*\)":<\1>:' \
-e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
done
}
vdr_patchmakefile() {
einfo "Patching Makefile"
[[ -e Makefile ]] || die "Makefile of plugin can not be found!"
cp Makefile "${WORKDIR}"/Makefile.before
# plugin makefiles use VDRDIR in strange ways
# assumptions:
# 1. $(VDRDIR) contains Make.config
# 2. $(VDRDIR) contains config.h
# 3. $(VDRDIR)/include/vdr contains the headers
# 4. $(VDRDIR) contains main vdr Makefile
# 5. $(VDRDIR)/locale exists
# 6. $(VDRDIR) allows to access vdr source files
#
# We only have one directory (for now /usr/include/vdr),
# that contains vdr-headers and Make.config.
# To satisfy 1-3 we do this:
# Set VDRDIR=/usr/include/vdr
# Set VDRINCDIR=/usr/include
# Change $(VDRDIR)/include to $(VDRINCDIR)
sed -i Makefile \
-e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
-e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \
-e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
\
-e 's:-I$(DVBDIR)/include::' \
-e 's:-I$(DVBDIR)::'
# may be needed for multiproto:
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
# obsolet? fix me later...
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
sed -i Makefile \
-e 's:^APIVERSION = :APIVERSION ?= :' \
-e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
-e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)'
eend $?
fi
# Correcting Compile-Flags
# Do not overwrite CXXFLAGS, add LDFLAGS if missing
sed -i Makefile \
-e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
-e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
# Disabling file stripping, the package manager takes care of it
sed -i Makefile \
-e '/@.*strip/d' \
-e '/strip \$(LIBDIR)\/\$@/d' \
-e 's/STRIP.*=.*$/STRIP = true/'
# Use a file instead of a variable as single-stepping via ebuild
# destroys environment.
touch "${WORKDIR}"/.vdr-plugin_makefile_patched
}
dev_check() {
# A lot useful debug infos
# set VDR_MAINTAINER_MODE="1" in make.conf
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
eerror "\t Gentoo Developer Debug: $@"
fi
}
gettext_missing() {
# plugins without converting to gettext
local GETTEXT_MISSING=$( grep xgettext Makefile )
if [[ -z ${GETTEXT_MISSING} ]]; then
dev_check "Plugin isn't converted to gettext handling \n"
fi
}
detect_po_dir() {
# helper function
[[ -f po ]] && local po_dir="${S}"
local po_subdir=( ${S}/${PO_SUBDIR} )
local f
pofile_dir=( ${po_dir} ${po_subdir[*]} )
}
linguas_support() {
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will be
# compiled and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
detect_po_dir
for f in ${pofile_dir[*]}; do
PLUGIN_LINGUAS=$( ls ${f}/po --ignore="*.pot" | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
einfo "LINGUAS=\"${PLUGIN_LINGUAS}\""
sed -i ${f}/Makefile \
-e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \
|| die "sed failed for Linguas"
done
strip-linguas ${PLUGIN_LINGUAS} en
}
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
# plugins will fail to compile because they're still using the old variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
gettext_missing
local I18N_OBJECT=$( grep i18n.o Makefile )
if [[ -n ${I18N_OBJECT} ]]; then
if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
dev_check "Forced to keep i18n.o"
else
sed -i "s:i18n.o::g" Makefile
dev_check "OBJECT i18n.o found"
dev_check "removed per sed \n"
fi
else
dev_check "OBJECT i18n.o not found in Makefile"
dev_check "all fine or manual review needed? \n"
fi
local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h )
if [[ -n ${I18N_STRING} ]]; then
sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h
dev_check "obsolete tI18nPhrase found"
dev_check "disabled per sed, please recheck \n"
else
dev_check "obsolete tI18nPhrase not found, fine..."
dev_check "please review, may be in subdir... \n"
fi
}
remove_i18n_include() {
# remove uneeded i18.n includes
local f
for f; do
sed -i "${f}" \
-e "s:^#include[[:space:]]*\"i18n.h\"://:"
done
dev_check "removed i18n.h include in ${@}"
}
vdr-plugin-2_print_enable_command() {
local p_name c=0 l=""
for p_name in ${vdr_plugin_list}; do
c=$(( c+1 ))
l="$l ${p_name#vdr-}"
done
elog
case $c in
1) elog "Installed plugin${l}" ;;
*) elog "Installed $c plugins:${l}" ;;
esac
elog "To activate a plugin execute this command:"
elog "\teselect vdr-plugin enable <plugin_name> ..."
elog
}
has_vdr() {
[[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
}
## exported functions
vdr-plugin-2_pkg_setup() {
# missing ${chost}- tag
tc-export CC CXX
# -fPIC is needed for shared objects on some platforms (amd64 and others)
append-flags -fPIC
# Plugins need to be compiled with position independent code, otherwise linking
# VDR against it will fail
# depricated if fi, as we have only >=vdr-2 in the tree, fix me later...
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
fi
# Where should the plugins live in the filesystem
VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
VDR_RC_DIR="/usr/share/vdr/rcscript"
# Pathes to includes
VDR_INCLUDE_DIR="/usr/include/vdr"
DVB_INCLUDE_DIR="/usr/include"
TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
LOCDIR=$(pkg-config --variable=locdir vdr)
if ! has_vdr; then
# set to invalid values to detect abuses
VDRVERSION="eclass_no_vdr_installed"
APIVERSION="eclass_no_vdr_installed"
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
einfo "VDR not found!"
else
# if vdr is required
die "VDR not found!"
fi
return
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}]"
if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
eerror "Please move all your patches into"
eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
die
fi
}
vdr-plugin-2_src_util() {
while [ "$1" ]; do
case "$1" in
all)
vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
;;
prepare)
vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
;;
unpack)
unpacker_src_unpack
;;
add_local_patch)
cd "${S}" || die "Could not change to plugin-source-directory!"
if [[ ${EAPI} == 6 ]]; then
eapply_user
else
epatch_user
fi
;;
patchmakefile)
cd "${S}" || die "Could not change to plugin-source-directory!"
vdr_patchmakefile
;;
i18n)
vdr_i18n
;;
linguas_patch)
linguas_support
;;
esac
shift
done
}
vdr-plugin-2_src_unpack() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_unpack not called!"
fi
if [ -z "$1" ]; then
vdr-plugin-2_src_util unpack
else
vdr-plugin-2_src_util $@
fi
}
vdr-plugin-2_src_prepare() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_prepare not called!"
fi
[[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
[[ ${EAPI} == "6" ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
}
vdr-plugin-2_src_compile() {
[ -z "$1" ] && vdr-plugin-2_src_compile compile
while [ "$1" ]; do
case "$1" in
compile)
if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without"
eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_compile not called!"
fi
cd "${S}"
emake all ${BUILD_PARAMS} \
LOCALEDIR="${TMP_LOCALE_DIR}" \
LOCDIR="${TMP_LOCALE_DIR}" \
LIBDIR="${S}" \
TMPDIR="${T}" \
|| die "emake all failed"
;;
esac
shift
done
}
vdr-plugin-2_src_install() {
if [[ -z ${VDR_INCLUDE_DIR} ]]; then
eerror "Wrong use of vdr-plugin-2.eclass."
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
echo
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_install not called!"
fi
cd "${WORKDIR}"
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
local mname="${P}-Makefile"
cp "${S}"/Makefile "${mname}.patched"
cp Makefile.before "${mname}.before"
diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
insinto "/usr/share/vdr/maintainer-data/makefile-changes"
doins "${mname}.diff"
insinto "/usr/share/vdr/maintainer-data/makefile-before"
doins "${mname}.before"
insinto "/usr/share/vdr/maintainer-data/makefile-patched"
doins "${mname}.patched"
fi
cd "${S}"
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
emake install \
${BUILD_PARAMS} \
TMPDIR="${T}" \
DESTDIR="${D}" \
|| die "emake install (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
doins libvdr-*.so.*
fi
if [[ -d ${TMP_LOCALE_DIR} ]]; then
einfo "Installing locales"
cd "${TMP_LOCALE_DIR}"
local linguas
for linguas in ${LINGUAS[*]}; do
insinto "${LOCDIR}"
cp -r --parents ${linguas}* ${D}/${LOCDIR}
done
fi
cd "${D}/usr/$(get_libdir)/vdr/plugins"
# create list of all created plugin libs
vdr_plugin_list=""
local p_name
for p in libvdr-*.so.*; do
p_name="${p%.so*}"
p_name="${p_name#lib}"
vdr_plugin_list="${vdr_plugin_list} ${p_name}"
done
cd "${S}"
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
local commondoc=( README* HISTORY CHANGELOG )
for docfile in "${commondoc[@]}"; do
if [[ ${EAPI} == "6" ]]; then
local DOCS="${DOCS} ${docfile}"
[[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
else
[[ -f ${docfile} ]] && dodoc ${docfile}
fi
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
[[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
if [[ -n ${VDR_CONFD_FILE} ]]; then
newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
fi
# if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
[[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
if [[ -n ${VDR_RCADDON_FILE} ]]; then
insinto "${VDR_RC_DIR}"
newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
fi
}
vdr-plugin-2_pkg_postinst() {
vdr-plugin-2_print_enable_command
if [[ -n "${VDR_CONFD_FILE}" ]]; then
elog "Please have a look at the config-file"
elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
elog
fi
}
vdr-plugin-2_pkg_postrm() {
:
}
vdr-plugin-2_pkg_config() {
:
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
2016-05-16 9:39 [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review Joerg Bornkessel
@ 2016-05-17 6:17 ` Michał Górny
2016-05-22 21:21 ` Joerg Bornkessel
0 siblings, 1 reply; 6+ messages in thread
From: Michał Górny @ 2016-05-17 6:17 UTC (permalink / raw
To: gentoo-dev, Joerg Bornkessel
Dnia 16 maja 2016 11:39:23 CEST, Joerg Bornkessel <hd_brummy@gentoo.org> napisał(a):
>Hallo,
>after my last commit disaster,
>i bring my changes to review before i break some things again.
>
>- Added changes to make it work with eapi=6
>- removed some unneeded code parts (never they was used in any
>ebuilds, i though they was integrated to make the eclass more
>flexibel,...)
After reading this I don't see anything breakingly wrong, though I haven't tested it.
However, a few general suggestions:
1. Split this into multiple commits. Generic cleanup should happen separately from EAPI 6 support. And it would probably be a good idea to remove features one at a time, so that reverting would be possible.
2. Prefer logic that evaluates to true for future EAPIs. For example, instead of [[ ${EAPI} == 6 ]], it's better to say != [012345], so that we won't have to extend the list with every new EAPI if nothing changes.
3. Please namespace the eclass functions. Using generic names is really asking for trouble. vdr_ prefix should be sufficient.
4. Please kill that src_util helper. It makes the logic terribly hard to follow, and there's really no reason to use case over separate functions.
5. There are some missing || die, for example after cd.
I'm sorry i can't really to specific parts of the eclass but I'm replying from a phone.
>
><snipp .diff>
>-- vdr-plugin-2.eclass 2016-05-15 22:03:21.807417485 +0200
>+++ vdr-plugin-2.eclass.new 2016-05-15 22:01:10.000000000 +0200
>@@ -1,4 +1,4 @@
>-# Copyright 1999-2015 Gentoo Foundation
>+# Copyright 1999-2016 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Id$
>
>@@ -90,7 +90,7 @@
> # @CODE
>
> # Applying your own local/user patches:
>-# This is done by using the
>+# 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:
>@@ -104,10 +104,7 @@
> inherit flag-o-matic toolchain-funcs unpacker
>
> case ${EAPI:-0} in
>- 4|5)
>- ;;
>- 6)
>- ewarn "EAPI 6 support for test purpose only, plz report bugs to
>vdr@gentoo.org"
>+ 4|5|6)
> ;;
> *) die "EAPI ${EAPI} unsupported."
> ;;
>@@ -156,6 +153,7 @@
> # EBUILD=${CATEGORY}/${PN}
> # EBUILD_V=${PVR}
> # EOT
>+# obsolet? fix me later...
> {
> echo "VDRPLUGIN_DB=1"
> echo "CREATOR=ECLASS"
>@@ -232,6 +230,7 @@
> #sed -i Makefile \
> # -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
> # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
>+ # obsolet? fix me later...
>
> if ! grep -q APIVERSION Makefile; then
> ebegin " Converting to APIVERSION"
>@@ -289,7 +288,7 @@
> linguas_support() {
> # Patching Makefile for linguas support.
># Only locales, enabled through the LINGUAS (make.conf) variable will
>be
>-# "compiled" and installed.
>+# compiled and installed.
>
> einfo "Patching for Linguas support"
> einfo "available Languages for ${P} are:"
>@@ -311,12 +310,9 @@
> vdr_i18n() {
> # i18n handling was deprecated since >=media-video/vdr-1.5.9,
> # finally with >=media-video/vdr-1.7.27 it has been dropped entirely
>and some
>-# plugins will fail to "compile" because they're still using the old
>variant.
>+# plugins will fail to compile because they're still using the old
>variant.
> # Simply remove the i18n.o object from Makefile (OBJECT) and
> # remove "static const tI18nPhrase*" from i18n.h.
>-#
>-# Plugins that are still using the old method will be pmasked until
>they're
>-# fixed or in case of maintainer timeout they'll be masked for
>removal.
>
> gettext_missing
>
>@@ -391,6 +387,7 @@
>
> # Plugins need to be compiled with position independent code,
>otherwise linking
> # VDR against it will fail
>+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me
>later...
> if has_version ">=media-video/vdr-1.7.13"; then
> append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>-D_LARGEFILE64_SOURCE
> fi
>@@ -500,7 +497,9 @@
> die "vdr-plugin-2_src_prepare not called!"
> fi
>
>- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
>+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch
>"${PATCHES[@]}"
>+ [[ ${EAPI} == "6" ]] && [[ ${PATCHES[@]} ]] && eapply
>"${PATCHES[@]}"
>+
> debug-print "$FUNCNAME: applying user patches"
>
> vdr-plugin-2_src_util prepare
>@@ -522,14 +521,12 @@
> fi
> cd "${S}"
>
>- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all
>}}
>- emake ${BUILD_PARAMS} \
>- ${BUILD_TARGETS} \
>- LOCALEDIR="${TMP_LOCALE_DIR}" \
>- LOCDIR="${TMP_LOCALE_DIR}" \
>- LIBDIR="${S}" \
>- TMPDIR="${T}" \
>- || die "emake failed"
>+ emake all ${BUILD_PARAMS} \
>+ LOCALEDIR="${TMP_LOCALE_DIR}" \
>+ LOCDIR="${TMP_LOCALE_DIR}" \
>+ LIBDIR="${S}" \
>+ TMPDIR="${T}" \
>+ || die "emake all failed"
> ;;
> esac
>
>@@ -570,12 +567,11 @@
>
> local SOFILE_STRING=$(grep SOFILE Makefile)
> if [[ -n ${SOFILE_STRING} ]]; then
>- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install
>}}
>- einstall ${BUILD_PARAMS} \
>- ${BUILD_TARGETS} \
>- TMPDIR="${T}" \
>- DESTDIR="${D}" \
>- || die "einstall (makefile target) failed"
>+ emake install \
>+ ${BUILD_PARAMS} \
>+ TMPDIR="${T}" \
>+ DESTDIR="${D}" \
>+ || die "emake install (makefile target) failed"
> else
> dev_check "Plugin use still the old Makefile handling"
> insinto "${VDR_PLUGIN_DIR}"
>@@ -609,9 +605,14 @@
> create_header_checksum_file ${vdr_plugin_list}
> create_plugindb_file ${vdr_plugin_list}
>
>- local docfile
>- for docfile in README* HISTORY CHANGELOG; do
>- [[ -f ${docfile} ]] && dodoc ${docfile}
>+ local commondoc=( README* HISTORY CHANGELOG )
>+ for docfile in "${commondoc[@]}"; do
>+ if [[ ${EAPI} == "6" ]]; then
>+ local DOCS="${DOCS} ${docfile}"
>+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
>+ else
>+ [[ -f ${docfile} ]] && dodoc ${docfile}
>+ fi
> done
>
> # if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
></snapp>
>
>Attached:
>vdr-plugin-2.eclass
>vdr-plugin-2.eclass.diff
>vdr-plugin-2.eclass.new
>
>
>Cheers
>/dev/joerg
--
Best regards,
Michał Górny (by phone)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
2016-05-17 6:17 ` Michał Górny
@ 2016-05-22 21:21 ` Joerg Bornkessel
2016-05-26 9:16 ` Michał Górny
0 siblings, 1 reply; 6+ messages in thread
From: Joerg Bornkessel @ 2016-05-22 21:21 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 10638 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Am 17.05.2016 um 08:17 schrieb Michał Górny:
> However, a few general suggestions:
>
> 1. Split this into multiple commits. Generic cleanup should happen
> separately from EAPI 6 support. And it would probably be a good
> idea to remove features one at a time, so that reverting would be
> possible.
its my plan, step by step
>
> 2. Prefer logic that evaluates to true for future EAPIs. For
> example, instead of [[ ${EAPI} == 6 ]], it's better to say !=
> [012345], so that we won't have to extend the list with every new
> EAPI if nothing changes.
done
>
> 3. Please namespace the eclass functions. Using generic names is
> really asking for trouble. vdr_ prefix should be sufficient.
ToDo
>
> 4. Please kill that src_util helper. It makes the logic terribly
> hard to follow, and there's really no reason to use case over
> separate functions.
yepp, this takes my also a lot of headattack by the rewrite from
vdr-plugin to vdr-plugin-2 eclass
ToDo...
>
> 5. There are some missing || die, for example after cd.
done
<snipp 2nd review>
- --- vdr-plugin-2.eclass 2016-05-22 22:27:12.081956660 +0200
+++ vdr-plugin-2.eclass.new 2016-05-22 23:10:11.908404939 +0200
@@ -1,4 +1,4 @@
- -# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -90,7 +90,7 @@
# @CODE
# Applying your own local/user patches:
- -# This is done by using the
+# 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:
@@ -104,10 +104,7 @@
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
- - 4|5)
- - ;;
- - 6)
- - ewarn "EAPI 6 support for test purpose only, plz report bugs to
vdr@gentoo.org"
+ 4|5|6)
;;
*) die "EAPI ${EAPI} unsupported."
;;
@@ -145,6 +142,7 @@
# Called from src_install
# file maintained by normal portage-methods
create_plugindb_file() {
+ #ToDo: rename this to vdr_...
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
insinto "${NEW_VDRPLUGINDB_DIR}"
@@ -156,6 +154,7 @@
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
+# obsolet? fix me later...
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
@@ -166,6 +165,7 @@
}
create_header_checksum_file() {
+ #ToDo: rename this to vdr_...
# Danger: Not using $ROOT here, as compile will also not use it !!!
# If vdr in $ROOT and / differ, plugins will not run anyway
@@ -232,6 +232,7 @@
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
+ # obsolet? fix me later...
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
@@ -260,6 +261,7 @@
}
dev_check() {
+ # ToDo: rename this to vdr_...; IMPORTANT: check availabel
plugins, if we use this function in the tree...
# A lot useful debug infos
# set VDR_MAINTAINER_MODE="1" in make.conf
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
@@ -268,6 +270,7 @@
}
gettext_missing() {
+ #ToDo: remane this to vdr_...
# plugins without converting to gettext
local GETTEXT_MISSING=$( grep xgettext Makefile )
@@ -277,6 +280,7 @@
}
detect_po_dir() {
+ # ToDo: remane this to vdr_...
# helper function
[[ -f po ]] && local po_dir="${S}"
@@ -287,9 +291,10 @@
}
linguas_support() {
+ # ToDo: remane this to vdr_...
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will
be
- -# "compiled" and installed.
+# compiled and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
@@ -311,12 +316,9 @@
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely
and some
- -# plugins will fail to "compile" because they're still using the old
variant.
+# plugins will fail to compile because they're still using the old
variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
- -#
- -# Plugins that are still using the old method will be pmasked until
they're
- -# fixed or in case of maintainer timeout they'll be masked for removal
.
gettext_missing
@@ -348,6 +350,7 @@
}
remove_i18n_include() {
+ # ToDo: rename this to vdr_...; IMPORTANT!!! We use this in the tree
# remove uneeded i18.n includes
local f
@@ -391,6 +394,7 @@
# Plugins need to be compiled with position independent code,
otherwise linking
# VDR against it will fail
+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me
later...
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
- -D_LARGEFILE64_SOURCE
fi
@@ -452,15 +456,15 @@
unpacker_src_unpack
;;
add_local_patch)
- - cd "${S}" || die "Could not change to
plugin-source-directory!"
- - if [[ ${EAPI} == 6 ]]; then
+ cd "${S}" || die "Could not change to
plugin-source-directory (src_util)"
+ if [[ ${EAPI} != [45] ]]; then
eapply_user
else
epatch_user
fi
;;
patchmakefile)
- - cd "${S}" || die "Could not change to
plugin-source-directory!"
+ cd "${S}" || die "Could not change to
plugin-source-directory (src_util)"
vdr_patchmakefile
;;
i18n)
@@ -500,7 +504,9 @@
die "vdr-plugin-2_src_prepare not called!"
die "vdr-plugin-2_src_prepare not called!"
fi
- - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]
}"
+ [[ ${EAPI} != [45] ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]
}"
+
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
@@ -520,16 +526,14 @@
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_compile not called!"
fi
- - cd "${S}"
+ cd "${S}" || die "could not change to plugin source
directory (src_compile)"
- - BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all
}}
- - emake ${BUILD_PARAMS} \
- - ${BUILD_TARGETS} \
- - LOCALEDIR="${TMP_LOCALE_DIR}" \
- - LOCDIR="${TMP_LOCALE_DIR}" \
- - LIBDIR="${S}" \
- - TMPDIR="${T}" \
- - || die "emake failed"
+ emake all ${BUILD_PARAMS} \
+ LOCALEDIR="${TMP_LOCALE_DIR}" \
+ LOCDIR="${TMP_LOCALE_DIR}" \
+ LIBDIR="${S}" \
+ TMPDIR="${T}" \
+ || die "emake all failed"
;;
esac
@@ -546,7 +550,7 @@
die "vdr-plugin-2_src_install not called!"
fi
- - cd "${WORKDIR}"
+ cd "${WORKDIR}" || die "could not change to plugin workdir
directory (src_install)"
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
local mname="${P}-Makefile"
@@ -566,16 +570,15 @@
fi
- - cd "${S}"
+ cd "${S}" || die "could not change to plugin source directory
(src_install)"
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
- - BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install
}}
- - einstall ${BUILD_PARAMS} \
- - ${BUILD_TARGETS} \
- - TMPDIR="${T}" \
- - DESTDIR="${D}" \
- - || die "einstall (makefile target) failed"
+ emake install \
+ ${BUILD_PARAMS} \
+ TMPDIR="${T}" \
+ DESTDIR="${D}" \
+ || die "emake install (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
@@ -584,7 +587,7 @@
if [[ -d ${TMP_LOCALE_DIR} ]]; then
einfo "Installing locales"
- - cd "${TMP_LOCALE_DIR}"
+ cd "${TMP_LOCALE_DIR}" || die "could not change to TMP_LOCALE_DI
R"
local linguas
for linguas in ${LINGUAS[*]}; do
@@ -593,7 +596,7 @@
done
fi
- - cd "${D}/usr/$(get_libdir)/vdr/plugins"
+ cd "${D}/usr/$(get_libdir)/vdr/plugins" || die "could not change
to D/usr/libdir/vdr/plugins"
# create list of all created plugin libs
vdr_plugin_list=""
@@ -604,14 +607,19 @@
vdr_plugin_list="${vdr_plugin_list} ${p_name}"
done
- - cd "${S}"
+ cd "${S}" || die "could not change to plugin source directory
(src_install)"
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
- - local docfile
- - for docfile in README* HISTORY CHANGELOG; do
- - [[ -f ${docfile} ]] && dodoc ${docfile}
+ local commondoc=( README* HISTORY CHANGELOG )
+ for docfile in "${commondoc[@]}"; do
+ if [[ ${EAPI} == "6" ]]; then
+ local DOCS="${DOCS} ${docfile}"
+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
+ else
+ [[ -f ${docfile} ]] && dodoc ${docfile}
+ fi
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
</snapp>
Regards
/dev/joerg
- --
Joerg Bornkessel <hd_brummy@gentoo.org>
GnuPG Key: 0x93EB5F4DAA5832A1
Fingerprint: 0E0A A1EE 1DF4 41D7 A3F5 21C2 93EB 5F4D AA58 32A1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.1
Comment: Signed-off-by: Jörg Bornkessel <hd_brummy@gentoo.org>
iQJ8BAEBCgBmBQJXQiLtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRTBBQTFFRTFERjQ0MUQ3QTNGNTIxQzI5
M0VCNUY0REFBNTgzMkExAAoJEJPrX02qWDKhQXcP/jNRQr/6Q5Jb6UEvR8pSXI52
Xgl33SMwVtN8eckVYBH3E/xwV82QhJ3QnPqGasFPdnOT/fZBw9rHP8fHCrW+lXlg
LcGicaEgWj7ZuE77PA4Vo44LrAhL2DHgLSnU20BPvOaDtVBY9bwTQPuzTzfg0mrz
kNo1eJPh8Ptsqn89AJqegs14uRulrYAMsQVNty/X7vkZxv237J0lhqN+wNoJRpON
NisWqPJl2ENq1fZaLakCneC9ghjeJytu8+5YNTW5fjfAAWcyXMIjtxgIcjBZb/TE
jAek3uJhivDfykRq9v07G+s125kNel48cK6tR09A24JTtzW4govA+0p7P+KYVt38
bLxFGqgNEkevFgZ9w8y0zg3keYo6sjTWcijmQ1InXX9Yn4NgbiabX2Xh2i4OAbNS
g0E9TGUZ+MGhCgq2PC8BRPgzPMyCsq1iZM4C1Q3zVvFyj6AF2Hh6kRUMXVHyUhUi
BERo2xZNr9WZFki6yXASKVvpUNbWbuhtyk21Wo7rPr+yBhx0zTNjnAMglTWJ1FQE
N0xNp9EDUkU18OgRiNgYi57a2shf9xxYULKBFowUVeJ6t4DlYUx9HnTmaVR9F4HI
1xzUIVjkA2LU2Vx57DGZV3ZwjyVca/OfbwiTmNr/J0e25oIVseH4exUBYlaucuM0
JResc4NvRm6T+uLS6g9x
=o4K0
-----END PGP SIGNATURE-----
[-- Attachment #2: vdr-plugin-2.eclass.diff --]
[-- Type: text/plain, Size: 7519 bytes --]
--- vdr-plugin-2.eclass 2016-05-22 22:27:12.081956660 +0200
+++ vdr-plugin-2.eclass.new 2016-05-22 23:10:11.908404939 +0200
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -90,7 +90,7 @@
# @CODE
# Applying your own local/user patches:
-# This is done by using the
+# 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:
@@ -104,10 +104,7 @@
inherit flag-o-matic toolchain-funcs unpacker
case ${EAPI:-0} in
- 4|5)
- ;;
- 6)
- ewarn "EAPI 6 support for test purpose only, plz report bugs to vdr@gentoo.org"
+ 4|5|6)
;;
*) die "EAPI ${EAPI} unsupported."
;;
@@ -145,6 +142,7 @@
# Called from src_install
# file maintained by normal portage-methods
create_plugindb_file() {
+ #ToDo: rename this to vdr_...
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
insinto "${NEW_VDRPLUGINDB_DIR}"
@@ -156,6 +154,7 @@
# EBUILD=${CATEGORY}/${PN}
# EBUILD_V=${PVR}
# EOT
+# obsolet? fix me later...
{
echo "VDRPLUGIN_DB=1"
echo "CREATOR=ECLASS"
@@ -166,6 +165,7 @@
}
create_header_checksum_file() {
+ #ToDo: rename this to vdr_...
# Danger: Not using $ROOT here, as compile will also not use it !!!
# If vdr in $ROOT and / differ, plugins will not run anyway
@@ -232,6 +232,7 @@
#sed -i Makefile \
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
+ # obsolet? fix me later...
if ! grep -q APIVERSION Makefile; then
ebegin " Converting to APIVERSION"
@@ -260,6 +261,7 @@
}
dev_check() {
+ # ToDo: rename this to vdr_...; IMPORTANT: check availabel plugins, if we use this function in the tree...
# A lot useful debug infos
# set VDR_MAINTAINER_MODE="1" in make.conf
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
@@ -268,6 +270,7 @@
}
gettext_missing() {
+ #ToDo: remane this to vdr_...
# plugins without converting to gettext
local GETTEXT_MISSING=$( grep xgettext Makefile )
@@ -277,6 +280,7 @@
}
detect_po_dir() {
+ # ToDo: remane this to vdr_...
# helper function
[[ -f po ]] && local po_dir="${S}"
@@ -287,9 +291,10 @@
}
linguas_support() {
+ # ToDo: remane this to vdr_...
# Patching Makefile for linguas support.
# Only locales, enabled through the LINGUAS (make.conf) variable will be
-# "compiled" and installed.
+# compiled and installed.
einfo "Patching for Linguas support"
einfo "available Languages for ${P} are:"
@@ -311,12 +316,9 @@
vdr_i18n() {
# i18n handling was deprecated since >=media-video/vdr-1.5.9,
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
-# plugins will fail to "compile" because they're still using the old variant.
+# plugins will fail to compile because they're still using the old variant.
# Simply remove the i18n.o object from Makefile (OBJECT) and
# remove "static const tI18nPhrase*" from i18n.h.
-#
-# Plugins that are still using the old method will be pmasked until they're
-# fixed or in case of maintainer timeout they'll be masked for removal.
gettext_missing
@@ -348,6 +350,7 @@
}
remove_i18n_include() {
+ # ToDo: rename this to vdr_...; IMPORTANT!!! We use this in the tree
# remove uneeded i18.n includes
local f
@@ -391,6 +394,7 @@
# Plugins need to be compiled with position independent code, otherwise linking
# VDR against it will fail
+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me later...
if has_version ">=media-video/vdr-1.7.13"; then
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
fi
@@ -452,15 +456,15 @@
unpacker_src_unpack
;;
add_local_patch)
- cd "${S}" || die "Could not change to plugin-source-directory!"
- if [[ ${EAPI} == 6 ]]; then
+ cd "${S}" || die "Could not change to plugin-source-directory (src_util)"
+ if [[ ${EAPI} != [45] ]]; then
eapply_user
else
epatch_user
fi
;;
patchmakefile)
- cd "${S}" || die "Could not change to plugin-source-directory!"
+ cd "${S}" || die "Could not change to plugin-source-directory (src_util)"
vdr_patchmakefile
;;
i18n)
@@ -500,7 +504,9 @@
die "vdr-plugin-2_src_prepare not called!"
fi
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+ [[ ${EAPI} != [45] ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
+
debug-print "$FUNCNAME: applying user patches"
vdr-plugin-2_src_util prepare
@@ -520,16 +526,14 @@
eerror "Please report this at bugs.gentoo.org."
die "vdr-plugin-2_src_compile not called!"
fi
- cd "${S}"
+ cd "${S}" || die "could not change to plugin source directory (src_compile)"
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
- emake ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- LOCALEDIR="${TMP_LOCALE_DIR}" \
- LOCDIR="${TMP_LOCALE_DIR}" \
- LIBDIR="${S}" \
- TMPDIR="${T}" \
- || die "emake failed"
+ emake all ${BUILD_PARAMS} \
+ LOCALEDIR="${TMP_LOCALE_DIR}" \
+ LOCDIR="${TMP_LOCALE_DIR}" \
+ LIBDIR="${S}" \
+ TMPDIR="${T}" \
+ || die "emake all failed"
;;
esac
@@ -546,7 +550,7 @@
die "vdr-plugin-2_src_install not called!"
fi
- cd "${WORKDIR}"
+ cd "${WORKDIR}" || die "could not change to plugin workdir directory (src_install)"
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
local mname="${P}-Makefile"
@@ -566,16 +570,15 @@
fi
- cd "${S}"
+ cd "${S}" || die "could not change to plugin source directory (src_install)"
local SOFILE_STRING=$(grep SOFILE Makefile)
if [[ -n ${SOFILE_STRING} ]]; then
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
- einstall ${BUILD_PARAMS} \
- ${BUILD_TARGETS} \
- TMPDIR="${T}" \
- DESTDIR="${D}" \
- || die "einstall (makefile target) failed"
+ emake install \
+ ${BUILD_PARAMS} \
+ TMPDIR="${T}" \
+ DESTDIR="${D}" \
+ || die "emake install (makefile target) failed"
else
dev_check "Plugin use still the old Makefile handling"
insinto "${VDR_PLUGIN_DIR}"
@@ -584,7 +587,7 @@
if [[ -d ${TMP_LOCALE_DIR} ]]; then
einfo "Installing locales"
- cd "${TMP_LOCALE_DIR}"
+ cd "${TMP_LOCALE_DIR}" || die "could not change to TMP_LOCALE_DIR"
local linguas
for linguas in ${LINGUAS[*]}; do
@@ -593,7 +596,7 @@
done
fi
- cd "${D}/usr/$(get_libdir)/vdr/plugins"
+ cd "${D}/usr/$(get_libdir)/vdr/plugins" || die "could not change to D/usr/libdir/vdr/plugins"
# create list of all created plugin libs
vdr_plugin_list=""
@@ -604,14 +607,19 @@
vdr_plugin_list="${vdr_plugin_list} ${p_name}"
done
- cd "${S}"
+ cd "${S}" || die "could not change to plugin source directory (src_install)"
create_header_checksum_file ${vdr_plugin_list}
create_plugindb_file ${vdr_plugin_list}
- local docfile
- for docfile in README* HISTORY CHANGELOG; do
- [[ -f ${docfile} ]] && dodoc ${docfile}
+ local commondoc=( README* HISTORY CHANGELOG )
+ for docfile in "${commondoc[@]}"; do
+ if [[ ${EAPI} == "6" ]]; then
+ local DOCS="${DOCS} ${docfile}"
+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
+ else
+ [[ -f ${docfile} ]] && dodoc ${docfile}
+ fi
done
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
2016-05-22 21:21 ` Joerg Bornkessel
@ 2016-05-26 9:16 ` Michał Górny
2016-05-29 16:49 ` Joerg Bornkessel
0 siblings, 1 reply; 6+ messages in thread
From: Michał Górny @ 2016-05-26 9:16 UTC (permalink / raw
To: Joerg Bornkessel; +Cc: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]
Since you already committed it with all the todos inside, just
the important thing.
On Sun, 22 May 2016 23:21:59 +0200
Joerg Bornkessel <hd_brummy@gentoo.org> wrote:
> - - local docfile
> - - for docfile in README* HISTORY CHANGELOG; do
> - - [[ -f ${docfile} ]] && dodoc ${docfile}
> + local commondoc=( README* HISTORY CHANGELOG )
> + for docfile in "${commondoc[@]}"; do
> + if [[ ${EAPI} == "6" ]]; then
> + local DOCS="${DOCS} ${docfile}"
> + [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
> + else
> + [[ -f ${docfile} ]] && dodoc ${docfile}
> + fi
I have no clue what you're trying to achieve here but following
the EAPI 6 branch, this is what would happen:
| local commondoc=( README* HISTORY CHANGELOG )
1. Let's assume commondoc evaluates to ( README HISTORY CHANGELOG ).
| local DOCS="${DOCS} ${docfile}"
2. If DOCS was an array, you discard all but the first element. But
let's assume it was empty, so it becomes: DOCS=" README".
| [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
3. If README exists, einstalldocs is called. Depending on
the implementation, it will either install all files from DOCS, or fail
because you pass unexpected parameters.
| local DOCS="${DOCS} ${docfile}"
4. Now we have DOCS=" README HISTORY".
| [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
5. HISTORY doesn't exist, so nothing happens.
| local DOCS="${DOCS} ${docfile}"
6. Now we have DOCS=" README HISTORY CHANGELOG".
| [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}"
7. CHANGELOG exists, so einstalldocs is called to install all *three*
files. It fails because HISTORY that got appended before doesn't exist.
That's one possible scenario. I'm pretty sure you didn't want
einstalldocs here, or needed a special EAPI 6 branch. dodoc still works
as usual.
--
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
2016-05-26 9:16 ` Michał Górny
@ 2016-05-29 16:49 ` Joerg Bornkessel
2016-05-29 17:21 ` Michał Górny
0 siblings, 1 reply; 6+ messages in thread
From: Joerg Bornkessel @ 2016-05-29 16:49 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Am 26.05.2016 um 11:16 schrieb Michał Górny:
> Since you already committed it with all the todos inside, just the
> important thing.
>
> On Sun, 22 May 2016 23:21:59 +0200 Joerg Bornkessel
> <hd_brummy@gentoo.org> wrote:
>
>> - - local docfile - - for docfile in README* HISTORY
>> CHANGELOG; do - - [[ -f ${docfile} ]] && dodoc ${docfile} +
>> local commondoc=( README* HISTORY CHANGELOG ) + for docfile in
>> "${commondoc[@]}"; do + if [[ ${EAPI} == "6" ]]; then +
>> local DOCS="${DOCS} ${docfile}" + [[ -f ${docfile} ]]
>> && einstalldocs "${DOCS[@]}" + else + [[ -f
>> ${docfile} ]] && dodoc ${docfile} + fi
>
> I have no clue what you're trying to achieve ...
Oh please, forget this crap!
After rereading einstalldocs, how it works and how is it to handle in
.ebuild, here my simple rewrite to integrate it in EAPI=6
<snipp>
if [[ ${EAPI} != [45] ]]; then
einstalldocs
else
local docfile
for docfile in README* HISTORY CHANGELOG; do
[[ -f ${docfile} ]] && dodoc ${docfile}
done
fi
</snapp>
yepp, einstalldocs is supported in EAPI=5 from eutils.eclass too,
but i will leave it untached as we use it in this way for EAPI=4,5
since long time.
So we are save in the existing eapi=4,5 supported ebuilds in the tree.
Thanks for your review and reply
Cheers
/dev/joerg
- --
Joerg Bornkessel <hd_brummy@gentoo.org>
GnuPG Key: 0x93EB5F4DAA5832A1
Fingerprint: 0E0A A1EE 1DF4 41D7 A3F5 21C2 93EB 5F4D AA58 32A1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.1
Comment: Signed-off-by: Jörg Bornkessel <hd_brummy@gentoo.org>
iQJ8BAEBCgBmBQJXSx2JXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRTBBQTFFRTFERjQ0MUQ3QTNGNTIxQzI5
M0VCNUY0REFBNTgzMkExAAoJEJPrX02qWDKhRsIP/3+PiGzWmlWfns0THCVjM2cb
xstNG7P+qKSFyWD9tgmSeGLsp590wh8bDBh8LWGfEPayYgal5ps1FeEdSS+syND6
fBk8QcBBZlPUSupg4f0sNsOmOguvXDhYz8u9PX2yfbTWAiOSWQcjUyvzU2FascrZ
bsCDhpEbDFbjS/vZJs52XCQhxU3WTFzchdn1+87JxDGslyMFe5+DojbDYeJLmkPK
9EeZ938PRAuaVNd28fE9A8YbueP59vvtL4oyTab/sWRv/FXsuFJbPlTd2+pOTYWJ
EVRvQ9kUiHR+PX3T1m5m8KGa8ZEKR5O/2ibcwI8jlSpOM287/rypujjT+pycpz8A
yQ+CF8L8g/SQZRyl3GAYrA/FhHRHXXskbBQOrELk+PywXS/7ccSIV+ySWdawf8UV
gItXrWaFZDD6TjG08oXdp5IC1yMh2Vzna7GTPXUoYHJnDp4aZj6ZX0Z+zRRvSIGG
MXRYsOMfpPWQOxpczD+oMuC973tv+Psr0c8gisKmK8ZEtdqVj2ZVtRRg/Jig7RhH
qAmxMBVhxAYe8m/vSRfJC4zT2GmSZLbFAOKoy5r0Gc5t/PVvHDax2Ku46SpMuWSr
gaWOcKTyZC+ynazduEIj4ZNKZhDEWnVx+OjcIVwPDV4cxRiHFVr2tuQK1Un8JXsu
8tuGDeoMd24HPEjuD5JA
=oSFD
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review
2016-05-29 16:49 ` Joerg Bornkessel
@ 2016-05-29 17:21 ` Michał Górny
0 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2016-05-29 17:21 UTC (permalink / raw
To: Joerg Bornkessel; +Cc: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]
On Sun, 29 May 2016 18:49:22 +0200
Joerg Bornkessel <hd_brummy@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Am 26.05.2016 um 11:16 schrieb Michał Górny:
> > Since you already committed it with all the todos inside, just the
> > important thing.
> >
> > On Sun, 22 May 2016 23:21:59 +0200 Joerg Bornkessel
> > <hd_brummy@gentoo.org> wrote:
> >
> >> - - local docfile - - for docfile in README* HISTORY
> >> CHANGELOG; do - - [[ -f ${docfile} ]] && dodoc ${docfile} +
> >> local commondoc=( README* HISTORY CHANGELOG ) + for docfile in
> >> "${commondoc[@]}"; do + if [[ ${EAPI} == "6" ]]; then +
> >> local DOCS="${DOCS} ${docfile}" + [[ -f ${docfile} ]]
> >> && einstalldocs "${DOCS[@]}" + else + [[ -f
> >> ${docfile} ]] && dodoc ${docfile} + fi
> >
> > I have no clue what you're trying to achieve ...
>
>
> Oh please, forget this crap!
> After rereading einstalldocs, how it works and how is it to handle in
> .ebuild, here my simple rewrite to integrate it in EAPI=6
>
> <snipp>
>
> if [[ ${EAPI} != [45] ]]; then
> einstalldocs
> else
> local docfile
> for docfile in README* HISTORY CHANGELOG; do
> [[ -f ${docfile} ]] && dodoc ${docfile}
> done
> fi
>
> </snapp>
>
> yepp, einstalldocs is supported in EAPI=5 from eutils.eclass too,
> but i will leave it untached as we use it in this way for EAPI=4,5
> since long time.
> So we are save in the existing eapi=4,5 supported ebuilds in the tree.
>
> Thanks for your review and reply
Yes, this looks good (except for the misindent). Thanks a lot.
--
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-05-29 17:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-16 9:39 [gentoo-dev] eclass/vdr-plugin-2.eclass EAPI=6 changes, plz review Joerg Bornkessel
2016-05-17 6:17 ` Michał Górny
2016-05-22 21:21 ` Joerg Bornkessel
2016-05-26 9:16 ` Michał Górny
2016-05-29 16:49 ` Joerg Bornkessel
2016-05-29 17:21 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox