libquicktime-1.2.4-r1.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit libtool eutils multilib-minimal
  5. DESCRIPTION="An enhanced version of the quicktime4linux library"
  6. HOMEPAGE="http://libquicktime.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd"
  11. IUSE="aac alsa doc dv encode ffmpeg gtk jpeg lame libav cpu_flags_x86_mmx opengl png schroedinger static-libs vorbis X x264"
  12. RDEPEND=">=virtual/libintl-0-r1[${MULTILIB_USEDEP}]
  13. sys-libs/zlib:=
  14. aac? (
  15. >=media-libs/faad2-2.7-r3[${MULTILIB_USEDEP}]
  16. encode? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] )
  17. )
  18. alsa? ( >=media-libs/alsa-lib-1.0.20 )
  19. dv? ( >=media-libs/libdv-1.0.0-r3[${MULTILIB_USEDEP}] )
  20. ffmpeg? (
  21. libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
  22. !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
  23. )
  24. gtk? ( x11-libs/gtk+:2 )
  25. jpeg? ( >=virtual/jpeg-0-r2:0[${MULTILIB_USEDEP}] )
  26. lame? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
  27. opengl? ( virtual/opengl )
  28. png? ( >=media-libs/libpng-1.6.10:0[${MULTILIB_USEDEP}] )
  29. schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
  30. vorbis? (
  31. >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
  32. >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
  33. )
  34. X? (
  35. x11-libs/libX11
  36. x11-libs/libXaw
  37. x11-libs/libXext
  38. x11-libs/libXt
  39. x11-libs/libXv
  40. )
  41. x264? ( >=media-libs/x264-0.0.20130506[${MULTILIB_USEDEP}] )"
  42. DEPEND="${RDEPEND}
  43. >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
  44. sys-devel/gettext
  45. doc? ( app-doc/doxygen )
  46. X? ( >=x11-proto/videoproto-2.3.1-r1[${MULTILIB_USEDEP}] )"
  47. REQUIRED_USE="opengl? ( X )"
  48. DOCS="ChangeLog README TODO"
  49. src_prepare() {
  50. epatch "${FILESDIR}"/${P}+libav-9.patch \
  51. "${FILESDIR}"/${P}-ffmpeg2.patch
  52. if has_version '>=media-video/ffmpeg-2.9' ||
  53. has_version '>=media-video/libav-12'; then
  54. epatch "${FILESDIR}"/${P}-ffmpeg29.patch
  55. fi
  56. for FILE in lqt_ffmpeg.c video.c audio.c ; do
  57. sed -i -e "s:CODEC_ID_:AV_&:g" "${S}/plugins/ffmpeg/${FILE}" || die
  58. done
  59. elibtoolize # Required for .so versioning on g/fbsd
  60. }
  61. multilib_src_configure() {
  62. # utils use: alsa, opengl, gtk+, X
  63. ECONF_SOURCE=${S} \
  64. econf \
  65. --enable-gpl \
  66. $(use_enable static-libs static) \
  67. $(use_enable cpu_flags_x86_mmx asm) \
  68. $(multilib_native_use_with doc doxygen) \
  69. $(use vorbis || echo --without-vorbis) \
  70. $(use_with lame) \
  71. $(multilib_native_use_with X x) \
  72. $(multilib_native_use_with opengl) \
  73. $(multilib_native_use_with alsa) \
  74. $(multilib_native_use_with gtk) \
  75. $(use_with dv libdv) \
  76. $(use_with jpeg libjpeg) \
  77. $(use_with ffmpeg) \
  78. $(use_with png libpng) \
  79. $(use_with schroedinger) \
  80. $(use_with aac faac) \
  81. $(use encode || echo --without-faac) \
  82. $(use_with aac faad2) \
  83. $(use_with x264) \
  84. --without-cpuflags
  85. if ! multilib_is_native_abi; then
  86. # disable building utilities
  87. sed -i -e '/SUBDIRS =/s:utils::' Makefile || die
  88. fi
  89. }
  90. multilib_src_install_all() {
  91. einstalldocs
  92. prune_libtool_files --all
  93. # Compatibility with software that uses quicktime prefix, but
  94. # don't do that when building for Darwin/MacOS
  95. [[ ${CHOST} != *-darwin* ]] && dosym /usr/include/lqt /usr/include/quicktime
  96. }
  97. pkg_preinst() {
  98. if [[ -d /usr/include/quicktime && ! -L /usr/include/quicktime ]]; then
  99. elog "For compatibility with other quicktime libraries, ${PN} was"
  100. elog "going to create a /usr/include/quicktime symlink, but for some"
  101. elog "reason that is a directory on your system."
  102. elog "Please check that is empty, and remove it, or submit a bug"
  103. elog "telling us which package owns the directory."
  104. die "/usr/include/quicktime is a directory."
  105. fi
  106. }