| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer2/mplayer2-9999.ebuild,v 1.1 2011/03/28 22:59:02 lu_zero Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
EGIT_REPO_URI="git://git.mplayer2.org/mplayer2.git"
|
| 8 |
[[ ${PV} = *9999* ]] && VCS_ECLASS="git"
|
| 9 |
|
| 10 |
inherit toolchain-funcs eutils flag-o-matic multilib base ${VCS_ECLASS}
|
| 11 |
|
| 12 |
namesuf="${PN/mplayer/}"
|
| 13 |
|
| 14 |
IUSE="3dnow 3dnowext +a52 aalib +alsa altivec aqua +ass bidi bindist bl bluray
|
| 15 |
bs2b cddb +cdio cdparanoia cpudetection custom-cpuopts custom-cflags debug dga
|
| 16 |
directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca esd +faad fbcon
|
| 17 |
ftp gif ggi +iconv ipv6 jack joystick jpeg kernel_linux ladspa
|
| 18 |
libcaca lirc +live mad md5sum +mmx mmxext mng mpg123 nas
|
| 19 |
+network nut +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime
|
| 20 |
radio +rar +real +rtc samba +shm +symlink sdl +speex sse sse2 ssse3
|
| 21 |
tga +theora +truetype +unicode v4l v4l2 vdpau
|
| 22 |
+vorbis win32codecs +X xanim xinerama +xscreensaver +xv xvmc"
|
| 23 |
|
| 24 |
VIDEO_CARDS="s3virge mga tdfx vesa"
|
| 25 |
for x in ${VIDEO_CARDS}; do
|
| 26 |
IUSE+=" video_cards_${x}"
|
| 27 |
done
|
| 28 |
|
| 29 |
FONT_URI="
|
| 30 |
mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
|
| 31 |
mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
|
| 32 |
mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
|
| 33 |
"
|
| 34 |
[[ ${PV} == *9999* ]] || \
|
| 35 |
RELEASE_URI="http://ftp.${PN}.org/pub/release/${P}.tar.xz"
|
| 36 |
SRC_URI="${RELEASE_URI}
|
| 37 |
!truetype? ( ${FONT_URI} )
|
| 38 |
"
|
| 39 |
|
| 40 |
DESCRIPTION="Media Player for Linux"
|
| 41 |
HOMEPAGE="http://www.mplayer2.org/"
|
| 42 |
|
| 43 |
FONT_RDEPS="
|
| 44 |
virtual/ttf-fonts
|
| 45 |
media-libs/fontconfig
|
| 46 |
>=media-libs/freetype-2.2.1:2
|
| 47 |
"
|
| 48 |
X_RDEPS="
|
| 49 |
x11-libs/libXext
|
| 50 |
x11-libs/libXxf86vm
|
| 51 |
"
|
| 52 |
# Rar: althrought -gpl version is nice, it cant do most functions normal rars can
|
| 53 |
# nemesi? ( net-libs/libnemesi )
|
| 54 |
RDEPEND+="
|
| 55 |
virtual/ffmpeg
|
| 56 |
sys-libs/ncurses
|
| 57 |
sys-libs/zlib
|
| 58 |
!bindist? (
|
| 59 |
x86? (
|
| 60 |
win32codecs? ( media-libs/win32codecs )
|
| 61 |
)
|
| 62 |
)
|
| 63 |
X? (
|
| 64 |
${X_RDEPS}
|
| 65 |
dga? ( x11-libs/libXxf86dga )
|
| 66 |
ggi? (
|
| 67 |
media-libs/libggi
|
| 68 |
media-libs/libggiwmh
|
| 69 |
)
|
| 70 |
opengl? ( virtual/opengl )
|
| 71 |
vdpau? ( x11-libs/libvdpau )
|
| 72 |
xinerama? ( x11-libs/libXinerama )
|
| 73 |
xscreensaver? ( x11-libs/libXScrnSaver )
|
| 74 |
xv? (
|
| 75 |
x11-libs/libXv
|
| 76 |
xvmc? ( x11-libs/libXvMC )
|
| 77 |
)
|
| 78 |
)
|
| 79 |
a52? ( media-libs/a52dec )
|
| 80 |
aalib? ( media-libs/aalib )
|
| 81 |
alsa? ( media-libs/alsa-lib )
|
| 82 |
ass? ( ${FONT_RDEPS} >=media-libs/libass-0.9.10[enca?,fontconfig] )
|
| 83 |
bidi? ( dev-libs/fribidi )
|
| 84 |
bluray? ( media-libs/libbluray )
|
| 85 |
bs2b? ( media-libs/libbs2b )
|
| 86 |
cdio? ( dev-libs/libcdio )
|
| 87 |
cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
|
| 88 |
directfb? ( dev-libs/DirectFB )
|
| 89 |
dts? ( media-libs/libdca )
|
| 90 |
dv? ( media-libs/libdv )
|
| 91 |
dvb? ( media-tv/linuxtv-dvb-headers )
|
| 92 |
dvd? (
|
| 93 |
>=media-libs/libdvdread-4.1.3
|
| 94 |
dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
|
| 95 |
)
|
| 96 |
esd? ( media-sound/esound )
|
| 97 |
enca? ( app-i18n/enca )
|
| 98 |
faad? ( media-libs/faad2 )
|
| 99 |
gif? ( media-libs/giflib )
|
| 100 |
iconv? ( virtual/libiconv )
|
| 101 |
jack? ( media-sound/jack-audio-connection-kit )
|
| 102 |
jpeg? ( virtual/jpeg )
|
| 103 |
ladspa? ( media-libs/ladspa-sdk )
|
| 104 |
libcaca? ( media-libs/libcaca )
|
| 105 |
lirc? ( app-misc/lirc )
|
| 106 |
live? ( media-plugins/live )
|
| 107 |
mad? ( media-libs/libmad )
|
| 108 |
mng? ( media-libs/libmng )
|
| 109 |
mpg123? ( media-sound/mpg123 )
|
| 110 |
nas? ( media-libs/nas )
|
| 111 |
nut? ( >=media-libs/libnut-661 )
|
| 112 |
png? ( media-libs/libpng )
|
| 113 |
pnm? ( media-libs/netpbm )
|
| 114 |
pulseaudio? ( media-sound/pulseaudio )
|
| 115 |
rar? (
|
| 116 |
|| (
|
| 117 |
app-arch/unrar
|
| 118 |
app-arch/rar
|
| 119 |
)
|
| 120 |
)
|
| 121 |
samba? ( net-fs/samba )
|
| 122 |
sdl? ( media-libs/libsdl )
|
| 123 |
speex? ( media-libs/speex )
|
| 124 |
theora? ( media-libs/libtheora )
|
| 125 |
truetype? ( ${FONT_RDEPS} )
|
| 126 |
vorbis? ( media-libs/libvorbis )
|
| 127 |
xanim? ( media-video/xanim )
|
| 128 |
symlink? ( !media-video/mplayer )
|
| 129 |
"
|
| 130 |
|
| 131 |
X_DEPS="
|
| 132 |
x11-proto/videoproto
|
| 133 |
x11-proto/xf86vidmodeproto
|
| 134 |
"
|
| 135 |
ASM_DEP="dev-lang/yasm"
|
| 136 |
DEPEND="${RDEPEND}
|
| 137 |
dev-util/pkgconfig
|
| 138 |
dev-lang/python
|
| 139 |
sys-devel/gettext
|
| 140 |
X? (
|
| 141 |
${X_DEPS}
|
| 142 |
dga? ( x11-proto/xf86dgaproto )
|
| 143 |
dxr3? ( media-video/em8300-libraries )
|
| 144 |
xinerama? ( x11-proto/xineramaproto )
|
| 145 |
xscreensaver? ( x11-proto/scrnsaverproto )
|
| 146 |
)
|
| 147 |
amd64? ( ${ASM_DEP} )
|
| 148 |
doc? (
|
| 149 |
dev-libs/libxslt app-text/docbook-xml-dtd
|
| 150 |
app-text/docbook-xsl-stylesheets
|
| 151 |
)
|
| 152 |
x86? ( ${ASM_DEP} )
|
| 153 |
x86-fbsd? ( ${ASM_DEP} )
|
| 154 |
"
|
| 155 |
|
| 156 |
SLOT="0"
|
| 157 |
LICENSE="GPL-3"
|
| 158 |
if [[ ${PV} != *9999* ]]; then
|
| 159 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
|
| 160 |
else
|
| 161 |
KEYWORDS=""
|
| 162 |
fi
|
| 163 |
|
| 164 |
# bindist does not cope with win32codecs, which are nonfree
|
| 165 |
REQUIRED_USE="bindist? ( !win32codecs )"
|
| 166 |
|
| 167 |
PATCHES=(
|
| 168 |
)
|
| 169 |
|
| 170 |
pkg_setup() {
|
| 171 |
if [[ ${PV} == *9999* ]]; then
|
| 172 |
elog
|
| 173 |
elog "This is a live ebuild which installs the latest from upstream's"
|
| 174 |
elog "${VCS_ECLASS} repository, and is unsupported by Gentoo."
|
| 175 |
elog "Everything but bugs in the ebuild itself will be ignored."
|
| 176 |
elog
|
| 177 |
fi
|
| 178 |
|
| 179 |
if use cpudetection; then
|
| 180 |
ewarn
|
| 181 |
ewarn "You've enabled the cpudetection flag. This feature is"
|
| 182 |
ewarn "included mainly for people who want to use the same"
|
| 183 |
ewarn "binary on another system with a different CPU architecture."
|
| 184 |
ewarn "MPlayer will already detect your CPU settings by default at"
|
| 185 |
ewarn "buildtime; this flag is used for runtime detection."
|
| 186 |
ewarn "You won't need this turned on if you are only building"
|
| 187 |
ewarn "mplayer for this system. Also, if your compile fails, try"
|
| 188 |
ewarn "disabling this use flag."
|
| 189 |
fi
|
| 190 |
|
| 191 |
if use custom-cpuopts; then
|
| 192 |
ewarn
|
| 193 |
ewarn "You are using the custom-cpuopts flag which will"
|
| 194 |
ewarn "specifically allow you to enable / disable certain"
|
| 195 |
ewarn "CPU optimizations."
|
| 196 |
ewarn
|
| 197 |
ewarn "Most desktop users won't need this functionality, but it"
|
| 198 |
ewarn "is included for corner cases like cross-compiling and"
|
| 199 |
ewarn "certain profiles. If unsure, disable this flag and MPlayer"
|
| 200 |
ewarn "will automatically detect and use your available CPU"
|
| 201 |
ewarn "optimizations."
|
| 202 |
ewarn
|
| 203 |
ewarn "Using this flag means your build is unsupported, so"
|
| 204 |
ewarn "please make sure your CPU optimization use flags (3dnow"
|
| 205 |
ewarn "3dnowext mmx mmxext sse sse2 ssse3) are properly set."
|
| 206 |
fi
|
| 207 |
|
| 208 |
einfo "For various format support you need to enable the support on your ffmpeg package:"
|
| 209 |
einfo " media-video/libav or media-video/ffmpeg"
|
| 210 |
}
|
| 211 |
|
| 212 |
src_unpack() {
|
| 213 |
if [[ ${PV} = *9999* ]]; then
|
| 214 |
git_src_unpack
|
| 215 |
else
|
| 216 |
unpack ${A}
|
| 217 |
fi
|
| 218 |
|
| 219 |
if ! use truetype; then
|
| 220 |
unpack font-arial-iso-8859-1.tar.bz2 \
|
| 221 |
font-arial-iso-8859-2.tar.bz2 \
|
| 222 |
font-arial-cp1250.tar.bz2
|
| 223 |
fi
|
| 224 |
}
|
| 225 |
|
| 226 |
src_prepare() {
|
| 227 |
if [[ ${PV} = *9999* ]]; then
|
| 228 |
git_src_prepare
|
| 229 |
# Set GIT version manually
|
| 230 |
echo "GIT-r$(git rev-list HEAD|wc -l)-$(git describe --always)" \
|
| 231 |
> VERSION || die
|
| 232 |
fi
|
| 233 |
|
| 234 |
# fix path to bash executable in configure scripts
|
| 235 |
local bash_scripts="configure version.sh"
|
| 236 |
sed -i \
|
| 237 |
-e "1c\#!${EPREFIX}/bin/bash" \
|
| 238 |
${bash_scripts} || die
|
| 239 |
|
| 240 |
# We want mplayer${namesuf}
|
| 241 |
if [[ -n ${namesuf} ]]; then
|
| 242 |
sed -e "/elif linux ; then/a\ _exesuf=\"${namesuf}\"" \
|
| 243 |
-i configure || die
|
| 244 |
sed -e "/ -m 644 DOCS\/man\/en\/mplayer/i\ mv DOCS\/man\/en\/mplayer.1 DOCS\/man\/en\/mplayer${namesuf}.1" \
|
| 245 |
-e "/ -m 644 DOCS\/man\/\$(lang)\/mplayer/i\ mv DOCS\/man\/\$(lang)\/mplayer.1 DOCS\/man\/\$(lang)\/mplayer${namesuf}.1" \
|
| 246 |
-e "s/er.1/er${namesuf}.1/g" \
|
| 247 |
-i Makefile || die
|
| 248 |
sed -e "s/mplayer/mplayer${namesuf}/" \
|
| 249 |
-i TOOLS/midentify.sh || die
|
| 250 |
fi
|
| 251 |
|
| 252 |
base_src_prepare
|
| 253 |
}
|
| 254 |
|
| 255 |
src_configure() {
|
| 256 |
local myconf=""
|
| 257 |
local uses i
|
| 258 |
|
| 259 |
# set LINGUAS
|
| 260 |
[[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
|
| 261 |
|
| 262 |
# mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
|
| 263 |
# compilation in almost every situation. The reason for this is
|
| 264 |
# because if --enable is used, it will force the build of that option,
|
| 265 |
# regardless of whether the dependency is available or not.
|
| 266 |
|
| 267 |
###################
|
| 268 |
#Optional features#
|
| 269 |
###################
|
| 270 |
# disable svga since we don't want it
|
| 271 |
# disable arts since we don't have kde3
|
| 272 |
# disable tremor, it needs libvorbisidec and is for FPU-less systems only
|
| 273 |
myconf+="
|
| 274 |
--disable-svga
|
| 275 |
--disable-arts
|
| 276 |
--disable-kai
|
| 277 |
--disable-tremor
|
| 278 |
$(use_enable network networking)
|
| 279 |
$(use_enable joystick)
|
| 280 |
"
|
| 281 |
uses="ass bl bluray enca ftp rtc" # nemesi <- not working with in-tree ebuild
|
| 282 |
myconf+=" --disable-nemesi" # nemesi automagic disable
|
| 283 |
for i in ${uses}; do
|
| 284 |
use ${i} || myconf+=" --disable-${i}"
|
| 285 |
done
|
| 286 |
use bidi || myconf+=" --disable-fribidi"
|
| 287 |
use ipv6 || myconf+=" --disable-inet6"
|
| 288 |
use nut || myconf+=" --disable-libnut"
|
| 289 |
use rar || myconf+=" --disable-unrarexec"
|
| 290 |
use samba || myconf+=" --disable-smb"
|
| 291 |
if ! use lirc; then
|
| 292 |
myconf+="
|
| 293 |
--disable-lirc
|
| 294 |
--disable-lircc
|
| 295 |
--disable-apple-ir
|
| 296 |
"
|
| 297 |
fi
|
| 298 |
|
| 299 |
# libcdio support: prefer libcdio over cdparanoia
|
| 300 |
# don't check for cddb w/cdio
|
| 301 |
if use cdio; then
|
| 302 |
myconf+=" --disable-cdparanoia"
|
| 303 |
else
|
| 304 |
myconf+=" --disable-libcdio"
|
| 305 |
use cdparanoia || myconf+=" --disable-cdparanoia"
|
| 306 |
use cddb || myconf+=" --disable-cddb"
|
| 307 |
fi
|
| 308 |
|
| 309 |
################################
|
| 310 |
# DVD read, navigation support #
|
| 311 |
################################
|
| 312 |
#
|
| 313 |
# dvdread - accessing a DVD
|
| 314 |
# dvdnav - navigation of menus
|
| 315 |
#
|
| 316 |
# use external libdvdcss, dvdread and dvdnav
|
| 317 |
myconf+=" --disable-dvdread-internal --disable-libdvdcss-internal"
|
| 318 |
if use dvd; then
|
| 319 |
use dvdnav || myconf+=" --disable-dvdnav"
|
| 320 |
else
|
| 321 |
myconf+="
|
| 322 |
--disable-dvdnav
|
| 323 |
--disable-dvdread
|
| 324 |
"
|
| 325 |
fi
|
| 326 |
|
| 327 |
#############
|
| 328 |
# Subtitles #
|
| 329 |
#############
|
| 330 |
# SRT/ASS/SSA (subtitles) requires freetype support
|
| 331 |
# freetype support requires iconv
|
| 332 |
# iconv optionally can use unicode
|
| 333 |
if ! use ass && ! use truetype; then
|
| 334 |
myconf+=" --disable-freetype"
|
| 335 |
if ! use iconv; then
|
| 336 |
myconf+="
|
| 337 |
--disable-iconv
|
| 338 |
--charset=noconv
|
| 339 |
"
|
| 340 |
fi
|
| 341 |
fi
|
| 342 |
use iconv && use unicode && myconf+=" --charset=UTF-8"
|
| 343 |
|
| 344 |
#####################################
|
| 345 |
# DVB / Video4Linux / Radio support #
|
| 346 |
#####################################
|
| 347 |
myconf+=" --disable-tv-bsdbt848"
|
| 348 |
# broken upstream, won't work with recent kernels
|
| 349 |
myconf+=" --disable-ivtv"
|
| 350 |
if { use dvb || use v4l || use v4l2 || use pvr || use radio; }; then
|
| 351 |
use dvb || myconf+=" --disable-dvb"
|
| 352 |
use pvr || myconf+=" --disable-pvr"
|
| 353 |
use v4l || myconf+=" --disable-tv-v4l1"
|
| 354 |
use v4l2 || myconf+=" --disable-tv-v4l2"
|
| 355 |
if use radio && { use dvb || use v4l || use v4l2; }; then
|
| 356 |
myconf+="
|
| 357 |
--enable-radio
|
| 358 |
--disable-radio-capture
|
| 359 |
"
|
| 360 |
else
|
| 361 |
myconf+="
|
| 362 |
--disable-radio-v4l2
|
| 363 |
--disable-radio-bsdbt848
|
| 364 |
"
|
| 365 |
fi
|
| 366 |
else
|
| 367 |
myconf+="
|
| 368 |
--disable-tv
|
| 369 |
--disable-tv-v4l1
|
| 370 |
--disable-tv-v4l2
|
| 371 |
--disable-radio
|
| 372 |
--disable-radio-v4l2
|
| 373 |
--disable-radio-bsdbt848
|
| 374 |
--disable-dvb
|
| 375 |
--disable-v4l2
|
| 376 |
--disable-pvr"
|
| 377 |
fi
|
| 378 |
|
| 379 |
##########
|
| 380 |
# Codecs #
|
| 381 |
##########
|
| 382 |
myconf+=" --disable-musepack" # deprecated, libavcodec Musepack decoder is preferred
|
| 383 |
myconf+=" --disable-mp3lib" # internal so disable
|
| 384 |
use dts || myconf+=" --disable-libdca"
|
| 385 |
uses="a52 bs2b dv vorbis"
|
| 386 |
for i in ${uses}; do
|
| 387 |
use ${i} || myconf+=" --disable-lib${i}"
|
| 388 |
done
|
| 389 |
uses="faad gif jpeg live mad mng mpg123 png pnm speex tga theora xanim"
|
| 390 |
for i in ${uses}; do
|
| 391 |
use ${i} || myconf+=" --disable-${i}"
|
| 392 |
done
|
| 393 |
|
| 394 |
# Encoding
|
| 395 |
uses="xvid"
|
| 396 |
for i in ${uses}; do
|
| 397 |
myconf+=" --disable-${i}"
|
| 398 |
done
|
| 399 |
|
| 400 |
#################
|
| 401 |
# Binary codecs #
|
| 402 |
#################
|
| 403 |
# bug 213836
|
| 404 |
if ! use x86 || ! use win32codecs; then
|
| 405 |
use quicktime || myconf+=" --disable-qtx"
|
| 406 |
fi
|
| 407 |
|
| 408 |
######################
|
| 409 |
# RealPlayer support #
|
| 410 |
######################
|
| 411 |
# Realplayer support shows up in four places:
|
| 412 |
# - libavcodec (internal)
|
| 413 |
# - win32codecs
|
| 414 |
# - realcodecs (win32codecs libs)
|
| 415 |
# - realcodecs (realplayer libs)
|
| 416 |
|
| 417 |
# internal
|
| 418 |
use real || myconf+=" --disable-real"
|
| 419 |
|
| 420 |
# Real binary codec support only available on x86, amd64
|
| 421 |
if use real; then
|
| 422 |
use x86 && myconf+=" --codecsdir=/opt/RealPlayer/codecs"
|
| 423 |
use amd64 && myconf+=" --codecsdir=/usr/$(get_libdir)/codecs"
|
| 424 |
fi
|
| 425 |
myconf+=" $(use_enable win32codecs win32dll)"
|
| 426 |
|
| 427 |
################
|
| 428 |
# Video Output #
|
| 429 |
################
|
| 430 |
uses="directfb md5sum sdl"
|
| 431 |
for i in ${uses}; do
|
| 432 |
use ${i} || myconf+=" --disable-${i}"
|
| 433 |
done
|
| 434 |
use aalib || myconf+=" --disable-aa"
|
| 435 |
use fbcon || myconf+=" --disable-fbdev"
|
| 436 |
use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
|
| 437 |
use libcaca || myconf+=" --disable-caca"
|
| 438 |
|
| 439 |
if ! use kernel_linux || ! use video_cards_mga; then
|
| 440 |
myconf+=" --disable-mga --disable-xmga"
|
| 441 |
fi
|
| 442 |
|
| 443 |
if use video_cards_tdfx; then
|
| 444 |
myconf+="
|
| 445 |
$(use_enable video_cards_tdfx tdfxvid)
|
| 446 |
$(use_enable fbcon tdfxfb)
|
| 447 |
"
|
| 448 |
else
|
| 449 |
myconf+="
|
| 450 |
--disable-3dfx
|
| 451 |
--disable-tdfxvid
|
| 452 |
--disable-tdfxfb
|
| 453 |
"
|
| 454 |
fi
|
| 455 |
|
| 456 |
# sun card, disable by default, see bug #258729
|
| 457 |
myconf+=" --disable-xvr100"
|
| 458 |
|
| 459 |
################
|
| 460 |
# Audio Output #
|
| 461 |
################
|
| 462 |
uses="alsa esd jack ladspa nas"
|
| 463 |
for i in ${uses}; do
|
| 464 |
use ${i} || myconf+=" --disable-${i}"
|
| 465 |
done
|
| 466 |
#use openal && myconf+=" --enable-openal" # build fails
|
| 467 |
use pulseaudio || myconf+=" --disable-pulse"
|
| 468 |
if ! use radio; then
|
| 469 |
use oss || myconf+=" --disable-ossaudio"
|
| 470 |
fi
|
| 471 |
|
| 472 |
####################
|
| 473 |
# Advanced Options #
|
| 474 |
####################
|
| 475 |
# Platform specific flags, hardcoded on amd64 (see below)
|
| 476 |
use cpudetection && myconf+=" --enable-runtime-cpudetection"
|
| 477 |
|
| 478 |
# Turning off CPU optimizations usually will break the build.
|
| 479 |
# However, this use flag, if enabled, will allow users to completely
|
| 480 |
# specify which ones to use. If disabled, mplayer will automatically
|
| 481 |
# enable all CPU optimizations that the host build supports.
|
| 482 |
if use custom-cpuopts; then
|
| 483 |
uses="3dnow 3dnowext altivec mmx mmxext shm sse sse2 ssse3"
|
| 484 |
for i in ${uses}; do
|
| 485 |
myconf+=" $(use_enable ${i})"
|
| 486 |
done
|
| 487 |
fi
|
| 488 |
|
| 489 |
use debug && myconf+=" --enable-debug=3"
|
| 490 |
|
| 491 |
if use x86 && gcc-specs-pie; then
|
| 492 |
filter-flags -fPIC -fPIE
|
| 493 |
append-ldflags -nopie
|
| 494 |
fi
|
| 495 |
|
| 496 |
is-flag -O? || append-flags -O2
|
| 497 |
|
| 498 |
# workaround bug, x86 just has too few registers, see c.f.
|
| 499 |
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=402950#44
|
| 500 |
# and 32-bits OSX, bug 329861
|
| 501 |
if [[ ${CHOST} == i?86-* ]] ; then
|
| 502 |
use debug || append-flags -fomit-frame-pointer
|
| 503 |
fi
|
| 504 |
|
| 505 |
###########################
|
| 506 |
# X enabled configuration #
|
| 507 |
###########################
|
| 508 |
if use X; then
|
| 509 |
uses="dxr3 ggi xinerama"
|
| 510 |
for i in ${uses}; do
|
| 511 |
use ${i} || myconf+=" --disable-${i}"
|
| 512 |
done
|
| 513 |
use dga || myconf+=" --disable-dga1 --disable-dga2"
|
| 514 |
use opengl || myconf+=" --disable-gl"
|
| 515 |
use osdmenu && myconf+=" --enable-menu"
|
| 516 |
use vdpau || myconf+=" --disable-vdpau"
|
| 517 |
use video_cards_vesa || myconf+=" --disable-vesa"
|
| 518 |
use xscreensaver || myconf+=" --disable-xss"
|
| 519 |
|
| 520 |
if use xv; then
|
| 521 |
if use xvmc; then
|
| 522 |
myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
|
| 523 |
else
|
| 524 |
myconf+=" --disable-xvmc"
|
| 525 |
fi
|
| 526 |
else
|
| 527 |
myconf+="
|
| 528 |
--disable-xv
|
| 529 |
--disable-xvmc
|
| 530 |
"
|
| 531 |
use xvmc && elog "Disabling xvmc because it requires \"xv\" useflag enabled."
|
| 532 |
fi
|
| 533 |
else
|
| 534 |
myconf+="
|
| 535 |
--disable-dga1
|
| 536 |
--disable-dga2
|
| 537 |
--disable-dxr3
|
| 538 |
--disable-ggi
|
| 539 |
--disable-gl
|
| 540 |
--disable-vdpau
|
| 541 |
--disable-xinerama
|
| 542 |
--disable-xss
|
| 543 |
--disable-xv
|
| 544 |
--disable-xvmc
|
| 545 |
--disable-x11
|
| 546 |
"
|
| 547 |
uses="dga dxr3 ggi opengl osdmenu vdpau xinerama xscreensaver xv"
|
| 548 |
for i in ${uses}; do
|
| 549 |
use ${i} && elog "Useflag \"${i}\" require \"X\" useflag enabled to work."
|
| 550 |
done
|
| 551 |
fi
|
| 552 |
|
| 553 |
############################
|
| 554 |
# OSX (aqua) configuration #
|
| 555 |
############################
|
| 556 |
if use aqua; then
|
| 557 |
myconf+="
|
| 558 |
--enable-macosx-finder
|
| 559 |
--enable-macosx-bundle
|
| 560 |
"
|
| 561 |
fi
|
| 562 |
|
| 563 |
./configure \
|
| 564 |
--cc=$(tc-getCC) \
|
| 565 |
--host-cc=$(tc-getBUILD_CC) \
|
| 566 |
--prefix="${EPREFIX}"/usr \
|
| 567 |
--bindir="${EPREFIX}"/usr/bin \
|
| 568 |
--libdir="${EPREFIX}"/usr/$(get_libdir) \
|
| 569 |
--confdir="${EPREFIX}"/etc/mplayer${namesuf} \
|
| 570 |
--datadir="${EPREFIX}"/usr/share/mplayer${namesuf} \
|
| 571 |
--mandir="${EPREFIX}"/usr/share/man \
|
| 572 |
--localedir="${EPREFIX}"/usr/share/locale \
|
| 573 |
--enable-translation \
|
| 574 |
${myconf} || die
|
| 575 |
}
|
| 576 |
|
| 577 |
src_compile() {
|
| 578 |
base_src_compile
|
| 579 |
# Build only user-requested docs if they're available.
|
| 580 |
if use doc ; then
|
| 581 |
pushd mplayer
|
| 582 |
# select available languages from $LINGUAS
|
| 583 |
LINGUAS=${LINGUAS/zh/zh_CN}
|
| 584 |
local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
|
| 585 |
local BUILT_DOCS=""
|
| 586 |
for i in ${LINGUAS} ; do
|
| 587 |
hasq ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
|
| 588 |
done
|
| 589 |
if [[ -z $BUILT_DOCS ]]; then
|
| 590 |
emake -j1 -C DOCS/xml html-chunked
|
| 591 |
else
|
| 592 |
for i in ${BUILT_DOCS}; do
|
| 593 |
emake -j1 -C DOCS/xml html-chunked-${i}
|
| 594 |
done
|
| 595 |
fi
|
| 596 |
fi
|
| 597 |
}
|
| 598 |
|
| 599 |
src_install() {
|
| 600 |
local i
|
| 601 |
|
| 602 |
emake \
|
| 603 |
DESTDIR="${D}" \
|
| 604 |
INSTALLSTRIP="" \
|
| 605 |
install
|
| 606 |
|
| 607 |
dodoc AUTHORS Copyright README etc/codecs.conf
|
| 608 |
|
| 609 |
docinto tech/
|
| 610 |
dodoc DOCS/tech/{*.txt,mpsub.sub,playtree}
|
| 611 |
docinto TOOLS/
|
| 612 |
dodoc -r TOOLS
|
| 613 |
if use real; then
|
| 614 |
docinto tech/realcodecs/
|
| 615 |
dodoc DOCS/tech/realcodecs/*
|
| 616 |
fi
|
| 617 |
|
| 618 |
if use doc; then
|
| 619 |
docinto html/
|
| 620 |
dohtml -r "${S}"/DOCS/HTML/*
|
| 621 |
fi
|
| 622 |
|
| 623 |
if ! use ass && ! use truetype; then
|
| 624 |
dodir /usr/share/mplayer${namesuf}/fonts
|
| 625 |
# Do this generic, as the mplayer people like to change the structure
|
| 626 |
# of their zips ...
|
| 627 |
for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
|
| 628 |
cp -pPR "${i}" "${ED}/usr/share/mplayer${namesuf}/fonts"
|
| 629 |
done
|
| 630 |
# Fix the font symlink ...
|
| 631 |
rm -rf "${ED}/usr/share/mplayer${namesuf}/font"
|
| 632 |
dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer${namesuf}/font
|
| 633 |
fi
|
| 634 |
|
| 635 |
insinto /etc/mplayer${namesuf}
|
| 636 |
newins "${S}/etc/example.conf" mplayer.conf
|
| 637 |
cat >> "${ED}/etc/mplayer${namesuf}/mplayer.conf" << _EOF_
|
| 638 |
# Config options can be section specific, global
|
| 639 |
# options should go in the default section
|
| 640 |
[default]
|
| 641 |
_EOF_
|
| 642 |
doins "${S}/etc/input.conf"
|
| 643 |
if use osdmenu; then
|
| 644 |
doins "${S}/etc/menu.conf"
|
| 645 |
fi
|
| 646 |
|
| 647 |
if use ass || use truetype; then
|
| 648 |
cat >> "${ED}/etc/mplayer${namesuf}/mplayer.conf" << _EOF_
|
| 649 |
fontconfig=1
|
| 650 |
subfont-osd-scale=4
|
| 651 |
subfont-text-scale=3
|
| 652 |
_EOF_
|
| 653 |
fi
|
| 654 |
|
| 655 |
# bug 256203
|
| 656 |
if use rar; then
|
| 657 |
cat >> "${ED}/etc/mplayer${namesuf}/mplayer.conf" << _EOF_
|
| 658 |
unrarexec=${EPREFIX}/usr/bin/unrar
|
| 659 |
_EOF_
|
| 660 |
fi
|
| 661 |
dosym ../../../etc/mplayer${namesuf}/mplayer.conf /usr/share/mplayer${namesuf}/mplayer.conf
|
| 662 |
|
| 663 |
newbin "${S}/TOOLS/midentify.sh" midentify${namesuf}
|
| 664 |
|
| 665 |
if [[ -n ${namesuf} ]] && use symlink; then
|
| 666 |
dosym /etc/mplayer${namesuf} /etc/mplayer
|
| 667 |
dosym "mplayer${namesuf}" /usr/bin/mplayer
|
| 668 |
dosym "midentify${namesuf}" /usr/bin/midentify
|
| 669 |
fi
|
| 670 |
}
|