da327aea18b5d053d440eeba58dcbbd59407dbbc
[gentoo.git] / media-video / cinelerra / cinelerra-2.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit autotools eutils ltprune multilib flag-o-matic
6
7 DESCRIPTION="The most advanced non-linear video editor and compositor"
8 HOMEPAGE="http://www.cinelerra.org/"
9 SRC_URI="https://cinelerra-cv.org/releases/CinelerraCV-${PV}.tar.xz
10         https://dev.gentoo.org/~mgorny/dist/${P}-patchset.tar.xz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ~ppc x86"
15 IUSE="cpu_flags_x86_3dnow alsa altivec css debug ieee1394 cpu_flags_x86_mmx opengl oss"
16
17 RDEPEND="media-libs/a52dec:=
18         media-libs/faac:=
19         media-libs/faad2:=
20         >=media-libs/freetype-2
21         media-libs/fontconfig
22         media-libs/libdv:=
23         >=media-libs/libogg-1.2:=
24         media-libs/libpng:0=
25         media-libs/libsndfile:=
26         >=media-libs/libtheora-1.1:=
27         >=media-libs/libvorbis-1.3:=
28         >=media-libs/openexr-1.5:=
29         media-libs/tiff:0=
30         media-libs/x264:=
31         media-sound/lame:=
32         >=media-video/mjpegtools-2
33         >=sci-libs/fftw-3
34         x11-libs/libX11:=
35         x11-libs/libXext:=
36         x11-libs/libXft:=
37         x11-libs/libXv:=
38         x11-libs/libXvMC:=
39         x11-libs/libXxf86vm:=
40         virtual/ffmpeg
41         || ( media-video/ffmpeg:0[postproc(-)] media-libs/libpostproc )
42         virtual/jpeg:0
43         alsa? ( media-libs/alsa-lib:= )
44         ieee1394? (
45                 media-libs/libiec61883:=
46                 >=sys-libs/libraw1394-1.2.0:=
47                 >=sys-libs/libavc1394-0.5.0:=
48                 )
49         opengl? (
50                 virtual/glu
51                 virtual/opengl
52                 )"
53 DEPEND="${RDEPEND}
54         app-arch/xz-utils
55         virtual/pkgconfig
56         cpu_flags_x86_mmx? ( dev-lang/nasm )"
57
58 S="${WORKDIR}/CinelerraCV-${PV}"
59
60 src_prepare() {
61         epatch \
62                 "${WORKDIR}"/${P}-patchset/${PN}-20140710-validate_desktop_entry.patch \
63                 "${WORKDIR}"/${P}-patchset/${PN}-ffmpeg.patch \
64                 "${WORKDIR}"/${P}-patchset/${PN}-20140710-underlinking.patch \
65                 "${WORKDIR}"/${P}-patchset/${PN}-20140710-ffmpeg-0.11.patch \
66                 "${WORKDIR}"/${P}-patchset/${PN}-libav9.patch \
67                 "${WORKDIR}"/${P}-patchset/${PN}-pngtoh.patch \
68                 "${WORKDIR}"/${P}-patchset/${PN}-putbits-gcc52.patch \
69                 "${WORKDIR}"/${P}-patchset/${PN}-implicit_decls.patch \
70                 "${WORKDIR}"/${P}-patchset/${PN}-includes.patch
71
72         if has_version '>=media-video/ffmpeg-2' ; then
73                 epatch "${WORKDIR}"/${P}-patchset/${PN}-ffmpeg2.patch
74         fi
75
76         if has_version '>=media-video/ffmpeg-2.9' ; then
77                 epatch "${WORKDIR}"/${P}-patchset/${PN}-ffmpeg29.patch
78         fi
79
80         if has_version '>=media-video/ffmpeg-3.5' ; then
81                 epatch "${FILESDIR}/ffmpeg4.patch"
82         fi
83
84         eautoreconf
85 }
86
87 src_configure() {
88         append-cppflags -D__STDC_CONSTANT_MACROS #321945
89         append-ldflags -Wl,-z,noexecstack #212959
90
91         local myconf
92         use debug && myconf='--enable-x-error-output'
93
94         econf \
95                 $(use_enable oss) \
96                 $(use_enable alsa) \
97                 --disable-esd \
98                 $(use_enable ieee1394 firewire) \
99                 $(use_enable css) \
100                 $(use_enable cpu_flags_x86_mmx mmx) \
101                 $(use_enable cpu_flags_x86_3dnow 3dnow) \
102                 $(use_enable altivec) \
103                 $(use_enable opengl) \
104                 --with-plugindir=/usr/$(get_libdir)/${PN} \
105                 --with-buildinfo=cust/"Gentoo - ${PV}" \
106                 --with-external-ffmpeg \
107                 ${myconf}
108 }
109
110 src_install() {
111         emake DESTDIR="${D}" install
112         dohtml -a png,html,texi,sdw -r doc/*
113
114         rm -rf "${D}"/usr/include
115         mv -vf "${D}"/usr/bin/mpeg3cat{,.hv} || die
116         mv -vf "${D}"/usr/bin/mpeg3dump{,.hv} || die
117         mv -vf "${D}"/usr/bin/mpeg3toc{,.hv} || die
118         dosym /usr/bin/mpeg2enc /usr/$(get_libdir)/${PN}/mpeg2enc.plugin
119
120         prune_libtool_files --all
121 }