avidemux-core-2.6.8.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit cmake-utils eutils flag-o-matic
  5. SLOT="2.6"
  6. DESCRIPTION="Core libraries for a video editor designed for simple cutting, filtering and encoding tasks"
  7. HOMEPAGE="http://fixounet.free.fr/avidemux"
  8. # Multiple licenses because of all the bundled stuff.
  9. LICENSE="GPL-1 GPL-2 MIT PSF-2 public-domain"
  10. IUSE="debug nls sdl system-ffmpeg vaapi vdpau video_cards_fglrx xv"
  11. KEYWORDS="~amd64 ~x86"
  12. MY_PN="${PN/-core/}"
  13. if [[ ${PV} == *9999* ]] ; then
  14. KEYWORDS=""
  15. EGIT_REPO_URI="git://gitorious.org/${MY_PN}2-6/${MY_PN}2-6.git https://git.gitorious.org/${MY_PN}2-6/${MY_PN}2-6.git"
  16. inherit git-2
  17. else
  18. MY_P="${MY_PN}_${PV}"
  19. SRC_URI="mirror://sourceforge/${MY_PN}/${MY_PN}/${PV}/${MY_P}.tar.gz"
  20. fi
  21. # Trying to use virtual; ffmpeg misses aac,cpudetection USE flags now though, are they needed?
  22. DEPEND="
  23. !<media-video/avidemux-${PV}:${SLOT}
  24. dev-db/sqlite:3
  25. sdl? ( media-libs/libsdl:0 )
  26. system-ffmpeg? ( >=virtual/ffmpeg-9:0[mp3,theora] )
  27. xv? ( x11-libs/libXv:0 )
  28. vaapi? ( x11-libs/libva:0 )
  29. vdpau? ( x11-libs/libvdpau:0 )
  30. video_cards_fglrx? (
  31. || ( >=x11-drivers/ati-drivers-14.12-r3
  32. x11-libs/xvba-video:0 )
  33. )"
  34. RDEPEND="
  35. $DEPEND
  36. nls? ( virtual/libintl:0 )
  37. "
  38. DEPEND="
  39. $DEPEND
  40. virtual/pkgconfig
  41. nls? ( sys-devel/gettext )
  42. !system-ffmpeg? ( dev-lang/yasm[nls=] )
  43. "
  44. S="${WORKDIR}/${MY_P}"
  45. BUILD_DIR="${S}/buildCore"
  46. DOCS=( AUTHORS README )
  47. src_prepare() {
  48. mkdir "${BUILD_DIR}" || die "Can't create build folder."
  49. cmake-utils_src_prepare
  50. if use system-ffmpeg ; then
  51. # Preparations to support the system ffmpeg. Currently fails because it depends on files the system ffmpeg doesn't install.
  52. local error="Failed to remove ffmpeg."
  53. rm -rf cmake/admFFmpeg* cmake/ffmpeg* avidemux_core/ffmpeg_package buildCore/ffmpeg || die "${error}"
  54. sed -i -e 's/include(admFFmpegUtil)//g' avidemux/commonCmakeApplication.cmake || die "${error}"
  55. sed -i -e '/registerFFmpeg/d' avidemux/commonCmakeApplication.cmake || die "${error}"
  56. sed -i -e 's/include(admFFmpegBuild)//g' avidemux_core/CMakeLists.txt || die "${error}"
  57. else
  58. # Avoid existing avidemux installations from making the build process fail, bug #461496.
  59. sed -i -e "s:getFfmpegLibNames(\"\${sourceDir}\"):getFfmpegLibNames(\"${S}/buildCore/ffmpeg/source/\"):g" cmake/admFFmpegUtil.cmake \
  60. || die "Failed to avoid existing avidemux installation from making the build fail."
  61. fi
  62. # Add lax vector typing for PowerPC.
  63. if use ppc || use ppc64 ; then
  64. append-cflags -flax-vector-conversions
  65. fi
  66. # See bug 432322.
  67. use x86 && replace-flags -O0 -O1
  68. }
  69. src_configure() {
  70. local mycmakeargs="
  71. -DAVIDEMUX_SOURCE_DIR='${S}'
  72. $(cmake-utils_use nls GETTEXT)
  73. $(cmake-utils_use sdl SDL)
  74. $(cmake-utils_use vaapi LIBVA)
  75. $(cmake-utils_use vdpau VDPAU)
  76. $(cmake-utils_use video_cards_fglrx XVBA)
  77. $(cmake-utils_use xv XVIDEO)
  78. "
  79. if use debug ; then
  80. mycmakeargs+=" -DVERBOSE=1 -DCMAKE_BUILD_TYPE=Debug -DADM_DEBUG=1"
  81. fi
  82. CMAKE_USE_DIR="${S}"/avidemux_core cmake-utils_src_configure
  83. }
  84. src_compile() {
  85. cmake-utils_src_compile -j1
  86. }
  87. src_install() {
  88. cmake-utils_src_install -j1
  89. }