mplayer-1.2.1.ebuild 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. EGIT_REPO_URI="git://git.videolan.org/ffmpeg.git"
  5. ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk"
  6. [[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git-2" || SVN_ECLASS=""
  7. inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS}
  8. IUSE="cpu_flags_x86_3dnow cpu_flags_x86_3dnowext a52 aalib +alsa altivec aqua bidi bl bluray
  9. bs2b cddb +cdio cdparanoia cpudetection debug dga
  10. directfb doc dts dv dvb +dvd +dvdnav +enca +encode faac faad fbcon
  11. ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa
  12. +libass libcaca libmpeg2 lirc live lzo mad md5sum +cpu_flags_x86_mmx cpu_flags_x86_mmxext mng mp3 nas
  13. +network nut openal opengl +osdmenu oss png pnm pulseaudio pvr
  14. radio rar rtc rtmp samba selinux +shm sdl speex cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_ssse3
  15. tga theora tremor +truetype toolame twolame +unicode v4l vcd vdpau vidix
  16. vorbis +X x264 xinerama +xscreensaver +xv xvid xvmc yuv4mpeg zoran"
  17. VIDEO_CARDS="s3virge mga tdfx"
  18. for x in ${VIDEO_CARDS}; do
  19. IUSE+=" video_cards_${x}"
  20. done
  21. FONT_URI="
  22. mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
  23. mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
  24. mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
  25. "
  26. if [[ ${PV} == *9999* ]]; then
  27. RELEASE_URI=""
  28. elif [ "${PV%_rc*}" = "${PV}" -a "${PV%_pre*}" = "${PV}" ]; then
  29. MY_P="MPlayer-${PV}"
  30. S="${WORKDIR}/${MY_P}"
  31. RELEASE_URI="mirror://mplayer/releases/${MY_P}.tar.xz"
  32. else
  33. RELEASE_URI="mirror://gentoo/${P}.tar.xz"
  34. fi
  35. SRC_URI="${RELEASE_URI}
  36. !truetype? ( ${FONT_URI} )"
  37. DESCRIPTION="Media Player for Linux"
  38. HOMEPAGE="http://www.mplayerhq.hu/"
  39. FONT_RDEPS="
  40. virtual/ttf-fonts
  41. media-libs/fontconfig
  42. >=media-libs/freetype-2.2.1:2
  43. "
  44. X_RDEPS="
  45. x11-libs/libXext
  46. x11-libs/libXxf86vm
  47. "
  48. # Rar: althrought -gpl version is nice, it cant do most functions normal rars can
  49. # nemesi? ( net-libs/libnemesi )
  50. RDEPEND+="
  51. sys-libs/ncurses:0=
  52. app-arch/bzip2
  53. sys-libs/zlib
  54. >=media-video/ffmpeg-2.6:0=[vdpau?]
  55. a52? ( media-libs/a52dec )
  56. aalib? ( media-libs/aalib )
  57. alsa? ( media-libs/alsa-lib )
  58. bidi? ( dev-libs/fribidi )
  59. bluray? ( >=media-libs/libbluray-0.2.1 )
  60. bs2b? ( media-libs/libbs2b )
  61. cdio? ( dev-libs/libcdio dev-libs/libcdio-paranoia )
  62. cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
  63. dga? ( x11-libs/libXxf86dga )
  64. directfb? ( dev-libs/DirectFB )
  65. dts? ( media-libs/libdca )
  66. dv? ( media-libs/libdv )
  67. dvb? ( virtual/linuxtv-dvb-headers )
  68. dvd? ( >=media-libs/libdvdread-4.1.3 )
  69. dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
  70. encode? (
  71. !twolame? ( toolame? ( media-sound/toolame ) )
  72. twolame? ( media-sound/twolame )
  73. faac? ( media-libs/faac )
  74. mp3? ( media-sound/lame )
  75. x264? ( >=media-libs/x264-0.0.20100423:= )
  76. xvid? ( media-libs/xvid )
  77. )
  78. enca? ( app-i18n/enca )
  79. faad? ( media-libs/faad2 )
  80. ggi? ( media-libs/libggi media-libs/libggiwmh )
  81. gif? ( media-libs/giflib:0= )
  82. gsm? ( media-sound/gsm )
  83. iconv? ( virtual/libiconv )
  84. jack? ( media-sound/jack-audio-connection-kit )
  85. jpeg? ( virtual/jpeg:0 )
  86. jpeg2k? ( media-libs/openjpeg:0 )
  87. ladspa? ( media-libs/ladspa-sdk )
  88. libass? ( >=media-libs/libass-0.9.10:= )
  89. libcaca? ( media-libs/libcaca )
  90. libmpeg2? ( media-libs/libmpeg2 )
  91. lirc? ( app-misc/lirc )
  92. live? ( media-plugins/live )
  93. lzo? ( >=dev-libs/lzo-2 )
  94. mad? ( media-libs/libmad )
  95. mng? ( media-libs/libmng:= )
  96. mp3? ( media-sound/mpg123 )
  97. nas? ( media-libs/nas )
  98. nut? ( >=media-libs/libnut-661 )
  99. openal? ( media-libs/openal )
  100. opengl? ( virtual/opengl )
  101. png? ( media-libs/libpng:0= )
  102. pnm? ( media-libs/netpbm )
  103. pulseaudio? ( media-sound/pulseaudio )
  104. rar? (
  105. || (
  106. app-arch/unrar
  107. app-arch/rar
  108. )
  109. )
  110. rtmp? ( media-video/rtmpdump )
  111. samba? ( net-fs/samba )
  112. sdl? ( media-libs/libsdl )
  113. speex? ( media-libs/speex )
  114. theora? ( media-libs/libtheora[encode?] )
  115. tremor? ( media-libs/tremor )
  116. truetype? ( ${FONT_RDEPS} )
  117. vdpau? ( x11-libs/libvdpau )
  118. vorbis? ( !tremor? ( media-libs/libvorbis ) )
  119. X? ( ${X_RDEPS} )
  120. xinerama? ( x11-libs/libXinerama )
  121. xscreensaver? ( x11-libs/libXScrnSaver )
  122. xv? ( x11-libs/libXv )
  123. xvmc? ( x11-libs/libXvMC )
  124. "
  125. X_DEPS="
  126. x11-proto/videoproto
  127. x11-proto/xf86vidmodeproto
  128. "
  129. ASM_DEP="dev-lang/yasm"
  130. DEPEND="${RDEPEND}
  131. virtual/pkgconfig
  132. dga? ( x11-proto/xf86dgaproto )
  133. X? ( ${X_DEPS} )
  134. xinerama? ( x11-proto/xineramaproto )
  135. xscreensaver? ( x11-proto/scrnsaverproto )
  136. amd64? ( ${ASM_DEP} )
  137. doc? (
  138. dev-libs/libxslt app-text/docbook-xml-dtd
  139. app-text/docbook-xsl-stylesheets
  140. )
  141. x86? ( ${ASM_DEP} )
  142. x86-fbsd? ( ${ASM_DEP} )
  143. "
  144. RDEPEND+="
  145. selinux? ( sec-policy/selinux-mplayer )
  146. "
  147. SLOT="0"
  148. LICENSE="GPL-2"
  149. if [[ ${PV} != *9999* ]]; then
  150. KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
  151. else
  152. KEYWORDS="alpha arm hppa ia64 ppc ppc64 sparc"
  153. fi
  154. # faac codecs are nonfree
  155. # libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio
  156. # dvd navigation requires dvd read support
  157. # ass and freetype font require iconv and ass requires freetype fonts
  158. # unicode transformations are usefull only with iconv
  159. # radio requires oss or alsa backend
  160. # xvmc requires xvideo support
  161. REQUIRED_USE="
  162. dga? ( X )
  163. dvdnav? ( dvd )
  164. enca? ( iconv )
  165. ggi? ( X )
  166. libass? ( truetype )
  167. opengl? ( X )
  168. osdmenu? ( X )
  169. truetype? ( iconv )
  170. vdpau? ( X )
  171. vidix? ( X )
  172. xinerama? ( X )
  173. xscreensaver? ( X )
  174. xv? ( X )
  175. xvmc? ( xv )"
  176. RESTRICT="faac? ( bindist )"
  177. pkg_setup() {
  178. if [[ ${PV} == *9999* ]]; then
  179. elog
  180. elog "This is a live ebuild which installs the latest from upstream's"
  181. elog "subversion repository, and is unsupported by Gentoo."
  182. elog "Everything but bugs in the ebuild itself will be ignored."
  183. elog
  184. fi
  185. if use cpudetection; then
  186. ewarn
  187. ewarn "You've enabled the cpudetection flag. This feature is"
  188. ewarn "included mainly for people who want to use the same"
  189. ewarn "binary on another system with a different CPU architecture."
  190. ewarn "MPlayer will already detect your CPU settings by default at"
  191. ewarn "buildtime; this flag is used for runtime detection."
  192. ewarn "You won't need this turned on if you are only building"
  193. ewarn "mplayer for this system. Also, if your compile fails, try"
  194. ewarn "disabling this use flag."
  195. fi
  196. if has_version 'media-video/libav' ; then
  197. ewarn "Please note that upstream uses media-video/ffmpeg."
  198. ewarn "media-video/libav should be fine in theory but if you"
  199. ewarn "experience any problem, try to move to media-video/ffmpeg."
  200. fi
  201. }
  202. src_unpack() {
  203. if [[ ${PV} = *9999* ]]; then
  204. subversion_src_unpack
  205. cd "${WORKDIR}"
  206. rm -rf "${WORKDIR}/${P}/ffmpeg/"
  207. ( S="${WORKDIR}/${P}/ffmpeg/" git-2_src_unpack )
  208. else
  209. unpack ${A}
  210. fi
  211. if [[ ${PV} = *9999* ]] || [[ "${PV%_rc*}" = "${PV}" ]]; then
  212. cd "${S}"
  213. cp "${FILESDIR}/dump_ffmpeg.sh" . || die
  214. chmod +x dump_ffmpeg.sh
  215. ./dump_ffmpeg.sh || die
  216. fi
  217. if ! use truetype; then
  218. unpack font-arial-iso-8859-1.tar.bz2 \
  219. font-arial-iso-8859-2.tar.bz2 \
  220. font-arial-cp1250.tar.bz2
  221. fi
  222. }
  223. src_prepare() {
  224. local svf=snapshot_version
  225. if [[ ${PV} = *9999* ]]; then
  226. # Set SVN version manually
  227. subversion_wc_info
  228. printf "${ESVN_WC_REVISION}" > $svf
  229. fi
  230. if [ ! -f VERSION ] ; then
  231. [ -f "$svf" ] || die "Missing ${svf}. Did you generate your snapshot with prepare_mplayer.sh?"
  232. local sv=$(<$svf)
  233. printf "SVN-r${sv} (Gentoo)" > VERSION
  234. fi
  235. # fix path to bash executable in configure scripts
  236. sed -i -e "1c\#!${EPREFIX}/bin/bash" configure version.sh || die
  237. base_src_prepare
  238. # Use sane default for >=virtual/udev-197
  239. sed -i -e '/default_dvd_device/s:/dev/dvd:/dev/cdrom:' configure || die
  240. if has_version '>=media-video/ffmpeg-2.9'; then
  241. epatch "${FILESDIR}/${PN}-1.2_pre20150730-chan.patch"
  242. epatch "${FILESDIR}/${PN}-1.2-get_buffer.patch"
  243. epatch "${FILESDIR}/${PN}-1.2_pre20150730-encode.patch"
  244. fi
  245. }
  246. src_configure() {
  247. local myconf=""
  248. local uses i
  249. # set LINGUAS
  250. [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
  251. [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/zh/zh_CN}" #482968
  252. # mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
  253. # compilation in almost every situation. The reason for this is
  254. # because if --enable is used, it will force the build of that option,
  255. # regardless of whether the dependency is available or not.
  256. ###################
  257. #Optional features#
  258. ###################
  259. # disable svga since we don't want it
  260. # disable arts since we don't have kde3
  261. # always disable internal ass
  262. # disable opus and ilbc since it only controls support in internal
  263. # ffmpeg which we do not use
  264. myconf+="
  265. --disable-svga --disable-svgalib_helper
  266. --disable-ass-internal
  267. --disable-arts
  268. --disable-kai
  269. --disable-libopus
  270. --disable-libilbc
  271. $(use_enable network networking)
  272. $(use_enable joystick)
  273. "
  274. uses="bl bluray enca ftp rtc vcd" # nemesi <- not working with in-tree ebuild
  275. myconf+=" --disable-nemesi" # nemesi automagic disable
  276. for i in ${uses}; do
  277. use ${i} || myconf+=" --disable-${i}"
  278. done
  279. use bidi || myconf+=" --disable-fribidi"
  280. use ipv6 || myconf+=" --disable-inet6"
  281. use libass || myconf+=" --disable-ass"
  282. use nut || myconf+=" --disable-libnut"
  283. use rar || myconf+=" --disable-unrarexec"
  284. use samba || myconf+=" --disable-smb"
  285. use lirc || myconf+=" --disable-lirc --disable-lircc --disable-apple-ir"
  286. # libcdio support: prefer libcdio over cdparanoia
  287. # don't check for cddb w/cdio
  288. if use cdio; then
  289. myconf+=" --disable-cdparanoia"
  290. else
  291. myconf+=" --disable-libcdio"
  292. use cdparanoia || myconf+=" --disable-cdparanoia"
  293. use cddb || myconf+=" --disable-cddb"
  294. fi
  295. ################################
  296. # DVD read, navigation support #
  297. ################################
  298. #
  299. # dvdread - accessing a DVD
  300. # dvdnav - navigation of menus
  301. use dvd || myconf+=" --disable-dvdread"
  302. use dvdnav || myconf+=" --disable-dvdnav"
  303. #############
  304. # Subtitles #
  305. #############
  306. #
  307. # SRT/ASS/SSA (subtitles) requires freetype support
  308. # freetype support requires iconv
  309. # iconv optionally can use unicode
  310. use truetype || myconf+=" --disable-freetype"
  311. use iconv || myconf+=" --disable-iconv --charset=noconv"
  312. use iconv && use unicode && myconf+=" --charset=UTF-8"
  313. #####################################
  314. # DVB / Video4Linux / Radio support #
  315. #####################################
  316. myconf+=" --disable-tv-bsdbt848"
  317. # broken upstream, won't work with recent kernels
  318. myconf+=" --disable-ivtv"
  319. # gone since linux-headers-2.6.38
  320. myconf+=" --disable-tv-v4l1"
  321. if { use dvb || use v4l || use pvr || use radio; }; then
  322. use dvb || myconf+=" --disable-dvb"
  323. use pvr || myconf+=" --disable-pvr"
  324. use v4l || myconf+=" --disable-tv-v4l2"
  325. if use radio && { use dvb || use v4l; }; then
  326. myconf+="
  327. --enable-radio
  328. $(use_enable encode radio-capture)
  329. "
  330. else
  331. myconf+="
  332. --disable-radio-v4l2
  333. --disable-radio-bsdbt848
  334. "
  335. fi
  336. else
  337. myconf+="
  338. --disable-tv
  339. --disable-tv-v4l2
  340. --disable-radio
  341. --disable-radio-v4l2
  342. --disable-radio-bsdbt848
  343. --disable-dvb
  344. --disable-v4l2
  345. --disable-pvr"
  346. fi
  347. ##########
  348. # Codecs #
  349. ##########
  350. myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support
  351. myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2
  352. use dts || myconf+=" --disable-libdca"
  353. if ! use mp3; then
  354. myconf+="
  355. --disable-mp3lame
  356. --disable-mpg123
  357. "
  358. fi
  359. uses="a52 bs2b dv gsm lzo rtmp vorbis"
  360. for i in ${uses}; do
  361. use ${i} || myconf+=" --disable-lib${i}"
  362. done
  363. uses="faad gif jpeg libmpeg2 live mad mng png pnm speex tga theora tremor"
  364. for i in ${uses}; do
  365. use ${i} || myconf+=" --disable-${i}"
  366. done
  367. use jpeg2k || myconf+=" --disable-libopenjpeg"
  368. # Encoding
  369. uses="faac x264 xvid toolame twolame"
  370. if use encode; then
  371. for i in ${uses}; do
  372. use ${i} || myconf+=" --disable-${i}"
  373. done
  374. else
  375. myconf+=" --disable-mencoder"
  376. for i in ${uses}; do
  377. myconf+=" --disable-${i}"
  378. use ${i} && elog "Useflag \"${i}\" will only be useful for encoding, i.e., with \"encode\" useflag enabled."
  379. done
  380. fi
  381. #################
  382. # Binary codecs #
  383. #################
  384. myconf+=" --disable-qtx --disable-real --disable-win32dll"
  385. ################
  386. # Video Output #
  387. ################
  388. uses="directfb md5sum sdl yuv4mpeg"
  389. for i in ${uses}; do
  390. use ${i} || myconf+=" --disable-${i}"
  391. done
  392. use aalib || myconf+=" --disable-aa"
  393. use fbcon || myconf+=" --disable-fbdev"
  394. use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
  395. use libcaca || myconf+=" --disable-caca"
  396. use zoran || myconf+=" --disable-zr"
  397. if ! use kernel_linux || ! use video_cards_mga; then
  398. myconf+=" --disable-mga --disable-xmga"
  399. fi
  400. if use video_cards_tdfx; then
  401. myconf+="
  402. $(use_enable video_cards_tdfx tdfxvid)
  403. $(use_enable fbcon tdfxfb)
  404. "
  405. else
  406. myconf+="
  407. --disable-3dfx
  408. --disable-tdfxvid
  409. --disable-tdfxfb
  410. "
  411. fi
  412. # sun card, disable by default, see bug #258729
  413. myconf+=" --disable-xvr100"
  414. ################
  415. # Audio Output #
  416. ################
  417. myconf+=" --disable-esd"
  418. uses="alsa jack ladspa nas openal"
  419. for i in ${uses}; do
  420. use ${i} || myconf+=" --disable-${i}"
  421. done
  422. use pulseaudio || myconf+=" --disable-pulse"
  423. if ! use radio; then
  424. use oss || myconf+=" --disable-ossaudio"
  425. fi
  426. ####################
  427. # Advanced Options #
  428. ####################
  429. # Platform specific flags, hardcoded on amd64 (see below)
  430. use cpudetection && myconf+=" --enable-runtime-cpudetection"
  431. uses="3dnow 3dnowext mmx mmxext sse sse2 ssse3"
  432. for i in ${uses}; do
  433. myconf+=" $(use_enable cpu_flags_x86_${i} ${i})"
  434. done
  435. uses="altivec shm"
  436. for i in ${uses}; do
  437. myconf+=" $(use_enable ${i})"
  438. done
  439. use debug && myconf+=" --enable-debug=3"
  440. if use x86 && gcc-specs-pie; then
  441. filter-flags -fPIC -fPIE
  442. append-ldflags -nopie
  443. fi
  444. ###########################
  445. # X enabled configuration #
  446. ###########################
  447. myconf+=" --disable-gui"
  448. myconf+=" --disable-vesa"
  449. uses="ggi vdpau xinerama xv"
  450. for i in ${uses}; do
  451. use ${i} || myconf+=" --disable-${i}"
  452. done
  453. use dga || myconf+=" --disable-dga1 --disable-dga2"
  454. use opengl || myconf+=" --disable-gl"
  455. use osdmenu && myconf+=" --enable-menu"
  456. use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb"
  457. use xscreensaver || myconf+=" --disable-xss"
  458. use X || myconf+=" --disable-x11"
  459. if use xvmc; then
  460. myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
  461. else
  462. myconf+=" --disable-xvmc"
  463. fi
  464. ############################
  465. # OSX (aqua) configuration #
  466. ############################
  467. if use aqua; then
  468. myconf+="
  469. --enable-macosx-finder
  470. --enable-macosx-bundle
  471. "
  472. fi
  473. ./configure \
  474. --cc="$(tc-getCC)" \
  475. --host-cc="$(tc-getBUILD_CC)" \
  476. --prefix="${EPREFIX}/usr" \
  477. --bindir="${EPREFIX}/usr/bin" \
  478. --libdir="${EPREFIX}/usr/$(get_libdir)" \
  479. --confdir="${EPREFIX}/etc/mplayer" \
  480. --datadir="${EPREFIX}/usr/share/mplayer${namesuf}" \
  481. --mandir="${EPREFIX}/usr/share/man" \
  482. --disable-ffmpeg_a \
  483. ${myconf} || die
  484. }
  485. src_compile() {
  486. base_src_compile
  487. # Build only user-requested docs if they're available.
  488. if use doc ; then
  489. # select available languages from $LINGUAS
  490. local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
  491. local BUILT_DOCS=""
  492. for i in ${LINGUAS} ; do
  493. has ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
  494. done
  495. if [[ -z $BUILT_DOCS ]]; then
  496. emake -j1 html-chunked
  497. else
  498. for i in ${BUILT_DOCS}; do
  499. emake -j1 html-chunked-${i}
  500. done
  501. fi
  502. fi
  503. }
  504. src_install() {
  505. local i
  506. emake \
  507. DESTDIR="${D}" \
  508. INSTALLSTRIP="" \
  509. install
  510. dodoc AUTHORS Changelog Copyright README etc/codecs.conf
  511. docinto tech/
  512. dodoc DOCS/tech/{*.txt,MAINTAINERS,mpsub.sub,playtree,TODO,wishlist}
  513. docinto TOOLS/
  514. dodoc -r TOOLS
  515. docinto tech/mirrors/
  516. dodoc DOCS/tech/mirrors/*
  517. if use doc; then
  518. docinto html/
  519. dohtml -r "${S}"/DOCS/HTML/*
  520. fi
  521. if ! use truetype; then
  522. dodir /usr/share/mplayer/fonts
  523. # Do this generic, as the mplayer people like to change the structure
  524. # of their zips ...
  525. for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
  526. cp -pPR "${i}" "${ED}/usr/share/mplayer/fonts"
  527. done
  528. # Fix the font symlink ...
  529. rm -rf "${ED}/usr/share/mplayer/font"
  530. dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
  531. fi
  532. insinto /etc/mplayer
  533. newins "${S}/etc/example.conf" mplayer.conf
  534. cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
  535. # Config options can be section specific, global
  536. # options should go in the default section
  537. [default]
  538. _EOF_
  539. doins "${S}/etc/input.conf"
  540. if use osdmenu; then
  541. doins "${S}/etc/menu.conf"
  542. fi
  543. if use truetype; then
  544. cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
  545. fontconfig=1
  546. subfont-osd-scale=4
  547. subfont-text-scale=3
  548. _EOF_
  549. fi
  550. # bug 256203
  551. if use rar; then
  552. cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
  553. unrarexec=${EPREFIX}/usr/bin/unrar
  554. _EOF_
  555. fi
  556. dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
  557. newbin "${S}/TOOLS/midentify.sh" midentify
  558. }
  559. pkg_preinst() {
  560. [[ -d ${EROOT}/usr/share/mplayer/Skin/default ]] && \
  561. rm -rf "${EROOT}/usr/share/mplayer/Skin/default"
  562. }
  563. pkg_postrm() {
  564. # Cleanup stale symlinks
  565. [ -L "${EROOT}/usr/share/mplayer/font" -a \
  566. ! -e "${EROOT}/usr/share/mplayer/font" ] && \
  567. rm -f "${EROOT}/usr/share/mplayer/font"
  568. [ -L "${EROOT}/usr/share/mplayer/subfont.ttf" -a \
  569. ! -e "${EROOT}/usr/share/mplayer/subfont.ttf" ] && \
  570. rm -f "${EROOT}/usr/share/mplayer/subfont.ttf"
  571. }