1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_6 )
7 inherit cmake-utils python-single-r1 toolchain-funcs versionator
9 DESCRIPTION="Video editing library used by OpenShot"
10 HOMEPAGE="http://www.openshotvideo.com/"
11 SRC_URI="https://github.com/OpenShot/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 IUSE="+imagemagick +python test"
17 # https://github.com/OpenShot/libopenshot/issues/43
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26 dev-qt/qtmultimedia:5[widgets]
27 >=media-libs/libopenshot-audio-0.1.4
28 imagemagick? ( >=media-gfx/imagemagick-7:0=[cxx] )
29 media-video/ffmpeg:0=[encode,x264,xvid,vpx,mp3,theora]
30 python? ( ${PYTHON_DEPS} )
34 python? ( dev-lang/swig )
35 test? ( dev-libs/unittest++ )
39 # https://github.com/OpenShot/libopenshot/issues/60
40 PATCHES=( ${FILESDIR}/${PN}-0.2.2-imagemagick7.patch )
43 if [[ ${MERGE_TYPE} != binary ]] && ! tc-has-openmp; then
44 eerror "${P} requires a compiler with OpenMP support. Your current"
45 eerror "compiler does not support it. If you use gcc, you can"
46 eerror "re-emerge it with the 'openmp' use flag enabled."
47 die "The current compiler does not support OpenMP"
57 use python && python-single-r1_pkg_setup
61 cmake-utils_src_prepare
62 # https://github.com/OpenShot/libopenshot/issues/17
63 use test || cmake_comment_add_subdirectory tests
68 -DENABLE_RUBY=OFF # TODO: add ruby support
69 -DENABLE_PYTHON=$(usex python)
70 $(cmake-utils_use_find_package imagemagick ImageMagick)
72 use python && mycmakeargs+=(
73 -DPYTHON_EXECUTABLE="${PYTHON}"
74 -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
75 -DPYTHON_LIBRARY="$(python_get_library_path)"
77 cmake-utils_src_configure
81 cmake-utils_src_make test
85 cmake-utils_src_install