diff options
author | Martin Dummer <martin.dummer@gmx.net> | 2021-05-06 00:31:44 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2021-05-06 11:46:42 +0300 |
commit | 124a95a62c264394f08d70dc0eb66db06b8c9d04 (patch) | |
tree | bbc178d275411ace916cc3db2e2802561dd74b40 /media-video/vdr/vdr-2.4.7-r1.ebuild | |
parent | dev-python/towncrier: Mark ALLARCHES (diff) | |
download | gentoo-124a95a62c264394f08d70dc0eb66db06b8c9d04.tar.gz gentoo-124a95a62c264394f08d70dc0eb66db06b8c9d04.tar.bz2 gentoo-124a95a62c264394f08d70dc0eb66db06b8c9d04.zip |
media-video/vdr: add gcc-11 compile fix
vdr defines std:: functions "min" "max" and "swap" as Template, which
collides with gcc-11. Add a patch from upstream which fixes this, and fixes
also compile problems with all media-video/vdr-* plugins using this
functions, too
Closes: https://bugs.gentoo.org/786882
Closes: https://bugs.gentoo.org/787389
Closes: https://bugs.gentoo.org/787236
Closes: https://bugs.gentoo.org/787140
Closes: https://bugs.gentoo.org/786801
Closes: https://bugs.gentoo.org/786795
Closes: https://bugs.gentoo.org/786672
Closes: https://bugs.gentoo.org/786285
Closes: https://bugs.gentoo.org/786258
Closes: https://bugs.gentoo.org/788583
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
Closes: https://github.com/gentoo/gentoo/pull/20695
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-video/vdr/vdr-2.4.7-r1.ebuild')
-rw-r--r-- | media-video/vdr/vdr-2.4.7-r1.ebuild | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/media-video/vdr/vdr-2.4.7-r1.ebuild b/media-video/vdr/vdr-2.4.7-r1.ebuild new file mode 100644 index 000000000000..8fda32ee217b --- /dev/null +++ b/media-video/vdr/vdr-2.4.7-r1.ebuild @@ -0,0 +1,209 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic l10n toolchain-funcs + +DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB" +HOMEPAGE="http://www.tvdr.de/" +SRC_URI="http://git.tvdr.de/?p=vdr.git;a=snapshot;h=refs/tags/2.4.7;sf=tbz2 -> ${P}.tbz2 + mainmenuhooks? ( http://vdr.websitec.de/download/${PN}/${PN}-2.4.1/${PN}-2.4.1_mainmenuhook-1.0.1.patch.bz2 ) + menuorg? ( https://projects.vdr-developer.org/projects/plg-menuorg/repository/revisions/master/raw/vdr-patch/vdr-menuorg-2.3.x.diff ) + naludump? ( https://www.udo-richter.de/vdr/files/vdr-2.1.5-naludump-0.1.diff ) + pinplugin? ( http://vdr.websitec.de/download/${PN}/vdr-2.4.6/${PN}-2.4.6_pinplugin.patch.bz2 ) + ttxtsubs? ( http://vdr.websitec.de/download/${PN}/vdr-2.4.6/${PN}-2.4.6_ttxtsubs_v2.patch.bz2 ) + permashift? ( http://vdr.websitec.de/download/${PN}/vdr-2.4.6/vdr-2.4-patch-for-permashift.diff.bz2 )" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86" +IUSE="bidi debug demoplugins html keyboard mainmenuhooks menuorg naludump permashift pinplugin systemd ttxtsubs verbose" + +COMMON_DEPEND=" + virtual/jpeg:* + sys-libs/libcap + >=media-libs/fontconfig-2.4.2 + >=media-libs/freetype-2" +DEPEND="${COMMON_DEPEND} + >=virtual/linuxtv-dvb-headers-5.3" +RDEPEND="${COMMON_DEPEND} + dev-lang/perl + media-tv/gentoo-vdr-scripts + media-fonts/corefonts + bidi? ( dev-libs/fribidi ) + systemd? ( sys-apps/systemd )" +BDEPEND="sys-devel/gettext" + +REQUIRED_USE="pinplugin? ( !mainmenuhooks ) + permashift? ( !naludump !pinplugin )" + +CONF_DIR="/etc/vdr" +CAP_FILE="${S}/capabilities.sh" +CAPS="# Capabilities of the vdr-executable for use by startscript etc." + +pkg_setup() { + use debug && append-flags -g + + PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins" + + # use the corrected DIR /var/lib/vdr/* for acct/{user,group) handling + if has_version ">=media-tv/gentoo-vdr-scripts-3.0_rc1"; then + VIDEO_DIR="/var/lib/vdr/video" + else + VIDEO_DIR="/var/vdr/video" + fi + + tc-export CC CXX AR +} + +add_cap() { + local arg + for arg; do + CAPS="${CAPS}\n${arg}=1" + done +} + +lang_po() { + LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' ) +} + +src_configure() { + # support languages, written from right to left + export "BIDI=$(usex bidi 1 0)" + # systemd notification support + export "SDNOTIFY=$(usex systemd 1 0)" + # with/without keyboard + export "USE_KBD=$(usex keyboard 1 0)" + # detailed compile output for debug + export "VERBOSE=$(usex verbose 1 0)" +} + +src_prepare() { + # apply maintenance-patches + ebegin "Changing paths for gentoo" + + local DVBDIR=/usr/include + local i + for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do + [[ -d ${i} ]] || continue + if [[ -f ${i}/linux/dvb/dmx.h ]]; then + einfo "Found DVB header files in ${i}" + DVBDIR=${i} + break + fi + done + + # checking for s2api headers + local api_version + api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h) + api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h) + + if [[ ${api_version:-0} -lt 5*3 ]]; then + eerror "DVB header files do not contain s2api support or too old for ${P}" + eerror "You cannot compile VDR against old dvb-header" + die "DVB headers too old" + fi + + cat > Make.config <<-EOT || die "cannot write to Make.config" + # + # Generated by ebuild ${PF} + # + PREFIX = /usr + DVBDIR = ${DVBDIR} + PLUGINLIBDIR = ${PLUGIN_LIBDIR} + CONFDIR = ${CONF_DIR} + ARGSDIR = \$(CONFDIR)/conf.d + VIDEODIR = ${VIDEO_DIR} + LOCDIR = \$(PREFIX)/share/locale + INCDIR = \$(PREFIX)/include + + DEFINES += -DCONFDIR=\"\$(CONFDIR)\" + INCLUDES += -I\$(DVBDIR) + + # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr + # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new) + LIBDIR = ${PLUGIN_LIBDIR} + PCDIR = /usr/$(get_libdir)/pkgconfig + + EOT + eend 0 + + eapply "${FILESDIR}/${PN}-2.4.6_gentoo.patch" + use demoplugins || eapply "${FILESDIR}/vdr-2.4_remove_plugins.patch" + eapply "${FILESDIR}/${PN}-2.4.6_makefile-variables.patch" + + # fix clang/LLVM compile + eapply "${FILESDIR}/${PN}-2.4.6_clang.patch" + + # fix gcc-11 compile + eapply "${FILESDIR}/${P}_gcc11.patch" + + use naludump && eapply "${DISTDIR}/${PN}-2.1.5-naludump-0.1.diff" + use permashift && eapply "${WORKDIR}/${PN}-2.4-patch-for-permashift.diff" + use pinplugin && eapply "${WORKDIR}/${PN}-2.4.6_pinplugin.patch" + use ttxtsubs && eapply "${WORKDIR}/${PN}-2.4.6_ttxtsubs_v2.patch" + use menuorg && eapply "${DISTDIR}/vdr-menuorg-2.3.x.diff" + use mainmenuhooks && eapply "${WORKDIR}/${PN}-2.4.1_mainmenuhook-1.0.1.patch" + + add_cap CAP_UTF8 \ + CAP_IRCTRL_RUNTIME_PARAM \ + CAP_VFAT_RUNTIME_PARAM \ + CAP_CHUID \ + CAP_SHUTDOWN_AUTO_RETRY + + echo -e ${CAPS} > "${CAP_FILE}" || die "cannot write to CAP_FILE" + + # LINGUAS support + einfo "\n \t VDR supports the LINGUAS values" + + lang_po + + einfo "\t Please set one of this values in your sytem make.conf" + einfo "\t LINGUAS=\"${LING_PO}\"\n" + + if [[ -z ${LINGUAS} ]]; then + einfo "\n \t No values in LINGUAS=" + einfo "\t You will get only english text on OSD \n" + fi + + strip-linguas ${LING_PO} en + + default +} + +src_install() { + # trick the makefile to not create a VIDEODIR by supplying it with an + # existing directory + emake VIDEODIR="/" DESTDIR="${ED}" install + + keepdir "${PLUGIN_LIBDIR}" + + # backup for plugins they don't be able to create this dir + keepdir "${CONF_DIR}/plugins" + + if use html; then + local HTML_DOCS=( *.html ) + fi + local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS UPDATE-2* ) + einstalldocs + + insinto /usr/share/vdr + doins "${CAP_FILE}" + + fowners vdr:vdr "${CONF_DIR}" -R +} + +pkg_postinst() { + elog "Please read the /usr/share/doc/${PF}/UPDATE-2.4" + elog "for major changes in this version\n" + + elog "It is a good idea to run vdrplugin-rebuild now.\n" + + elog "To get nice symbols in OSD we recommend to install" + elog "\t1. emerge media-fonts/vdrsymbols-ttf" + elog "\t2. select font VDRSymbolsSans in Setup\n" + + elog "To get an idea how to proceed now, have a look at our vdr-guide:" + elog "\thttps://wiki.gentoo.org/wiki/VDR" +} |