summaryrefslogtreecommitdiff
blob: ab75f5a58df5405801edb9e67e8879bf256fd04c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
inherit toolchain-funcs versionator multilib multilib-minimal

DESCRIPTION="Adobe Flash Player"
HOMEPAGE="
	http://www.adobe.com/products/flashplayer.html
	http://get.adobe.com/flashplayer/
	https://helpx.adobe.com/security/products/flash-player.html#version11
"

AF_URI="https://fpdownload.adobe.com/pub/flashplayer/pdc"
PV_M=$(get_major_version)
# https://fpdownload.adobe.com/pub/flashplayer/pdc/22.0.0.209/flash_player_ppapi_linux.x86_64.tar.gz
AF_32_URI="${AF_URI}/${PV}/flash_player_ppapi_linux.i386.tar.gz -> ${P}.i386.tar.gz"
AF_64_URI="${AF_URI}/${PV}/flash_player_ppapi_linux.x86_64.tar.gz -> ${P}.x86_64.tar.gz"

SRC_URI="
	abi_x86_32? ( ${AF_32_URI} )
	abi_x86_64? ( ${AF_64_URI} )
"
SLOT="22"

KEYWORDS="-* ~amd64 ~x86"
LICENSE="AdobeFlash-11.x"
RESTRICT="strip mirror"

RDEPEND="
	!www-plugins/chrome-binary-plugins[flash]
"

S="${WORKDIR}"

# Ignore QA warnings in these closed-source binaries, since we can't fix them:
QA_PREBUILT="usr/*"

any_cpu_missing_flag() {
	local value=${1}
	grep '^flags' /proc/cpuinfo | grep -qv "${value}"
}

pkg_setup() {
	unset need_lahf_wrapper
	if use abi_x86_64 && any_cpu_missing_flag 'lahf_lm'; then
		export need_lahf_wrapper=1
	fi
}

src_unpack() {
	local files=( ${A} )

	multilib_src_unpack() {
		mkdir -p "${BUILD_DIR}" || die
		cd "${BUILD_DIR}" || die

		# we need to filter out the other archive(s)
		local other_abi
		[[ ${ABI} == amd64 ]] && other_abi=i386 || other_abi=x86_64
		unpack ${files[@]//*${other_abi}*/}
	}

	multilib_parallel_foreach_abi multilib_src_unpack
}

src_configure() { :; }

multilib_src_install() {
	exeinto /usr/$(get_libdir)/chromium-browser/PepperFlash
	doexe libpepflashplayer.so
	doins manifest.json

	if multilib_is_native_abi; then
		dodir /etc/chromium
		sed "${FILESDIR}"/pepper-flash \
			-e "s|@FP_LIBDIR@|$(get_libdir)|g" \
			-e "s|@FP_PV@|${PV}|g" \
			> "${D}"/etc/chromium/pepper-flash \
			|| die
	fi
}