dev-tcltk/snack: MissingTestRestrict
[gentoo.git] / dev-tcltk / snack / snack-2.2.10-r8.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 pypy )
7
8 inherit autotools distutils-r1 multilib virtualx
9
10 DESCRIPTION="The Snack Sound Toolkit (Tcl)"
11 HOMEPAGE="http://www.speech.kth.se/snack/"
12 SRC_URI="http://www.speech.kth.se/snack/dist/${PN}${PV}.tar.gz"
13
14 LICENSE="GPL-2"
15 KEYWORDS="amd64 ~hppa ~ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
16 SLOT="0"
17 IUSE="alsa examples python vorbis"
18 RESTRICT="!test? ( test )"
19
20 DEPEND="
21         dev-lang/tcl:0=
22         dev-lang/tk:0=
23         alsa? ( media-libs/alsa-lib )
24         python? ( ${PYTHON_DEPS} )
25         vorbis? ( media-libs/libvorbis )"
26 RDEPEND="${DEPEND}"
27
28 S="${WORKDIR}/${PN}${PV}/unix"
29
30 PATCHES=(
31         "${FILESDIR}"/alsa-undef-sym.patch
32         "${FILESDIR}"/${P}-CVE-2012-6303-fix.patch
33         "${FILESDIR}"/${P}-debian-args.patch
34         "${FILESDIR}"/${P}-test.patch
35 )
36
37 HTML_DOCS="${WORKDIR}/${PN}${PV}/doc/*"
38
39 src_prepare() {
40         # adds -install_name (soname on Darwin)
41         [[ ${CHOST} == *-darwin* ]] && PATCHES+=( "${FILESDIR}"/${P}-darwin.patch )
42
43         sed \
44                 -e "s:ar cr:$(tc-getAR) cr:g" \
45                 -e "s:-O:${CFLAGS}:g" \
46                 -i Makefile.in || die
47
48         cd ..
49
50         default
51
52         sed \
53                 -e 's|^\(#define roundf(.*\)|//\1|' \
54                 -i generic/jkFormatMP3.c || die
55         rm tests/{play,record}.test || die
56 }
57
58 src_configure() {
59         local myconf=""
60
61         use alsa && myconf+=" --enable-alsa"
62
63         if use vorbis; then
64                 myconf+=" --with-ogg-include="${EPREFIX}"/usr/include"
65                 myconf+=" --with-ogg-lib="${EPREFIX}"/usr/$(get_libdir)"
66         fi
67
68         econf \
69                 --libdir="${EPREFIX}"/usr/$(get_libdir) \
70                 --includedir="${EPREFIX}"/usr/include \
71                 --with-tcl="${EPREFIX}"/usr/$(get_libdir) \
72                 --with-tk="${EPREFIX}"/usr/$(get_libdir) \
73                 $myconf
74 }
75
76 src_compile() {
77         default
78 }
79
80 src_test() {
81         TCLLIBPATH=${S} virtx default | tee snack.testResult
82         grep -q FAILED snack.testResult && die
83 }
84
85 src_install() {
86         default
87
88         if use python ; then
89                 cd "${S}"/../python || die
90                 distutils-r1_src_install
91         fi
92
93         cd "${S}"/.. || die
94
95         if use examples ; then
96                 docinto examples
97                 sed -i -e 's/wish[0-9.]+/wish/g' demos/tcl/* || die
98                 dodoc -r demos/tcl
99
100                 use python && dodoc -r demos/python
101         fi
102 }