1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 pypy )
8 inherit autotools distutils-r1 multilib virtualx
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"
15 KEYWORDS="amd64 ~hppa ~ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17 IUSE="alsa examples python vorbis"
18 RESTRICT="!test? ( test )"
23 alsa? ( media-libs/alsa-lib )
24 python? ( ${PYTHON_DEPS} )
25 vorbis? ( media-libs/libvorbis )"
28 S="${WORKDIR}/${PN}${PV}/unix"
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
37 HTML_DOCS="${WORKDIR}/${PN}${PV}/doc/*"
40 # adds -install_name (soname on Darwin)
41 [[ ${CHOST} == *-darwin* ]] && PATCHES+=( "${FILESDIR}"/${P}-darwin.patch )
44 -e "s:ar cr:$(tc-getAR) cr:g" \
45 -e "s:-O:${CFLAGS}:g" \
53 -e 's|^\(#define roundf(.*\)|//\1|' \
54 -i generic/jkFormatMP3.c || die
55 rm tests/{play,record}.test || die
61 use alsa && myconf+=" --enable-alsa"
64 myconf+=" --with-ogg-include="${EPREFIX}"/usr/include"
65 myconf+=" --with-ogg-lib="${EPREFIX}"/usr/$(get_libdir)"
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) \
81 TCLLIBPATH=${S} virtx default | tee snack.testResult
82 grep -q FAILED snack.testResult && die
89 cd "${S}"/../python || die
90 distutils-r1_src_install
95 if use examples ; then
97 sed -i -e 's/wish[0-9.]+/wish/g' demos/tcl/* || die
100 use python && dodoc -r demos/python