libopenshot-0.1.3.ebuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python3_{4,5} )
  5. inherit cmake-utils python-single-r1 toolchain-funcs versionator
  6. DESCRIPTION="Video editing library used by OpenShot"
  7. HOMEPAGE="http://www.openshotvideo.com/"
  8. SRC_URI="https://github.com/OpenShot/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="+imagemagick libav +python test"
  13. # https://github.com/OpenShot/libopenshot/issues/43
  14. RESTRICT="test"
  15. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  16. RDEPEND="
  17. net-libs/cppzmq
  18. dev-qt/qtcore:5
  19. dev-qt/qtgui:5
  20. dev-qt/qtmultimedia:5[widgets]
  21. media-libs/libopenshot-audio
  22. imagemagick? ( media-gfx/imagemagick:0=[cxx] )
  23. libav? ( media-video/libav:=[encode,x264,xvid,vpx,mp3,theora] )
  24. !libav? ( media-video/ffmpeg:0=[encode,x264,xvid,vpx,mp3,theora] )
  25. python? ( ${PYTHON_DEPS} )
  26. "
  27. DEPEND="
  28. ${RDEPEND}
  29. python? ( dev-lang/swig )
  30. test? ( dev-libs/unittest++ )
  31. "
  32. # https://github.com/OpenShot/libopenshot/pull/45
  33. PATCHES=( ${FILESDIR}/${P}-fix-tests.patch )
  34. pkg_pretend() {
  35. if [[ ${MERGE_TYPE} != binary ]] && ! tc-has-openmp; then
  36. eerror "${P} requires a compiler with OpenMP support. Your current"
  37. eerror "compiler does not support it. If you use gcc, you can"
  38. eerror "re-emerge it with the 'openmp' use flag enabled."
  39. die "The current compiler does not support OpenMP"
  40. fi
  41. }
  42. pkg_setup() {
  43. use python && python-single-r1_pkg_setup
  44. }
  45. src_prepare() {
  46. # https://github.com/OpenShot/libopenshot/issues/17
  47. use test || cmake_comment_add_subdirectory tests
  48. cmake-utils_src_prepare
  49. }
  50. src_configure() {
  51. local mycmakeargs=(
  52. -DENABLE_RUBY=OFF # TODO: add ruby support
  53. -DENABLE_PYTHON=$(usex python)
  54. -DCMAKE_DISABLE_FIND_PACKAGE_ImageMagick=$(usex !imagemagick)
  55. )
  56. use python && mycmakeargs+=(
  57. -DPYTHON_EXECUTABLE="${PYTHON}"
  58. -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
  59. -DPYTHON_LIBRARY="$(python_get_library_path)"
  60. )
  61. cmake-utils_src_configure
  62. }
  63. src_test() {
  64. cd "${BUILD_DIR}" || die
  65. emake test
  66. }
  67. src_install() {
  68. cmake-utils_src_install
  69. python_optimize
  70. }