handbrake-9999.ebuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit autotools eutils gnome2-utils python-any-r1
  6. if [[ ${PV} = *9999* ]]; then
  7. EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
  8. inherit git-r3
  9. KEYWORDS=""
  10. else
  11. MY_P="HandBrake-${PV}"
  12. SRC_URI="http://handbrake.fr/rotation.php?file=${MY_P}.tar.bz2 -> ${P}.tar.bz2"
  13. S="${WORKDIR}/${MY_P}"
  14. KEYWORDS="~amd64 ~x86"
  15. fi
  16. DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
  17. HOMEPAGE="http://handbrake.fr/"
  18. LICENSE="GPL-2"
  19. SLOT="0"
  20. IUSE="+fdk gstreamer gtk libav libav-aac x265"
  21. REQUIRED_USE="^^ ( fdk libav-aac )"
  22. RDEPEND="
  23. dev-libs/jansson
  24. media-libs/a52dec
  25. media-libs/libass:=
  26. >=media-libs/libbluray-1.0
  27. media-libs/libdvdnav
  28. media-libs/libdvdread
  29. media-libs/libsamplerate
  30. media-libs/libtheora
  31. media-libs/libvorbis
  32. media-libs/libvpx
  33. media-libs/opus
  34. media-libs/x264:=
  35. media-sound/lame
  36. sys-libs/zlib
  37. libav? ( >=media-video/libav-10.1:0=[fdk?] )
  38. !libav? ( >=media-video/ffmpeg-2.3:0=[fdk?] )
  39. gstreamer? (
  40. media-libs/gstreamer:1.0
  41. media-libs/gst-plugins-base:1.0
  42. media-libs/gst-plugins-good:1.0
  43. media-libs/gst-plugins-bad:1.0
  44. media-libs/gst-plugins-ugly:1.0
  45. media-plugins/gst-plugins-a52dec:1.0
  46. media-plugins/gst-plugins-libav:1.0
  47. media-plugins/gst-plugins-x264:1.0
  48. )
  49. gtk? (
  50. >=x11-libs/gtk+-3.10
  51. dev-libs/dbus-glib
  52. dev-libs/glib:2
  53. x11-libs/cairo
  54. x11-libs/gdk-pixbuf:2
  55. x11-libs/libnotify
  56. x11-libs/pango
  57. virtual/libgudev:=
  58. )
  59. fdk? ( media-libs/fdk-aac )
  60. x265? ( >=media-libs/x265-1.7:0= )
  61. "
  62. DEPEND="${RDEPEND}
  63. ${PYTHON_DEPS}
  64. dev-lang/yasm
  65. dev-util/intltool
  66. sys-devel/automake"
  67. PATCHES=(
  68. # Remove libdvdnav duplication and call it on the original instead.
  69. # It may work this way; if not, we should try to mimic the duplication.
  70. "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
  71. # Remove faac dependency; TODO: figure out if we need to do this at all.
  72. "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
  73. # Fix missing x265 link flag
  74. "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
  75. )
  76. pkg_setup() {
  77. python-any-r1_pkg_setup
  78. }
  79. src_prepare() {
  80. # Get rid of leftover bundled library build definitions,
  81. sed -i 's:.*\(/contrib\|contrib/\).*::g' \
  82. "${S}"/make/include/main.defs \
  83. || die "Contrib removal failed."
  84. default
  85. # Get rid of libav specific code when using ffmpeg
  86. use libav || eapply -R "${FILESDIR}/${PN}-0.10.3-nolibav.patch"
  87. cd "${S}/gtk"
  88. # Don't run autogen.sh.
  89. sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
  90. eautoreconf
  91. }
  92. src_configure() {
  93. ./configure \
  94. --force \
  95. --verbose \
  96. --prefix="${EPREFIX}/usr" \
  97. --disable-gtk-update-checks \
  98. $(use_enable libav-aac) \
  99. $(use_enable fdk fdk-aac) \
  100. $(use_enable gtk) \
  101. $(usex !gstreamer --disable-gst) \
  102. $(use_enable x265) || die "Configure failed."
  103. }
  104. src_compile() {
  105. emake -C build
  106. # TODO: Documentation building is currently broken, try to fix it.
  107. #
  108. # if use doc ; then
  109. # emake -C build doc
  110. # fi
  111. }
  112. src_install() {
  113. emake -C build DESTDIR="${D}" install
  114. dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
  115. }
  116. pkg_postinst() {
  117. einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
  118. if use gtk ; then
  119. einfo ""
  120. einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
  121. fi
  122. gnome2_icon_cache_update
  123. }
  124. pkg_preinst() {
  125. gnome2_icon_savelist
  126. }
  127. pkg_postrm() {
  128. gnome2_icon_cache_update
  129. }