snack-2.2.10-r6.ebuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 pypy )
  5. inherit autotools autotools-utils distutils-r1 multilib
  6. DESCRIPTION="The Snack Sound Toolkit (Tcl)"
  7. HOMEPAGE="http://www.speech.kth.se/snack/"
  8. SRC_URI="http://www.speech.kth.se/snack/dist/${PN}${PV}.tar.gz"
  9. LICENSE="GPL-2"
  10. KEYWORDS="alpha amd64 hppa ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
  11. SLOT="0"
  12. IUSE="alsa examples python threads vorbis"
  13. RESTRICT="test" # Bug 78354
  14. DEPEND="
  15. dev-lang/tcl:0=
  16. dev-lang/tk:0=
  17. alsa? ( media-libs/alsa-lib )
  18. python? ( ${PYTHON_DEPS} )
  19. vorbis? ( media-libs/libvorbis )"
  20. RDEPEND="${DEPEND}"
  21. S="${WORKDIR}/${PN}${PV}/unix"
  22. #PYTHON_MODNAME="tkSnack.py"
  23. AUTOTOOLS_IN_SOURCE_BUILD=1
  24. PATCHES=(
  25. "${FILESDIR}"/alsa-undef-sym.patch
  26. "${FILESDIR}"/${P}-CVE-2012-6303-fix.patch
  27. )
  28. src_prepare() {
  29. # adds -install_name (soname on Darwin)
  30. [[ ${CHOST} == *-darwin* ]] && PATCHES+=( "${FILESDIR}"/${P}-darwin.patch )
  31. sed \
  32. -e "s:ar cr:$(tc-getAR) cr:g" \
  33. -e "s:-O:${CFLAGS}:g" \
  34. -i Makefile.in || die
  35. cd .. || die
  36. autotools-utils_src_prepare
  37. sed \
  38. -e 's|^\(#define roundf(.*\)|//\1|' \
  39. -i generic/jkFormatMP3.c || die
  40. }
  41. src_configure() {
  42. local myeconfargs=(
  43. --libdir="${EPREFIX}"/usr/$(get_libdir)
  44. --includedir="${EPREFIX}"/usr/include
  45. )
  46. use alsa && myconf+=( --enable-alsa )
  47. use threads && myconf+=( --enable-threads )
  48. use vorbis && \
  49. myconf+=( --with-ogg-include="${EPREFIX}"/usr/include ) && \
  50. myconf+=( --with-ogg-lib="${EPREFIX}"/usr/$(get_libdir) )
  51. autotools-utils_src_configure
  52. }
  53. src_compile() {
  54. autotools-utils_src_compile
  55. }
  56. src_install() {
  57. autotools-utils_src_install
  58. if use python ; then
  59. cd "${S}"/../python || die
  60. distutils-r1_src_install
  61. fi
  62. cd "${S}"/.. || die
  63. dohtml doc/*
  64. if use examples ; then
  65. docinto examples
  66. sed -i -e 's/wish[0-9.]+/wish/g' demos/tcl/* || die
  67. dodoc -r demos/tcl
  68. use python && dodoc -r demos/python
  69. fi
  70. }