]> CyberLeo.Net >> Repos - CDN/portage-cdn.git/blob - www-plugins/gnash/gnash-0.8.10_p20160329-r2.ebuild
www-plugins/gnash: replace media-libs/speex[ogg] with media-libs/speexdsp
[CDN/portage-cdn.git] / www-plugins / gnash / gnash-0.8.10_p20160329-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 AT_M4DIR="cygnal"
6 # won't build with python-3, bug #392969
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit autotools eutils multilib nsplugins python-any-r1 flag-o-matic xdg-utils
10
11 DESCRIPTION="GNU Flash movie player that supports many SWF v7,8,9 features"
12 HOMEPAGE="https://www.gnu.org/software/gnash/"
13
14 if [[ ${PV} = 9999* ]]; then
15         SRC_URI=""
16         EGIT_REPO_URI="git://git.savannah.gnu.org/gnash.git"
17         inherit git-2
18 else
19 # Release tarball is b0rked, upstream #35612
20 #       SRC_URI="mirror://gnu/${PN}/${PV}/${P}.tar.bz2"
21         SRC_URI="mirror://gentoo/${P}.tar.xz"
22 fi
23
24 LICENSE="GPL-3"
25 SLOT="0"
26 KEYWORDS="amd64 ppc ~ppc64 ~sparc x86"
27 IUSE="X +agg cairo cygnal dbus directfb doc dump egl fbcon +ffmpeg libav libressl gnome gtk harden jemalloc lirc mysql +nls nsplugin opengl openvg python sdl +sdl-sound ssh ssl test vaapi"
28 REQUIRED_USE="
29         dump? ( agg ffmpeg )
30         fbcon? ( agg )
31         nsplugin? ( gtk )
32         openvg? ( egl )
33         python? ( gtk )
34         vaapi? ( agg ffmpeg )
35         || ( agg cairo opengl openvg )
36         || ( dump fbcon gtk sdl )
37 "
38
39 RDEPEND="
40         >=dev-libs/boost-1.41.0:0=
41         dev-libs/expat
42         dev-libs/libxml2:2
43         virtual/jpeg:0
44         media-libs/libpng:0=
45         net-misc/curl
46         x11-libs/libX11
47         x11-libs/libXi
48         x11-libs/libXmu
49         x11-libs/libXt
50         media-libs/giflib:=
51         x11-proto/xproto
52         agg? ( x11-libs/agg )
53         cairo? ( x11-libs/cairo )
54         directfb? (
55                 dev-libs/DirectFB
56         )
57         doc? (
58                 >=app-text/docbook2X-0.8.8
59                 app-text/docbook-sgml-utils
60         )
61         egl? (
62                 media-libs/mesa[egl]
63         )
64         fbcon? (
65                 x11-libs/tslib
66         )
67         ffmpeg? (
68                 libav? ( media-video/libav:0=[vaapi?] )
69                 !libav? ( media-video/ffmpeg:0=[vaapi?] )
70         )
71         gtk? (
72                 x11-libs/gtk+:2
73                 python? ( dev-python/pygtk:2 )
74         )
75         jemalloc? ( dev-libs/jemalloc )
76         opengl? (
77                 virtual/glu
78                 virtual/opengl
79                 gtk? ( x11-libs/gtkglext )
80         )
81         openvg? (
82                 media-libs/mesa[openvg]
83         )
84         sdl? ( media-libs/libsdl[X] )
85         sdl-sound? ( media-libs/libsdl )
86         media-libs/speexdsp
87         sys-libs/zlib
88         >=sys-devel/libtool-2.2
89         mysql? ( virtual/mysql )
90         lirc? ( app-misc/lirc )
91         dbus? ( sys-apps/dbus )
92         ssh?  ( >=net-libs/libssh-0.4[server] )
93         ssl? (
94                 libressl? ( dev-libs/libressl:0= )
95                 !libressl? ( dev-libs/openssl:0= )
96         )
97         vaapi? ( x11-libs/libva[opengl?] )
98         "
99 DEPEND="${RDEPEND}
100         virtual/pkgconfig
101         nls? ( sys-devel/gettext )
102         gnome? ( app-text/rarian )
103         nsplugin? ( net-misc/npapi-sdk )
104         test? ( dev-util/dejagnu )
105         ${PYTHON_DEPS}
106 "
107 # Tests hang with sandbox, bug #321017
108 RESTRICT="test"
109
110 pkg_setup() {
111         python-any-r1_pkg_setup
112
113         if use !ffmpeg; then
114                 ewarn "You are trying to build Gnash without choosing a media handler."
115                 ewarn "Sound and video playback will not work."
116         fi
117 }
118
119 src_unpack() {
120         default
121         # rename git snapshot directory to what portage expects
122         mv ${PN}-*/ ${P} || die
123 }
124
125 src_prepare() {
126         default
127
128         xdg_environment_reset # 591014
129
130         # Fix paths for klash, bug #339610
131         eapply "${FILESDIR}"/${PN}-0.8.9-klash.patch
132
133         # Use external dejagnu for tests, bug #321017
134         eapply "${FILESDIR}"/${PN}-0.8.9-external-dejagnu.patch
135
136         # Fix building on ppc64, bug #342535
137         use ppc64 && append-flags -mminimal-toc
138
139         # Fix kde multilib library path, bug #391283
140         eapply "${FILESDIR}"/${PN}-0.8.9-kde4-libdir.patch
141
142         # Fix libamf includes
143         eapply "${FILESDIR}"/${PN}-0.8.10-amf-include.patch
144
145         # Fix new adjacent_tokens_only() in >=boost-1.59 (bug 579142)
146         # See https://savannah.gnu.org/bugs/?46148
147         eapply "${FILESDIR}"/${PN}-0.8.10_p20150316-boost-1.60.patch
148
149         eautoreconf
150 }
151 src_configure() {
152         local device gui input media myconf myext renderers
153
154         # Set nsplugin install directory.
155         use nsplugin && myconf="${myconf} --with-npapi-plugindir=/usr/$(get_libdir)/gnash/npapi/"
156
157         # Set hardware acceleration.
158         use X && device+=",x11"
159         use directfb && device+=",directfb"
160         use egl && device+=",egl"
161         use fbcon && device+=",rawfb"
162         use vaapi && device+=",vaapi"
163         [[ "${device}x" == "x" ]] && device+=",none"
164
165         # Set rendering engine.
166         use agg && renderers+=",agg"
167         use cairo && renderers+=",cairo"
168         use opengl && renderers+=",opengl"
169         use openvg && renderers+=",openvg"
170
171         # Set media handler.
172         use ffmpeg || media+=",none"
173         use ffmpeg && media+=",ffmpeg"
174
175         # Set gui.
176         use dump && gui+=",dump"
177         use fbcon && gui+=",fb"
178         use gtk && gui+=",gtk"
179         use sdl && gui+=",sdl"
180
181         if use sdl-sound; then
182                 myconf="${myconf} --enable-sound=sdl"
183         else
184                 myconf="${myconf} --enable-sound=none"
185         fi
186
187         # Set extensions
188         use mysql && myext=",mysql"
189         use gtk && myext="${myext},gtk"
190         use lirc && myext="${myext},lirc"
191         use dbus && myext="${myext},dbus"
192
193         # Strip extra comma from gui, myext, hwaccel and renderers.
194         device=$( echo $device | sed -e 's/,//' )
195         gui=$( echo $gui | sed -e 's/^,//' )
196         myext=$( echo $myext | sed -e 's/,//' )
197         renderers=$( echo $renderers | sed -e 's/,//' )
198         media=$( echo $media | sed -e 's/,//' )
199
200         econf \
201                 --disable-kparts3 \
202                 --disable-kparts4 \
203                 --without-gconf \
204                 $(use_enable cygnal) \
205                 $(use_enable cygnal cgibins) \
206                 $(use_enable doc docbook) \
207                 $(use_enable gnome ghelp) \
208                 $(use_enable harden) \
209                 $(use_enable jemalloc) \
210                 $(use_enable nls) \
211                 $(use_enable nsplugin npapi) \
212                 $(use_enable python) \
213                 $(use_enable ssh) \
214                 $(use_enable ssl) \
215                 $(use_enable test testsuite) \
216                 --enable-gui=${gui} \
217                 --enable-device=${device} \
218                 --enable-extensions=${myext} \
219                 --enable-renderer=${renderers} \
220                 --enable-media=${media} \
221                 ${myconf}
222 }
223 src_test() {
224         local log=testsuite-results.txt
225         cd testsuite
226         emake check || die "make check failed"
227         ./anaylse-results.sh > $log || die "results analyze failed"
228         cat $log
229 }
230 src_install() {
231         emake DESTDIR="${D}" install || die "emake install failed"
232
233         # Install nsplugin in directory set by --with-npapi-plugindir.
234         if use nsplugin; then
235                 emake DESTDIR="${D}" install-plugin || die "install plugins failed"
236         fi
237
238         # Create a symlink in /usr/$(get_libdir)/nsbrowser/plugins to the nsplugin install directory.
239         use nsplugin && inst_plugin /usr/$(get_libdir)/gnash/npapi/libgnashplugin.so
240
241         # Remove eglinfo, bug #463654
242         if use egl; then
243                 rm -f "${D}"/usr/bin/eglinfo || die
244         fi
245
246         einstalldocs
247 }
248 pkg_postinst() {
249         if use !gnome || use !ffmpeg ; then
250                 ewarn ""
251                 ewarn "Gnash was built without a media handler and or http handler !"
252                 ewarn ""
253                 ewarn "If you want Gnash to support video then you will need to"
254                 ewarn "rebuild Gnash with the ffmpeg and gnome use flags set."
255                 ewarn ""
256         fi
257         ewarn "${PN} is still in heavy development"
258         ewarn "Please first report bugs on upstream gnashdevs and deal with them"
259         ewarn "And then report a Gentoo bug to the maintainer"
260 }