media-sound/strawberry: Removed old
[gentoo.git] / media-sound / ardour / ardour-5.12.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=( python2_7 )
6 PYTHON_REQ_USE='threads(+)'
7 #EPYTHON='python2.7'
8 inherit eutils toolchain-funcs flag-o-matic python-any-r1 waf-utils
9
10 DESCRIPTION="Digital Audio Workstation"
11 HOMEPAGE="http://ardour.org/"
12
13 if [[ ${PV} == *9999* ]]; then
14         EGIT_REPO_URI="https://git.ardour.org/ardour/ardour.git"
15         inherit git-r3
16 else
17         KEYWORDS="~amd64 ~x86"
18         SRC_URI="mirror://gentoo/${P}.tar.bz2"
19         S="${WORKDIR}/Ardour-${PV}.0"
20 fi
21
22 LICENSE="GPL-2"
23 SLOT="5"
24 IUSE="altivec doc jack cpu_flags_x86_sse cpu_flags_x86_mmx cpu_flags_x86_3dnow"
25
26 RDEPEND="
27         >=dev-cpp/glibmm-2.32.0
28         >=dev-cpp/gtkmm-2.16:2.4
29         >=dev-cpp/libgnomecanvasmm-2.26:2.6
30         dev-libs/boost:=
31         >=dev-libs/glib-2.10.1:2
32         dev-libs/libsigc++:2
33         >=dev-libs/libxml2-2.6:2
34         dev-libs/libxslt
35         >=gnome-base/libgnomecanvas-2
36         media-libs/alsa-lib
37         media-libs/aubio
38         media-libs/flac
39         media-libs/freetype:2
40         media-libs/libart_lgpl
41         media-libs/liblo
42         >=media-libs/liblrdf-0.4.0-r20
43         >=media-libs/libsamplerate-0.1
44         >=media-libs/libsndfile-1.0.18
45         >=media-libs/libsoundtouch-1.6.0
46         media-libs/raptor:2
47         >=media-libs/rubberband-1.6.0
48         >=media-libs/taglib-1.7
49         media-libs/vamp-plugin-sdk
50         net-misc/curl
51         sys-libs/readline:0=
52         sci-libs/fftw:3.0[threads]
53         virtual/libusb:1
54         x11-libs/cairo
55         >=x11-libs/gtk+-2.8.1:2
56         x11-libs/pango
57         jack? ( virtual/jack )
58         media-libs/lilv
59         media-libs/sratom
60         dev-libs/sord
61         >=media-libs/suil-0.6.10
62         >=media-libs/lv2-1.4.0"
63
64 DEPEND="${RDEPEND}
65         ${PYTHON_DEPS}
66         jack? ( virtual/jack )
67         sys-devel/gettext
68         virtual/pkgconfig
69         doc? ( app-doc/doxygen[dot] )"
70
71 pkg_setup() {
72         if has_version \>=dev-libs/libsigc++-2.6 ; then
73                 append-cxxflags -std=c++11
74         fi
75         python-any-r1_pkg_setup
76 }
77
78 src_prepare() {
79         eapply_user
80         if ! [[ ${PV} == *9999* ]]; then
81                 eapply "${FILESDIR}"/${PN}-4.x-revision-naming.patch
82                 touch "${S}/libs/ardour/revision.cc"
83         fi
84         sed 's/'full-optimization\'\ :\ \\[.*'/'full-optimization\'\ :\ \'\','/' -i "${S}"/wscript || die
85         MARCH=$(get-flag march)
86         OPTFLAGS=""
87         if use cpu_flags_x86_sse; then
88                 if [[ ${MARCH} == "i686" ]] || [[ ${MARCH} == "i486" ]]; then
89                         elog "You enabled sse but use an march that does not support sse!"
90                         elog "We add -msse to the flags now, but please consider switching your march in make.conf!"
91                 fi
92                 OPTFLAGS="sse"
93         fi
94         if use cpu_flags_x86_mmx; then
95                 if [[ ${MARCH} == "i486" ]]; then
96                     elog "You enabled mmx with i486 set as march! You have been warned!"
97                 fi
98                 OPTFLAGS="${OPTFLAGS} mmx"
99         fi
100         if use cpu_flags_x86_3dnow; then
101                 OPTFLAGS="${OPTFLAGS} 3dnow"
102         fi
103         sed 's/flag_line\ =\ o.*/flag_line\ =\ \": '"${OPTFLAGS}"' just some place holders\"/' \
104                 -i "${S}"/wscript || die
105         sed 's/cpu\ ==\ .*/cpu\ ==\ "LeaveMarchAsIs":/' -i "${S}"/wscript || die
106         append-flags "-lboost_system"
107         python_fix_shebang "${S}"/wscript
108         python_fix_shebang "${S}"/waf
109 }
110
111 src_configure() {
112         tc-export CC CXX
113         mkdir -p "${D}"
114         waf-utils_src_configure \
115                 $(usex doc "--docs" '') \
116                 $({ use altivec || use cpu_flags_x86_sse; } && echo "--fpu-optimization" || echo "--no-fpu-optimization") \
117                 $(usex jack "--with-backends=alsa,jack" "--with-backends=alsa  --libjack=weak") \
118                 --destdir="${D}" \
119                 --prefix=/usr \
120                 --configdir=/etc \
121                 --nls \
122                 --optimize
123 }
124
125 src_install() {
126         waf-utils_src_install
127         mv ${PN}.1 ${PN}${SLOT}.1
128         doman ${PN}${SLOT}.1
129         newicon "${S}/gtk2_ardour/resources/Ardour-icon_48px.png" ${PN}${SLOT}.png
130         make_desktop_entry ardour5 ardour5 ardour5 AudioVideo
131 }
132
133 pkg_postinst() {
134         elog "Please do _not_ report problems with the package to ${PN} upstream."
135         elog "If you think you've found a bug, check the upstream binary package"
136         elog "before you report anything to upstream."
137 }