From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Jl51t-0001kV-1u for garchives@archives.gentoo.org; Sun, 13 Apr 2008 16:26:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C9AA6E03B7; Sun, 13 Apr 2008 16:26:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5302EE03B7 for ; Sun, 13 Apr 2008 16:26:07 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id DC7A166EC5 for ; Sun, 13 Apr 2008 16:26:06 +0000 (UTC) Received: from zzam by stork.gentoo.org with local (Exim 4.68) (envelope-from ) id 1Jl51p-0008D5-Ri for gentoo-commits@lists.gentoo.org; Sun, 13 Apr 2008 16:26:05 +0000 From: "Matthias Schwarzott (zzam)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, zzam@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: vdr-plugin.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: vdr-plugin.eclass X-VCS-Directories: eclass X-VCS-Committer: zzam X-VCS-Committer-Name: Matthias Schwarzott Content-Type: text/plain; charset=utf8 Message-Id: Sender: Matthias Schwarzott Date: Sun, 13 Apr 2008 16:26:05 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: cd5808f1-b40f-4d3d-aa01-881dad05538d X-Archives-Hash: 48899721091edb2048052981aa32c9b7 zzam 08/04/13 16:26:05 Modified: vdr-plugin.eclass Log: Cleanup of eclass. Try to minimize changes to Makefile. Revision Changes Path 1.55 eclass/vdr-plugin.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.= eclass?rev=3D1.55&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.= eclass?rev=3D1.55&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.= eclass?r1=3D1.54&r2=3D1.55 Index: vdr-plugin.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- vdr-plugin.eclass 22 Mar 2008 18:04:51 -0000 1.54 +++ vdr-plugin.eclass 13 Apr 2008 16:26:05 -0000 1.55 @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.54 2008/= 03/22 18:04:51 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.55 2008/= 04/13 16:26:05 zzam Exp $ # # Author: # Matthias Schwarzott @@ -147,6 +147,146 @@ fi } =20 +fix_vdr_libsi_include() +{ + einfo "Fixing include of libsi-headers" + local f + for f; do + sed -i "${f}" \ + -e '/#include/s:"\(.*libsi.*\)":<\1>:' \ + -e '/#include/s:<.*\(libsi/.*\)>::' + done +} + +vdr_patchmakefile() { + einfo "Patching Makefile" + [[ -e Makefile ]] || die "Makefile of plugin can not be found!" + cp Makefile "${WORKDIR}"/Makefile.before + + ebegin " Setting Pathes" + sed -i Makefile \ + -e "s:^VDRDIR.*$:VDRDIR =3D ${VDR_INCLUDE_DIR}:" \ + -e "s:^LIBDIR.*$:LIBDIR =3D ${S}:" \ + -e "s:^TMPDIR.*$:TMPDIR =3D ${T}:" \ + -e 's:-I$(VDRDIR)/include:-I'"${VDR_INCLUDE_DIR%vdr}"':' \ + -e "/^DVBDIR/d" \ + -e 's:-I$(DVBDIR)/include::' + eend $? + + # maybe needed for multiproto: + #sed -i Makefile \ + # -e "s:^DVBDIR.*$:DVBDIR =3D ${DVB_INCLUDE_DIR}:" \ + # -e 's:-I$(VDRDIR)/include -I$(DVBDIR)/include:-I$(DVBDIR)/include -I$= (VDRDIR)/include:' \ + # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' + + if ! grep -q APIVERSION Makefile; then + ebegin " Converting to APIVERSION" + sed -i Makefile \ + -e 's:^APIVERSION =3D :APIVERSION ?=3D :' \ + -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \ + -e '/VDRVERSION =3D/a\APIVERSION =3D $(shell sed -ne '"'"'/define API= VERSION/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:]]*=3D/s/=3D/?=3D/' \ + -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:' + + # Disabling file stripping, useful for debugging + sed -i Makefile \ + -e '/@.*strip/d' \ + -e '/strip \$(LIBDIR)\/\$@/d' \ + -e '/@.*\$(STRIP)/d' + + # Use a file instead of a variable as single-stepping via ebuild + # destroys environment. + touch "${WORKDIR}"/.vdr-plugin_makefile_patched +} + +vdr_add_local_patch() { + if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then + echo + einfo "Applying local patches" + for LOCALPATCH in "${VDR_LOCAL_PATCHES_DIR}/${PN}/${PV}"/*.{diff,patch= }; do + test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}" + done + fi +} + +vdr_i18n() { + if [[ ${USE_GETTEXT} =3D 0 ]]; then + # Remove i18n Target if using older vdr + sed -i Makefile \ + -e '/^all:/s/ i18n//' + elif [[ ${USE_GETTEXT} =3D 1 && ! -d po && ${NO_GETTEXT_HACK} !=3D 1 ]]= ; then + einfo "Plugin is not yet changed for new translation system." + einfo "Auto converting translations to gettext" + + local i18n_tool=3D"${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl" + if [[ ! -x ${i18n_tool} ]]; then + eerror "Missing ${i18n_tool}" + eerror "Please re-emerge vdr" + die "Missing ${i18n_tool}" + fi + + # call i18n-to-gettext tool + # take all texts missing tr call into special file + "${i18n_tool}" 2>/dev/null \ + |sed -e '/^"/!d' \ + -e '/^""$/d' \ + -e 's/\(.*\)/trNOOP(\1)/' \ + > dummy-translations-trNOOP.c + + # if there were untranslated texts just run it again + # now the missing calls are listed in + # dummy-translations-trNOOP.c + if [[ -s dummy-translations-trNOOP.c ]]; then + "${i18n_tool}" &>/dev/null + fi + + # now use the modified Makefile + if [[ -f Makefile.new ]]; then + mv Makefile.new Makefile + else + ewarn "Conversion to gettext failed. Plugin needs fixing." + fi + fi +} + +vdr-plugin_copy_source_tree() { + pushd . >/dev/null + cp -r "${S}" "${T}"/source-tree + cd "${T}"/source-tree + cp "${WORKDIR}"/Makefile.before Makefile + sed -i Makefile \ + -e "s:^DVBDIR.*$:DVBDIR =3D ${DVB_INCLUDE_DIR}:" \ + -e 's:^CXXFLAGS:#CXXFLAGS:' \ + -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ + -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' + popd >/dev/null +} + +vdr-plugin_install_source_tree() { + einfo "Installing sources" + destdir=3D"${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}" + insinto "${destdir}-${PV}" + doins -r "${T}"/source-tree/* + + dosym "${VDRPLUGIN}-${PV}" "${destdir}" +} + +vdr-plugin_print_enable_command() { + elog + elog "To activate this vdr-plugin execute the following command:" + elog "\teselect vdr-plugin enable ${PN#vdr-}" + elog +} + + +## exported functions + vdr-plugin_pkg_setup() { # -fPIC is needed for shared objects on some platforms (amd64 and other= s) append-flags -fPIC @@ -176,8 +316,8 @@ APIVERSION=3D$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUD= E_DIR}"/config.h) [[ -z ${APIVERSION} ]] && APIVERSION=3D"${VDRVERSION}" =20 - einfo "Building ${PF} against vdr-${VDRVERSION}" - einfo "APIVERSION: ${APIVERSION}" + einfo "Compiling against" + einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]" } =20 vdr-plugin_src_unpack() { @@ -199,136 +339,24 @@ unpack) base_src_unpack ;; - patchmakefile) - if ! cd "${S}"; then - ewarn "There seems to be no plugin-directory with the name ${S##*/}" - ewarn "Perhaps you find one among these:" - cd "${WORKDIR}" - ewarn "$(/bin/ls -1 "${WORKDIR}")" - die "Could not change to plugin-source-directory!" - fi - - einfo "Patching Makefile" - [[ -e Makefile ]] || die "Makefile of plugin can not be found!" - cp Makefile "${WORKDIR}"/Makefile.before - - sed -i Makefile \ - -e '1i\#Makefile was patched by vdr-plugin.eclass' - - ebegin " Setting Pathes" - sed -i Makefile \ - -e "s:^VDRDIR.*$:VDRDIR =3D ${VDR_INCLUDE_DIR}:" \ - -e "s:^DVBDIR.*$:DVBDIR =3D ${DVB_INCLUDE_DIR}:" \ - -e "s:^LIBDIR.*$:LIBDIR =3D ${S}:" \ - -e "s:^TMPDIR.*$:TMPDIR =3D ${T}:" \ - -e 's:-I$(VDRDIR)/include -I$(DVBDIR)/include:-I$(DVBDIR)/include -I= $(VDRDIR)/include:' \ - -e 's:-I$(VDRDIR)/include:-I'"${VDR_INCLUDE_DIR%vdr}"':' \ - -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' - eend $? - - ebegin " Converting to APIVERSION" - sed -i Makefile \ - -e 's:^APIVERSION =3D :APIVERSION ?=3D :' \ - -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \ - -e '2i\APIVERSION =3D '"${APIVERSION}" - eend $? - - ebegin " Correcting Compile-Flags" - # Do not overwrite CXXFLAGS, add LDFLAGS if missing - sed -i Makefile \ - -e '/^CXXFLAGS[[:space:]]*=3D/s/=3D/?=3D/' \ - -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:' - eend $? - - ebegin " Disabling file stripping" - sed -i Makefile \ - -e '/@.*strip/d' \ - -e '/strip \$(LIBDIR)\/\$@/d' \ - -e '/^STRIP =3D/d' \ - -e '/@.*\$(STRIP)/d' - eend $? - - # Use a file instead of an variable as single-stepping via ebuild - # destroys environment. - touch "${WORKDIR}"/.vdr-plugin_makefile_patched - ;; add_local_patch) - cd "${S}" - if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then - echo - einfo "Applying local patches" - for LOCALPATCH in "${VDR_LOCAL_PATCHES_DIR}/${PN}/${PV}"/*.{diff,pat= ch}; do - test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}" - done - fi + cd "${S}" || die "Could not change to plugin-source-directory!" + vdr_add_local_patch + ;; + patchmakefile) + cd "${S}" || die "Could not change to plugin-source-directory!" + vdr_patchmakefile ;; i18n) - cd "${S}" - if [[ ${USE_GETTEXT} =3D 0 ]]; then - # Remove i18n Target if using older vdr - sed -i Makefile \ - -e '/^all:/s/ i18n//' - elif [[ ${USE_GETTEXT} =3D 1 && ! -d po && ${NO_GETTEXT_HACK} !=3D 1 = ]]; then - einfo "Plugin is not yet changed for new translation system." - einfo "Auto converting translations to gettext" - - local i18n_tool=3D"${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl" - if [[ ! -x ${i18n_tool} ]]; then - eerror "Missing ${i18n_tool}" - eerror "Please re-emerge vdr" - die "Missing ${i18n_tool}" - fi - - # call i18n-to-gettext tool - # take all texts missing tr call into special file - "${i18n_tool}" 2>/dev/null \ - |sed -e '/^"/!d' \ - -e '/^""$/d' \ - -e 's/\(.*\)/trNOOP(\1)/' \ - > dummy-translations-trNOOP.c - - # if there were untranslated texts just run it again - # now the missing calls are listed in - # dummy-translations-trNOOP.c - if [[ -s dummy-translations-trNOOP.c ]]; then - "${i18n_tool}" &>/dev/null - fi - - # now use the modified Makefile - if [[ -f Makefile.new ]]; then - mv Makefile.new Makefile - else - ewarn "Conversion to gettext failed. Plugin needs fixing." - fi - fi + cd "${S}" || die "Could not change to plugin-source-directory!" + vdr_i18n + ;; esac =20 shift done } =20 -vdr-plugin_copy_source_tree() { - pushd . >/dev/null - cp -r "${S}" "${T}"/source-tree - cd "${T}"/source-tree - cp "${WORKDIR}"/Makefile.before Makefile - sed -i Makefile \ - -e "s:^DVBDIR.*$:DVBDIR =3D ${DVB_INCLUDE_DIR}:" \ - -e 's:^CXXFLAGS:#CXXFLAGS:' \ - -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ - -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' - popd >/dev/null -} - -vdr-plugin_install_source_tree() { - einfo "Installing sources" - destdir=3D"${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}" - insinto "${destdir}-${PV}" - doins -r "${T}"/source-tree/* - - dosym "${VDRPLUGIN}-${PV}" "${destdir}" -} - vdr-plugin_src_compile() { [ -z "$1" ] && vdr-plugin_src_compile prepare compile =20 @@ -419,13 +447,6 @@ create_plugindb_file } =20 -vdr-plugin_print_enable_command() { - elog - elog "To activate this vdr-plugin execute the following command:" - elog "\teselect vdr-plugin enable ${PN#vdr-}" - elog -} - vdr-plugin_pkg_postinst() { vdr-plugin_print_enable_command =20 @@ -440,58 +461,9 @@ delete_orphan_plugindb_file } =20 -vdr-plugin_pkg_config_legacy() { - elog "Using old interface to gentoo-vdr-scripts-0.3.7" - if [[ -z "${INSTALLPLUGIN}" ]]; then - INSTALLPLUGIN=3D"${VDRPLUGIN}" - fi - - active=3D0 - # First test if plugin is already inside PLUGINS - local conf=3D/etc/conf.d/vdr.plugins - exec 3<${conf} - while read -u 3 line; do - [[ ${line} =3D=3D "" ]] && continue - [[ ${line:0:1} =3D=3D "#" ]] && continue - set -- ${line} - [[ ${1} =3D=3D ${INSTALLPLUGIN} ]] && active=3D1 - done - exec 3<&- - - if [[ $active =3D=3D 0 ]]; then - elog "Adding ${INSTALLPLUGIN} to active plugins." - - # The pure edit process. - echo "${INSTALLPLUGIN}" >> "${conf}" - else - elog "${INSTALLPLUGIN} already activated" - echo - read -p "Do you want to deactivate ${INSTALLPLUGIN} (yes/no) " answer - if [[ "${answer}" !=3D "yes" ]]; then - elog "aborted" - return - fi - elog "Removing ${INSTALLPLUGIN} from active plugins." - - # The pure edit process - sed -i "${conf}" -e "/^[[:space:]]*${INSTALLPLUGIN}[[:space:]]*\$/d" - fi -} - vdr-plugin_pkg_config() { ewarn "emerge --config ${PN} is no longer supported" vdr-plugin_print_enable_command } =20 -fix_vdr_libsi_include() -{ - einfo "Fixing include of libsi-headers" - local f - for f; do - sed -i "${f}" \ - -e '/#include/s:"\(.*libsi.*\)":<\1>:' \ - -e '/#include/s:<.*\(libsi/.*\)>::' - done -} - EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postin= st pkg_postrm pkg_config --=20 gentoo-commits@lists.gentoo.org mailing list