Advertisement
Guest User

Untitled

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