Am 27.06.21 um 20:57 schrieb Ulrich Mueller:
> [Either your mailer or something on the way has mangled whitespace in
> your patch, which makes it somewhat hard to read.]

Okay... not good, I will add the patchfile as attachment now.

>> --- a/eclass/vdr-plugin-2.eclass
>> +++ b/eclass/vdr-plugin-2.eclass
>> @@ -76,7 +76,7 @@
>>  inherit flag-o-matic toolchain-funcs unpacker
> This should also inherit strip-linguas.eclass, because strip-linguas is
> called in vdr_linguas_support().
>
> Also, while at it, could you remove the useless IUSE="" assignment in
> line 87?

Okay, I understand. I did not notice the call to "strip-linguas", and
I'm wondering how this could have worked all the years in the past.

Unfortunately "pkgcheck" does not report this.

All changes are applied.


Bye

Martin



From a34b8547accafbc8e658d05fd389f5714c35dcb8 Mon Sep 17 00:00:00 2001
From: Martin Dummer <martin.dum...@gmx.net>
Date: Sun, 27 Jun 2021 17:05:23 +0200
Subject: [PATCH] vdr-plugin-2.eclass: add EAPI8 support, EAPI7+ fixes

- add EAPI8 support, no changes necessary
- add BDEPEND=pkgconfig
- remove outdated version numbers from (R)DEPEND
- fix calling of pkg-config
- add many "|| die" which should have been here already for EAPI7

Signed-off-by: Martin Dummer <martin.dum...@gmx.net>
---
 eclass/vdr-plugin-2.eclass | 57 +++++++++++++++++++++-----------------
 1 file changed, 32 insertions(+), 25 deletions(-)

diff --git a/eclass/vdr-plugin-2.eclass b/eclass/vdr-plugin-2.eclass
index 3f3acc41208..6bd3a1fbff0 100644
--- a/eclass/vdr-plugin-2.eclass
+++ b/eclass/vdr-plugin-2.eclass
@@ -73,10 +73,10 @@
 
 [[ ${EAPI} == [5] ]] && inherit multilib
 [[ ${EAPI} == [56] ]] && inherit eutils
-inherit flag-o-matic toolchain-funcs unpacker
+inherit flag-o-matic strip-linguas toolchain-funcs unpacker
 
 case ${EAPI:-0} in
-	5|6|7)
+	5|6|7|8)
 	;;
 	*) die "EAPI ${EAPI} unsupported."
 	;;
@@ -84,8 +84,6 @@ 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-/}"
@@ -97,10 +95,11 @@ DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin-2.eclass)"
 S="${WORKDIR}/${VDRPLUGIN}-${PV}"
 
 # depend on headers for DVB-driver and vdr-scripts
-DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2
+BDEPEND="dev-util/pkgconfig"
+DEPEND="media-tv/gentoo-vdr-scripts
 	virtual/linuxtv-dvb-headers"
-RDEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2
-	>=app-eselect/eselect-vdr-0.0.2"
+RDEPEND="media-tv/gentoo-vdr-scripts
+	app-eselect/eselect-vdr"
 
 if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then
 	IUSE="${IUSE} vdr"
