media-plugins/alsa-plugins: stable 1.1.6 for ppc, bug #666852
[gentoo.git] / media-plugins / vdr-dvbapi / vdr-dvbapi-2.2.2.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit vdr-plugin-2
7
8 DESCRIPTION="VDR Plugin: allows connect VDR to OScam"
9 HOMEPAGE="https://github.com/manio/vdr-plugin-dvbapi"
10 SRC_URI="https://github.com/manio/vdr-plugin-dvbapi/archive/v${PV}.tar.gz -> vdr-dvbapi-${PV}.tar.gz"
11
12 KEYWORDS="~amd64 ~x86"
13 SLOT="0"
14 LICENSE="GPL-2"
15 IUSE="cpu_flags_x86_3dnow cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2"
16
17 DEPEND=">=media-video/vdr-2.1.4"
18 RDEPEND="${DEPEND}"
19
20 S="${WORKDIR}/vdr-plugin-dvbapi-${PV}"
21
22 DOCS="HISTORY INSTALL README FFdecsa/docs"
23
24 src_prepare() {
25         vdr-plugin-2_src_prepare
26
27         # respect the system CXXFLAGS
28         sed -e "s:FLAGS:CXXFLAGS:" -i FFdecsa/Makefile
29
30         # Prepare flags for FFdeCSA
31         if [ -n "${VDR_DVBAPI_PARALLEL}" ]; then
32                 PARALLEL="${VDR_DVBAPI_PARALLEL}"
33         else
34                 # [32/64] Core2 (SSSE3) achieves best results with SSE2 & SSE
35                 # [64] Athlon64 (SSE2) does much better with 64_LONG
36                 # [32] Athlon64 (SSE2) does best with MMX
37                 # [32] Pentium4 & Atom (SSE2) work best with SSE2 & SSE
38                 # [32] AthlonXP (SSE) has MMX faster
39
40                 # To avoid parsing -march=, we use ugly assumption that Intels don't
41                 # have 3dnow and AMDs do. SSE achieves good results only on Intel CPUs,
42                 # and LONG is best on 64-bit AMD CPUs.
43
44                 if ! use cpu_flags_x86_3dnow && use cpu_flags_x86_sse2; then
45                         PARALLEL=PARALLEL_128_SSE2
46                 elif ! use cpu_flags_x86_3dnow && use cpu_flags_x86_sse; then
47                         PARALLEL=PARALLEL_128_SSE
48                 elif use amd64; then
49                         PARALLEL=PARALLEL_64_LONG
50                 elif use cpu_flags_x86_mmx; then
51                         PARALLEL=PARALLEL_64_MMX
52                 else
53                 # fallback values:
54                 # PARALLEL_32_INT fails with gcc4.4 on x86&amd64
55                 # PARALLEL_64_2INT fails with gcc4.4 on x86
56                 # PARALLEL_128_4INT seems to be the fastest non-failing fallback
57                         PARALLEL=PARALLEL_128_4INT
58                 fi
59
60                 ewarn "VDR_DVBAPI_PARALLEL in your system make.conf is not set, guessing value from USEflags (${PARALLEL})."
61                 ewarn "This setting may be suboptimal, so you'll probably want to tweak it yourself."
62                 ewarn "\n\tRun the script ${WORKDIR}/extra/FFdecsa-benchmark.sh"
63                 ewarn "\tand add the output parameter from  PARALLEL= to your system make.conf"
64                 ewarn "\tVDR_DVBAPI_PARALLEL= your parameter"
65         fi
66
67         export PARALLEL
68 }
69
70 pkg_postinst() {
71         vdr-plugin-2_pkg_postinst
72
73         elog "This software might be illegal in some countries or violate"
74         elog "rules of your DVB provider"
75         elog "Please respect these rules.\n"
76
77         elog "We do not offer support of any kind"
78         elog "Asking for keys or for installation help will be ignored by gentoo developers!\n"
79 }