mkvtoolnix-9.6.0.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils multilib toolchain-funcs versionator multiprocessing autotools
  5. DESCRIPTION="Tools to create, alter, and inspect Matroska files"
  6. HOMEPAGE="http://www.bunkus.org/videotools/mkvtoolnix"
  7. SRC_URI="http://www.bunkus.org/videotools/mkvtoolnix/sources/${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc ~ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux"
  11. IUSE="curl debug pch test qt5"
  12. ruby_atom() {
  13. local ruby_slot=${1/ruby/}
  14. ruby_slot="${ruby_slot:0:1}.${ruby_slot:1:2}"
  15. echo "dev-lang/ruby:${ruby_slot}"
  16. }
  17. # hacks to avoid using the ruby eclasses since this requires something similar
  18. # to the python-any-r1 eclass for ruby which currently doesn't exist
  19. RUBY_IMPLS=( ruby24 ruby23 ruby22 ruby21 )
  20. RUBY_BDEPS="$(for ruby_impl in "${RUBY_IMPLS[@]}"; do
  21. echo "( $(ruby_atom ${ruby_impl}) virtual/rubygems[ruby_targets_${ruby_impl}] )"; done)"
  22. RDEPEND="
  23. >=dev-libs/boost-1.46.0:=
  24. >=dev-libs/libebml-1.3.3:=
  25. dev-libs/pugixml
  26. media-libs/flac
  27. >=media-libs/libmatroska-1.4.4:=
  28. media-libs/libogg
  29. media-libs/libvorbis
  30. sys-apps/file
  31. sys-libs/zlib
  32. qt5? (
  33. dev-qt/qtcore:5
  34. dev-qt/qtgui:5
  35. dev-qt/qtnetwork:5
  36. dev-qt/qtwidgets:5
  37. )
  38. "
  39. DEPEND="${RDEPEND}
  40. || ( ${RUBY_BDEPS} )
  41. sys-devel/gettext
  42. virtual/pkgconfig
  43. test? ( dev-cpp/gtest )
  44. "
  45. pkg_pretend() {
  46. # https://bugs.gentoo.org/419257
  47. local ver=4.6
  48. local msg="You need at least GCC ${ver}.x for C++11 range-based 'for' and nullptr support."
  49. if ! version_is_at_least ${ver} $(gcc-version); then
  50. eerror ${msg}
  51. die ${msg}
  52. fi
  53. }
  54. src_prepare() {
  55. local ruby_impl
  56. for ruby_impl in "${RUBY_IMPLS[@]}"; do
  57. if has_version "$(ruby_atom ${ruby_impl})"; then
  58. export RUBY=${ruby_impl}
  59. break
  60. fi
  61. done
  62. [[ -z ${RUBY} ]] && die "No available ruby implementations to build with"
  63. default
  64. eautoreconf
  65. }
  66. src_configure() {
  67. local myconf
  68. if use qt5 ; then
  69. # ac/qt5.m4 finds default Qt version set by qtchooser, bug #532600
  70. myconf+=(
  71. --with-moc=/usr/$(get_libdir)/qt5/bin/moc
  72. --with-uic=/usr/$(get_libdir)/qt5/bin/uic
  73. --with-rcc=/usr/$(get_libdir)/qt5/bin/rcc
  74. )
  75. fi
  76. econf \
  77. $(use_enable debug) \
  78. $(use_enable qt5 qt) \
  79. $(use_with curl) \
  80. $(usex pch "" --disable-precompiled-headers) \
  81. "${myconf[@]}" \
  82. --disable-optimization \
  83. --docdir="${EPREFIX}"/usr/share/doc/${PF} \
  84. --with-boost="${EPREFIX}"/usr \
  85. --with-boost-libdir="${EPREFIX}"/usr/$(get_libdir)
  86. }
  87. src_compile() {
  88. "${RUBY}" ./drake V=1 -j$(makeopts_jobs) || die
  89. }
  90. src_test() {
  91. "${RUBY}" ./drake V=1 -j$(makeopts_jobs) tests:unit || die
  92. "${RUBY}" ./drake V=1 -j$(makeopts_jobs) tests:run_unit || die
  93. }
  94. src_install() {
  95. DESTDIR="${D}" "${RUBY}" ./drake -j$(makeopts_jobs) install || die
  96. dodoc AUTHORS ChangeLog README.md
  97. doman doc/man/*.1
  98. }