summaryrefslogtreecommitdiff
blob: 9de317f3f554dea7933f1fd43ecd546d5588922b (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/mplayerplug-in/mplayerplug-in-3.50.ebuild,v 1.1 2008/01/06 22:34:21 josejx Exp $

inherit eutils multilib autotools

DESCRIPTION="mplayer plug-in for Gecko based browsers"
HOMEPAGE="http://mplayerplug-in.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 -hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="gtk divx firefox gmedia mplayer-bin nls quicktime realmedia seamonkey wmp"

LANGS="da de en_US es fr hu it ja ko nb pl pt_BR nl ru se zh_CN"
for X in ${LANGS}; do IUSE="${IUSE} linguas_${X}"; done

DEPEND="
		firefox? ( www-client/mozilla-firefox )
		!firefox? (
			seamonkey? ( www-client/seamonkey )
			!seamonkey? ( net-libs/xulrunner )
		)
		|| ( ( x11-libs/libXpm
				x11-proto/xextproto
			)
			virtual/x11
		)
		gtk? (
			>=x11-libs/gtk+-2.2.0
			dev-libs/atk
			>=dev-libs/glib-2.2.0
			>=x11-libs/pango-1.2.1
		)
		mplayer-bin? ( media-video/mplayer-bin )
		!mplayer-bin? ( >=media-video/mplayer-1.0_pre7 )
		dev-util/pkgconfig"

		if has_multilib_profile; then
			DEPEND="${DEPEND}
				amd64? (
					app-emulation/emul-linux-x86-xlibs
					app-emulation/emul-linux-x86-baselibs
					app-emulation/emul-linux-x86-gtklibs
				)"
		fi

S="${WORKDIR}/${PN}"

src_unpack() {
	unpack "${A}"
	cd "${S}"
	epatch "${FILESDIR}/${PN}-3.40-cflags.patch"
	epatch "${FILESDIR}/${PN}-gcc4.patch"
	### Adds support for 32 bit binary mplayer on amd64
	if use mplayer-bin; then
		epatch "${FILESDIR}/${PN}-mplayer-bin.patch"
	fi
	epatch "${FILESDIR}/${P}-seamonkey.patch"
	eautoconf
}

src_compile() {
	local myconf

	# We force gtk2 now because moz only compiles against gtk2
	if use gtk; then
		myconf="${myconf} --enable-gtk2"
	else
		ewarn "For playback controls, you must enable gtk support."
		myconf="${myconf} --enable-x"
	fi

	# Build the 32bit plugin
	if use amd64 && has_multilib_profile; then
		einfo "Building 32-bit plugin"
		oldabi="${ABI}"
		ABI="x86"
		econf \
			${myconf} \
			--x-libraries=/emul/linux/x86/usr/lib/ \
			--enable-x86_64 \
			${myconf2} \
			$(use_enable divx dvx) \
			$(use_enable gmedia gmp) \
			$(use_enable realmedia rm) \
			$(use_enable quicktime qt) \
			$(use_enable wmp) \
			|| die "econf failed"

		emake || die "emake failed"

		# Save the 32bit plugins
		mkdir lib32
		mv mplayerplug-in*.so lib32
		mv mplayerplug-in*.xpt lib32
		ABI="${oldabi}"
		emake -j1 clean || die "emake clean failed"

		einfo "Building 64-bit plugin"
	fi

	# Media Playback Support (bug #145517)
	econf \
		${myconf} \
		$(use_enable divx dvx) \
		$(use_enable gmedia gmp) \
		$(use_enable realmedia rm) \
		$(use_enable quicktime qt) \
		$(use_enable wmp) \
		|| die "econf failed"

	emake || die "emake failed"
}

src_install() {
	PLUGINS="in in-gmp in-rm in-qt in-wmp in-dvx"
	plugindir="nsbrowser/plugins"

	exeinto /usr/$(get_libdir)/${plugindir}
	insinto /usr/$(get_libdir)/${plugindir}

	for plugin in ${PLUGINS}; do
		if [ -e "mplayerplug-${plugin}.so" ]; then
			doexe "mplayerplug-${plugin}.so" || die "plugin mplayerplug-${plugin} failed"
		    doins "mplayerplug-${plugin}.xpt" || die "plugin mplayerplug-${plugin} xpt failed"
		fi
	done

	if use amd64 && has_multilib_profile; then
		oldabi="${ABI}"
		ABI="x86"
		exeinto /usr/$(get_libdir)/${plugindir}
		insinto /usr/$(get_libdir)/${plugindir}

		for plugin in ${PLUGINS}; do
			if [ -e "mplayerplug-${plugin}.so" ]; then
				doexe "lib32/mplayerplug-${plugin}.so" || die "plugin mplayerplug-${plugin} failed"
				doins "lib32/mplayerplug-${plugin}.xpt" || die "plugin mplayerplug-${plugin} xpt failed"
			fi
		done
		ABI="${oldabi}"
	fi

	if use nls; then
		local WANT_LANGS
		for X in ${LANGS}; do
			if use linguas_${X}; then
				WANT_LANGS="${WANT_LANGS} ${X}"
			fi
		done
		emake -C po LANGUAGES="${WANT_LANGS# }" DESTDIR="${D}" install \
			|| die "Translation installation failed"
	fi

	insinto /etc
	doins mplayerplug-in.conf

	dodoc ChangeLog INSTALL README DOCS/tech/*.txt
}