@@ -151,7 +150,7 @@ vdr_create_header_checksum_file() {
 	local CHKSUM="header-md5-vdr"
 
 	if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then
-		cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}"
+		cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}" || die "Could not copy header-md5-vdr"
 	elif type -p md5sum >/dev/null 2>&1; then
 		(
 			cd "${VDR_INCLUDE_DIR}"
@@ -179,7 +178,8 @@ fix_vdr_libsi_include() {
 	for f; do
 		sed -i "${f}" \
 			-e '/#include/s:"\(.*libsi.*\)":<\1>:' \
-			-e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
+			-e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:' \
+			|| die "sed failed while fixing include of libsi-headers"
 	done
 }
 
@@ -192,7 +192,7 @@ fix_vdr_libsi_include() {
 vdr_patchmakefile() {
 	einfo "Patching Makefile"
 	[[ -e Makefile ]] || die "Makefile of plugin can not be found!"
-	cp Makefile "${WORKDIR}"/Makefile.before
+	cp Makefile "${WORKDIR}"/Makefile.before || die "Failed to copy Makefile"
 
 	# plugin makefiles use VDRDIR in strange ways
 	# assumptions:
@@ -216,14 +216,16 @@ vdr_patchmakefile() {
 		-e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
 		\
 		-e 's:-I$(DVBDIR)/include::' \
-		-e 's:-I$(DVBDIR)::'
+		-e 's:-I$(DVBDIR)::' \
+		|| die "sed failed to set \$VDRDIR"
 
 	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)'
+			-e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)' \
+			|| die "sed failed to change APIVERSION"
 		eend $?
 	fi
 
@@ -231,13 +233,15 @@ vdr_patchmakefile() {
 	# Do not overwrite CXXFLAGS, add LDFLAGS if missing
 	sed -i Makefile \
 		-e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
-		-e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
+		-e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:' \
+		|| die "sed failed to fix compile-flags"
 
 	# 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/'
+		-e 's/STRIP.*=.*$/STRIP = true/' \
+		|| die "sed failed to fix file stripping"
 
 	# Use a file instead of a variable as single-stepping via ebuild
 	# destroys environment.
@@ -318,14 +322,15 @@ vdr_i18n() {
 		if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
 			eqawarn "Forced to keep i18n.o"
 		else
-			sed -i "s:i18n.o::g" Makefile
+			sed -i "s:i18n.o::g" Makefile || die "sed failed to remove i18n from Makefile"
 			eqawarn "OBJECT i18n.o found, removed per sed"
 		fi
 	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
+		sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h \
+			|| die "sed failed to replace tI18nPhrase"
 		eqawarn "obsolete tI18nPhrase found, disabled per sed, please recheck"
 	fi
 }
@@ -341,7 +346,8 @@ vdr_remove_i18n_include() {
 	local f
 	for f; do
 		sed -i "${f}" \
-		-e "s:^#include[[:space:]]*\"i18n.h\"://:"
+		-e "s:^#include[[:space:]]*\"i18n.h\"://:" \
+		|| die "sed failed to remove i18n_include"
 	done
 
 	eqawarn "removed i18n.h include in ${@}"
@@ -393,7 +399,8 @@ vdr-plugin-2_pkg_setup() {
 	append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 
 	# Where should the plugins live in the filesystem
-	VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
+	local PKG__CONFIG=$(tc-getPKG_CONFIG)
+	VDR_PLUGIN_DIR=$($PKG__CONFIG --variable=libdir vdr)
 
 	VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
 
@@ -405,7 +412,7 @@ vdr-plugin-2_pkg_setup() {
 
 	TMP_LOCALE_DIR="${T}/tmp-locale"
 
-	LOCDIR=$(pkg-config --variable=locdir vdr)
+	LOCDIR=$($PKG__CONFIG --variable=locdir vdr)
 
 	if ! has_vdr; then
 		# set to invalid values to detect abuses
@@ -422,7 +429,7 @@ vdr-plugin-2_pkg_setup() {
 	fi
 
 	VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
-	APIVERSION=$(pkg-config --variable=apiversion vdr)
+	APIVERSION=$($PKG__CONFIG --variable=apiversion vdr)
 
 	einfo "Compiling against"
 	einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
@@ -551,10 +558,11 @@ vdr-plugin-2_src_install() {
 
 	if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
 		local mname="${P}-Makefile"
-		cp "${S}"/Makefile "${mname}.patched"
-		cp Makefile.before "${mname}.before"
+		cp "${S}"/Makefile "${mname}.patched" || die "could not copy to Makefile.patched"
+		cp Makefile.before "${mname}.before" || die "could not copy to Makefile.before"
 
 		diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
+		[[ $? -ge 2 ]] && die "problem with diff"
 
 		insinto "/usr/share/vdr/maintainer-data/makefile-changes"
 		doins "${mname}.diff"
@@ -564,7 +572,6 @@ vdr-plugin-2_src_install() {
 
 		insinto "/usr/share/vdr/maintainer-data/makefile-patched"
 		doins "${mname}.patched"
-
 	fi
 
 	cd "${S}" || die "could not change to plugin source directory (src_install)"
@@ -589,11 +596,11 @@ vdr-plugin-2_src_install() {
 		local linguas
 		for linguas in ${LINGUAS[*]}; do
 		insinto "${LOCDIR}"
-		cp -r --parents ${linguas}* ${D%/}/${LOCDIR}
+		cp -r --parents ${linguas}* ${D%/}/${LOCDIR} || die "could not copy linguas files"
 		done
 	fi
 
-	cd "${D%/}/usr/$(get_libdir)/vdr/plugins" || die "could not change to D/usr/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=""
-- 
2.32.0

Reply via email to