summaryrefslogtreecommitdiff
blob: 11ffc62186e0f31a120626c6099ceb97bd33cfda (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/gnash/gnash-0.8.0.ebuild,v 1.6 2007/07/23 14:36:24 drac Exp $

WANT_AUTOMAKE="1.9"

inherit nsplugins kde-functions qt3 multilib flag-o-matic autotools
set-kdedir eutils

DESCRIPTION="Gnash is a GNU Flash movie player that supports many SWF v7 features"
HOMEPAGE="http://www.gnu.org/software/gnash"
SRC_URI="mirror://gnu/${PN}/${PV}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
IUSE="agg gstreamer ffmpeg kde mad nsplugin xml video_cards_i810"
#dmalloc, broken see bug 142939
#dmalloc? ( dev-libs/dmalloc )
#		$(use_enable dmalloc) \

RDEPEND="
	xml? ( dev-libs/libxml2 )
	sys-libs/zlib
	media-libs/jpeg
	media-libs/libogg
	media-libs/libpng
	net-misc/curl
	mad? ( media-libs/libmad )
	ffmpeg? ( media-video/ffmpeg )
	gstreamer? ( media-libs/gstreamer
		|| (
			media-plugins/gst-plugins-ffmpeg
			media-plugins/gst-plugins-mad
			media-plugins/gst-plugins-lame
		)
	)
	!gstreamer? ( media-libs/libsdl )
	dev-libs/boost
	x11-libs/libX11
	x11-libs/libXi
	x11-libs/libXmu
	x11-libs/libXt
	x11-proto/xproto
	dev-libs/atk
	dev-libs/glib
	>x11-libs/gtk+-2
	x11-libs/pango
	!agg? ( virtual/opengl x11-libs/gtkglext )
	kde? ( kde-base/kdelibs )
	agg? ( x11-libs/agg )"
	#cairo? ( x11-libs/cairo )

DEPEND="${RDEPEND}
	dev-util/pkgconfig"

pkg_setup() {
	if use agg && use kde; then
		eerror "Building klash with the agg based renderer is not supported"
		eerror "Please USE -kde or -agg"
		die "kde and agg not supported at the same time"
	fi

	if has_version '<dev-libs/boost-1.34' && ! built_with_use dev-libs/boost threads; then
		eerror "dev-libst/boost has to be built with the 'threads' USE flag"
		die "dev-libs/boost not built with threads"
	fi

	if use mad && ( use !ffmpeg && use !gstreamer ) && ( use nsplugin || use xml ); then
		eerror "Building Gnash using the mad media handler is incompatible with the nsplugin or xml USE flags"
		die "nsplugin and xml not supported with mad media handler"
	fi

	if use !mad && use !ffmpeg && use !gstreamer; then
		eerror "You are trying to build Gnash without choosing a media handler"
		eerror "Please enable one of the following ffmpeg,gstreamer or mad(mp3 audio only)"
		die "No media handler selected !"
	fi
}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}-ffmpeg.patch
	eautoconf
	eautomake
}

src_compile() {
	local myconf

	use nsplugin && myconf="${myconf} --with-plugindir=/opt/netscape/plugins"

	#--enable-renderer=engine Specify rendering engine:
	#				OpenGL (default)
	#				Cairo  (experimental)
	#cairo: does not work for plugins yet, offers flash for non-accelerated gfx?
	#if use cairo; then
	#	myconf="${myconf} --enable-renderer=cairo"
	#fi
	if use agg; then
		myconf="${myconf} --enable-renderer=agg"
	fi
	#--enable-gui=flavor Specify gui flavor:
	#				GTK
	#				SDL -> has no controls, we do not USE it
	#$(use_enable gtk glext) with USE=-gtk, fails to detect gtkglext, bug 135010
	#--enable-media=gst||ffmpeg||mad
	if use mad && use !ffmpeg && use !gstreamer; then
		myconf="${myconf} --enable-media=mad"
	fi

	if use gstreamer && use !ffmpeg; then
		myconf="${myconf} --enable-media=gst"
	fi

	if use ffmpeg; then
		myconf="${myconf} --enable-media=ffmpeg"
	fi

	if use kde; then
		myconf="${myconf} --enable-klash --with-qt-incl=${QTDIR}/include
			--with-qt-lib=${QTDIR}/$(get_libdir)"
	else
		myconf="${myconf} --disable-klash"
	fi

	econf \
		$(use_enable nsplugin plugin) \
		$(use_enable xml) \
		$(use_enable video_cards_i810 i810-lod-bias) \
		--without-gcc-arch --disable-debugger \
		${myconf} || die "econf failed"
	emake -j1 || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	use nsplugin && inst_plugin /opt/netscape/plugins/libgnashplugin.so \
		|| rm -rf "${D}/opt"
	dodoc AUTHORS ChangeLog NEWS README
}

pkg_postinst() {
	ewarn "ALPHA"
	ewarn "gnash is still in heavy development"
	ewarn "please report gnash bugs upstream to the gnash devs"
}