summaryrefslogtreecommitdiff
blob: 39946c8462e57766775c56f91ebc73684b479b17 (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PHP_EXT_NAME=ming
MY_P="${PHP_EXT_NAME}-${PV//./_}"
USE_PHP="php5-6"
PHP_EXT_S="libming-${MY_P}/php_ext"
inherit flag-o-matic php-ext-source-r3

DESCRIPTION="PHP extension for the ming Flash movie generation library"
HOMEPAGE="http://ming.sourceforge.net/"
SRC_URI="https://github.com/libming/libming/archive/${MY_P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
IUSE=""

RDEPEND="media-libs/ming"
DEPEND="${RDEPEND}"

S="${WORKDIR}/libming-${MY_P}"

src_prepare() {
	local slot orig_s="${PHP_EXT_S}" libdir=$(get_libdir)
	for slot in $(php_get_slots); do
		cp "${FILESDIR}/php_ext-config.m4" "${WORKDIR}/${slot}/config.m4" || \
			die "Failed to copy config.m4 to target"
		rm "${WORKDIR}/${slot}/Makefile.am" || die "Failed to remove Makefile.am for ${slot}"
		# Fix for SYMYLINK_LIB=no
		[[ ${libdir} != 'lib' ]] && \
		sed -i -e "s~PHP_LIBDIR=lib~PHP_LIBDIR=${libdir}~" "${WORKDIR}/${slot}/config.m4" \
			|| die "Failed to update lib directory"
		php_init_slot_env ${slot}
		eapply -p0 "${FILESDIR}/ming-php-54.patch"
		eapply_user
		php-ext-source-r3_phpize
	done
}

src_configure() {
	# build is sensitive to -O3 (bug #297437)
	replace-flags -O3 -O2

	local PHP_EXT_EXTRA_ECONF="--with-ming=${S}"
	php-ext-source-r3_src_configure
}