app-i18n/ibus: version bump 1.5.13
[gentoo.git] / www-plugins / chrome-binary-plugins / chrome-binary-plugins-50.0.2661.18_alpha1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit multilib unpacker
8
9 DESCRIPTION="Binary plugins from Google Chrome for use in Chromium"
10 HOMEPAGE="https://www.google.com/chrome"
11
12 case ${PV} in
13         *_alpha*)
14                 SLOT="unstable"
15                 CHROMEDIR="opt/google/chrome-${SLOT}"
16                 MY_PV=${PV/_alpha/-}
17                 ;;
18         *_beta*)
19                 SLOT="beta"
20                 CHROMEDIR="opt/google/chrome-${SLOT}"
21                 MY_PV=${PV/_beta/-}
22                 ;;
23         *_p*)
24                 SLOT="stable"
25                 CHROMEDIR="opt/google/chrome"
26                 MY_PV=${PV/_p/-}
27                 ;;
28         *)
29                 die "Invalid value for \${PV}: ${PV}"
30                 ;;
31 esac
32
33 MY_PN="google-chrome-${SLOT}"
34 MY_P="${MY_PN}_${MY_PV}"
35
36 SRC_URI="
37         amd64? (
38                 https://dl.google.com/linux/chrome/deb/pool/main/g/${MY_PN}/${MY_P}_amd64.deb
39         )
40 "
41 KEYWORDS="-* ~amd64"
42
43 LICENSE="google-chrome"
44 IUSE="+flash +widevine"
45 RESTRICT="bindist mirror strip"
46
47 for x in 0 beta stable unstable; do
48         if [[ ${SLOT} != ${x} ]]; then
49                 RDEPEND+=" !${CATEGORY}/${PN}:${x}"
50         fi
51 done
52
53 S="${WORKDIR}/${CHROMEDIR}"
54 QA_PREBUILT="*"
55
56 pkg_nofetch() {
57         eerror "Please wait 24 hours and sync your portage tree before reporting fetch failures."
58 }
59
60 src_install() {
61         local version flapper
62
63         insinto /usr/$(get_libdir)/chromium-browser/
64
65         if use widevine; then
66                 doins libwidevinecdm.so
67                 strings ./chrome | grep -C 1 " (version:" | tail -1 > widevine.version
68                 doins widevine.version
69         fi
70
71         if use flash; then
72                 doins -r PepperFlash
73
74                 # Since this is a live ebuild, we're forced to, unfortuantely,
75                 # dynamically construct the command line args for Chromium.
76                 version=$(sed -n 's/.*"version": "\(.*\)",.*/\1/p' PepperFlash/manifest.json)
77                 flapper="${ROOT}usr/$(get_libdir)/chromium-browser/PepperFlash/libpepflashplayer.so"
78                 echo -n "CHROMIUM_FLAGS=\"\${CHROMIUM_FLAGS} " > pepper-flash
79                 echo -n "--ppapi-flash-path=$flapper " >> pepper-flash
80                 echo "--ppapi-flash-version=$version\"" >> pepper-flash
81
82                 insinto /etc/chromium/
83                 doins pepper-flash
84         fi
85 }