app-emulation/vagrant: drop 2.2.2
[gentoo.git] / media-sound / snd / snd-17.4.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools flag-o-matic
7
8 DESCRIPTION="Snd is a sound editor"
9 HOMEPAGE="https://ccrma.stanford.edu/software/snd/"
10 SRC_URI="ftp://ccrma-ftp.stanford.edu/pub/Lisp/${P}.tar.gz"
11
12 LICENSE="Snd BSD-2 HPND GPL-2+ LGPL-2.1+ LGPL-3+ ruby? ( free-noncomm ) s7? ( free-noncomm )"
13 SLOT="0"
14 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
15 IUSE="alsa doc fftw gmp gsl gtk jack ladspa motif opengl oss portaudio pulseaudio readline ruby +s7"
16
17 RDEPEND="media-libs/audiofile
18         alsa? ( media-libs/alsa-lib )
19         fftw? ( sci-libs/fftw:3.0= )
20         gmp? (
21                 dev-libs/gmp:0=
22                 dev-libs/mpc
23                 dev-libs/mpfr:0=
24         )
25         gsl? ( sci-libs/gsl:= )
26         gtk? (
27                 x11-libs/gtk+:3
28                 x11-libs/pango
29                 x11-libs/cairo
30                 opengl? ( x11-libs/gtkglext )
31         )
32         jack? ( media-sound/jack-audio-connection-kit )
33         ladspa? ( media-libs/ladspa-sdk )
34         motif? ( >=x11-libs/motif-2.3:0 )
35         opengl? ( virtual/opengl )
36         portaudio? ( media-libs/portaudio )
37         pulseaudio? ( media-sound/pulseaudio )
38         readline? ( sys-libs/readline:* )
39         ruby? ( dev-lang/ruby:* )"
40 DEPEND="${RDEPEND}"
41
42 REQUIRED_USE="
43         ?? ( portaudio pulseaudio )
44         ?? ( ruby s7 )"
45
46 PATCHES=(
47         "${FILESDIR}"/${PN}-17.4-portaudio.patch
48         "${FILESDIR}"/${PN}-17.4-undefined-oss_sample_types.patch
49 )
50
51 pkg_setup() {
52         if ! use gtk && ! use motif ; then
53                 ewarn "Warning: no graphic toolkit selected (gtk or motif)."
54                 ewarn "Upstream suggests to enable one of the toolkits (or both)"
55                 ewarn "or only the command line utilities will be helpful."
56         fi
57 }
58
59 src_prepare() {
60         default
61         sed -i -e "s:-O2 ::" configure.ac || die
62         eautoreconf
63 }
64
65 src_configure() {
66         # Workaround executable sections QA warning (bug #348754)
67         append-ldflags -Wl,-z,noexecstack
68
69         local myconf
70         if ! use ruby && ! use s7 ; then
71                 myconf+=" --without-extension-language"
72         fi
73
74         econf \
75                 $(use_with alsa) \
76                 $(use_with fftw) \
77                 $(use_with gmp) \
78                 $(use_with gsl) \
79                 $(use_with gtk) \
80                 $(use_with jack) \
81                 $(use_with ladspa) \
82                 $(use_with motif) \
83                 $(use_with oss) \
84                 $(use_with portaudio) \
85                 $(use_with pulseaudio) \
86                 $(use_with ruby) \
87                 $(use_with s7) \
88                 ${myconf}
89 }
90
91 src_compile() {
92         emake snd
93
94         # Do not compile ruby extensions for command line programs since they fail
95         sed -i -e "s:HAVE_RUBY 1:HAVE_RUBY 0:" mus-config.h || die
96
97         local i
98         for i in sndplay sndinfo; do
99            emake ${i}
100         done
101 }
102
103 src_install () {
104         dobin snd sndplay sndinfo
105
106         if use ruby ; then
107                 insinto /usr/share/snd
108                 doins *.rb
109         fi
110
111         if use s7 ; then
112                 insinto /usr/share/snd
113                 doins *.scm
114         fi
115
116         use doc && HTML_DOCS=( *.html pix/*.png )
117         einstalldocs
118         dodoc HISTORY.Snd
119 }