# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit flag-o-matic eutils DESCRIPTION="Platform independent C/C++ music tracking and sequencing library compatible to Jeskola Buzz" HOMEPAGE="http://trac.zeitherrschaft.org/zzub/" SRC_URI="mirror://sourceforge/aldrin/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="sndfile no-signature debug zzub-module zzub-stream lunar jack alsa oss mp3 ladspa dssi" RDEPEND="jack? (media-sound/jack-audio-connection-kit) alsa? (media-libs/alsa-lib) oss? (media-libs/alsa-oss) sndfile? (media-libs/libsndfile) mp3? (media-libs/libmpeg2) ladspa? (media-libs/ladspa-sdk) dssi? (media-libs/dssi)" DEPEND="${RDEPEND} >=dev-util/scons-0.96.94" use_yn() { use $1 && echo ${2:-yes} || echo ${3:-no} } sse_warn() { if ! is-flagq -msse ; then ewarn "WARNING: you have not \"-msse\" in your CFLAGS" ewarn "it is strongly recommended to enable sse" ewarn "otherwise you will experience bad performances" echo epause 3 fi } src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}/scons.diff" } src_compile() { sse_warn for f in "-O3" "-O2" "-Os" ; do if is-flagq $f ; then ewarn "Compiling with $f is known to produce incorrectly" ewarn "optimized code (due to a bug in gcc 4.1?)" echo epause 6 elog "Continuing with -O1 instead ..." echo replace-flags $f "-O1" fi done # -ftree-pre causes bad waveforms in some Buzz synths filter-flags -ftree-pre && append-flags -fno-tree-pre # sse{,2} here just adds cflags, but we know how to setup make.conf :P scons PREFIX=/usr DEBUG=$(use_yn debug) \ SSE=no SSE2=no \ USE_SIGNATURE=$(use_yn no-signature no yes) \ LUNAR=$(use_yn lunar) \ ZZUB_MODULE=$(use_yn zzub-module) ZZUB_STREAM=$(use_yn zzub-stream) \ JACK=$(use_yn jack) ALSA=$(use_yn alsa) OSS=$(use_yn oss) \ SNDFILE=$(use_yn sndfile) MP3=$(use_yn mp3) \ LADSPA=$(use_yn ladspa) DSSI=$(use_yn dssi) \ configure || die scons PREFIX=/usr || die } pkg_postinst() { sse_warn } src_install() { scons DESTDIR="${D}" install || die "emake install failed" }