dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / media-libs / libopenshot / libopenshot-0.2.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python3_6 )
6
7 inherit cmake-utils python-single-r1 toolchain-funcs versionator
8
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"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE="+imagemagick +python test"
17 # https://github.com/OpenShot/libopenshot/issues/43
18 RESTRICT="test"
19
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21
22 RDEPEND="
23         net-libs/cppzmq
24         dev-qt/qtcore:5
25         dev-qt/qtgui:5
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} )
31 "
32 DEPEND="
33         ${RDEPEND}
34         python? ( dev-lang/swig )
35         test? ( dev-libs/unittest++ )
36 "
37
38 # From Mageia
39 # https://github.com/OpenShot/libopenshot/issues/60
40 PATCHES=( ${FILESDIR}/${PN}-0.2.2-imagemagick7.patch )
41
42 check_compiler() {
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"
48         fi
49 }
50
51 pkg_pretend() {
52         check_compiler
53 }
54
55 pkg_setup() {
56         check_compiler
57         use python && python-single-r1_pkg_setup
58 }
59
60 src_prepare() {
61         cmake-utils_src_prepare
62         # https://github.com/OpenShot/libopenshot/issues/17
63         use test || cmake_comment_add_subdirectory tests
64 }
65
66 src_configure() {
67         local mycmakeargs=(
68                 -DENABLE_RUBY=OFF # TODO: add ruby support
69                 -DENABLE_PYTHON=$(usex python)
70                 $(cmake-utils_use_find_package imagemagick ImageMagick)
71         )
72         use python && mycmakeargs+=(
73                 -DPYTHON_EXECUTABLE="${PYTHON}"
74                 -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
75                 -DPYTHON_LIBRARY="$(python_get_library_path)"
76         )
77         cmake-utils_src_configure
78 }
79
80 src_test() {
81         cmake-utils_src_make test
82 }
83
84 src_install() {
85         cmake-utils_src_install
86         python_optimize
87 }