logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

sbagen-1.4.5.ebuild (1358B)


  1. # Copyright 1999-2018 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs flag-o-matic
  5. DESCRIPTION="Command line sequenced binaural beat generator"
  6. HOMEPAGE="https://sbagen.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}.tgz
  8. vorbis? ( sounds? ( https://uazu.net/sbagen/sbagen-river-1.4.1.tgz ) )"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. RESTRICT="mirror"
  13. IUSE="mp3 vorbis sounds"
  14. DEPEND="mp3? ( media-libs/libmad )
  15. vorbis? ( media-libs/tremor )"
  16. RDEPEND="${DEPEND}
  17. virtual/pkgconfig"
  18. DOCS="README.txt SBAGEN.txt"
  19. src_prepare() {
  20. default
  21. rm -r libs || die "Removing third-party libs failed"
  22. rm sbagen || die "Removing sbagen binary failed"
  23. sed -i 's;"libs/mad.h";<mad.h>;' mp3dec.c || die "Fixing mp3dec.c include failed"
  24. sed -i -r 's;include "libs/(.*.h)";include <tremor/\1>;' oggdec.c || die "Fixing oggdec.c include failed"
  25. }
  26. src_compile() {
  27. if use vorbis; then
  28. append-flags -DOGG_DECODE $(pkg-config --libs vorbisidec)
  29. fi
  30. if use mp3; then
  31. append-flags -DMP3_DECODE $(pkg-config --libs mad)
  32. fi
  33. $(tc-getCC) ${CFLAGS} -DT_LINUX -Wall -lpthread ${LDFLAGS} sbagen.c -o sbagen || die "Sbagen: compilation failed"
  34. }
  35. src_install() {
  36. dobin sbagen
  37. if use sounds; then
  38. cd ../sbagen-1.4.1
  39. insinto "/usr/share/${PN}"
  40. doins *.ogg
  41. fi
  42. einstalldocs
  43. }