smplayer-16.11.0.ebuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PLOCALES="am ar ar_SY bg ca cs da de el_GR en_GB en_US es et eu fa fi fr gl
  5. he_IL hr hu id it ja ka ko ku lt mk ms_MY nl nn_NO pl pt pt_BR ro_RO ru_RU
  6. sk sl_SI sq_AL sr sv th tr uk_UA uz vi_VN zh_CN zh_TW"
  7. PLOCALE_BACKUP="en_US"
  8. inherit l10n qmake-utils
  9. DESCRIPTION="Great Qt GUI front-end for mplayer/mpv"
  10. HOMEPAGE="http://www.smplayer.eu/"
  11. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
  12. LICENSE="GPL-2+ BSD-2"
  13. SLOT="0"
  14. KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux"
  15. IUSE="autoshutdown bidi debug mpris qt5 streaming"
  16. COMMON_DEPEND="
  17. sys-libs/zlib
  18. !qt5? (
  19. dev-qt/qtcore:4
  20. dev-qt/qtgui:4
  21. dev-qt/qtsingleapplication[X,qt4]
  22. autoshutdown? ( dev-qt/qtdbus:4 )
  23. mpris? ( dev-qt/qtdbus:4 )
  24. streaming? (
  25. dev-qt/qtcore:4[ssl]
  26. dev-qt/qtscript:4
  27. )
  28. )
  29. qt5? (
  30. dev-qt/qtcore:5
  31. dev-qt/qtgui:5
  32. dev-qt/qtnetwork:5
  33. dev-qt/qtsingleapplication[X,qt5]
  34. dev-qt/qtwidgets:5
  35. dev-qt/qtxml:5
  36. autoshutdown? ( dev-qt/qtdbus:5 )
  37. mpris? ( dev-qt/qtdbus:5 )
  38. streaming? (
  39. dev-qt/qtnetwork:5[ssl]
  40. dev-qt/qtscript:5
  41. )
  42. )
  43. "
  44. DEPEND="${COMMON_DEPEND}
  45. qt5? ( dev-qt/linguist-tools:5 )
  46. "
  47. RDEPEND="${COMMON_DEPEND}
  48. || (
  49. media-video/mplayer[bidi?,libass,png,X]
  50. (
  51. >=media-video/mpv-0.10.0[libass,X]
  52. streaming? ( >=net-misc/youtube-dl-2014.11.26 )
  53. )
  54. )
  55. "
  56. PATCHES=(
  57. "${FILESDIR}/${PN}-14.9.0.6966-unbundle-qtsingleapplication.patch" # bug 487544
  58. )
  59. src_prepare() {
  60. use bidi || PATCHES+=( "${FILESDIR}"/${PN}-16.4.0-zero-bidi.patch )
  61. default
  62. # Upstream Makefile sucks
  63. sed -i -e "/^PREFIX=/ s:/usr/local:${EPREFIX}/usr:" \
  64. -e "/^DOC_PATH=/ s:packages/smplayer:${PF}:" \
  65. -e '/\.\/get_svn_revision\.sh/,+2c\
  66. cd src && $(DEFS) $(MAKE)' \
  67. Makefile || die
  68. # Turn off online update checker, bug #479902
  69. sed -e 's:DEFINES += UPDATE_CHECKER:#&:' \
  70. -e 's:DEFINES += CHECK_UPGRADED:#&:' \
  71. -i src/smplayer.pro || die
  72. # Turn off intrusive share widget
  73. sed -e 's:DEFINES += SHARE_WIDGET:#&:' \
  74. -i src/smplayer.pro || die
  75. # Toggle autoshutdown option which pulls in dbus, bug #524392
  76. if ! use autoshutdown ; then
  77. sed -e 's:DEFINES += AUTO_SHUTDOWN_PC:#&:' \
  78. -i src/smplayer.pro || die
  79. fi
  80. # Turn debug message flooding off
  81. if ! use debug ; then
  82. sed -e 's:#\(DEFINES += NO_DEBUG_ON_CONSOLE\):\1:' \
  83. -i src/smplayer.pro || die
  84. fi
  85. # MPRIS2 pulls in dbus, bug #553710
  86. if ! use mpris ; then
  87. sed -e 's:DEFINES += MPRIS2:#&:' \
  88. -i src/smplayer.pro || die
  89. fi
  90. # Turn off youtube support (which pulls in extra dependencies) if unwanted
  91. if ! use streaming ; then
  92. sed -e 's:DEFINES += YOUTUBE_SUPPORT:#&:' \
  93. -i src/smplayer.pro || die
  94. sed -e 's:^#define PLAYLIST_DOWNLOAD://&:' \
  95. -i src/playlist.h || die
  96. fi
  97. # Commented out because it gives false positives
  98. #l10n_find_plocales_changes "${S}"/src/translations ${PN}_ .ts
  99. }
  100. src_configure() {
  101. cd src || die
  102. use qt5 && eqmake5 || eqmake4
  103. }
  104. gen_translation() {
  105. local mydir="$(qt4_get_bindir)"
  106. if use qt5; then
  107. mydir="$(qt5_get_bindir)"
  108. fi
  109. ebegin "Generating $1 translation"
  110. "${mydir}"/lrelease ${PN}_${1}.ts
  111. eend $? || die "failed to generate $1 translation"
  112. }
  113. src_compile() {
  114. default
  115. cd src/translations || die
  116. l10n_for_each_locale_do gen_translation
  117. }
  118. src_install() {
  119. # remove unneeded copies of the GPL
  120. rm -f Copying* docs/*/gpl.html || die
  121. # don't install empty dirs
  122. rmdir --ignore-fail-on-non-empty docs/* || die
  123. default
  124. }