# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils versionator toolchain-funcs # This ebuild is based on few others ebuilds, thanks to all of you! # New in this version (2008-02-06) # * Fixed ossxmix segmentation fault (based on Arch Linux OSS PKGBUILD: # http://aur.archlinux.org/packages/oss-linux-free/oss-linux-free/PKGBUILD DESCRIPTION="Open Sound System - portable, mixing-capable, high quality sound system for Unix." HOMEPAGE="http://developer.opensound.com/" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RDEPEND=">=x11-libs/gtk+-2 >=sys-kernel/linux-headers-2.6.11" DEPEND="sys-apps/gawk ${RDEPEND}" RESTRICT="mirror" MY_PV=$(get_version_component_range 1-2) MY_BUILD=$(get_version_component_range 3) MY_P="oss-v${MY_PV}-build${MY_BUILD}-src-gpl" SRC_URI="http://www.4front-tech.com/developer/sources/stable/gpl/${MY_P}.tar.bz2 \ http://voimakentta.vpalvelin.com/sources/stable/gpl/${MY_P}.tar.bz2 \ http://developer.opensound.com/sources/stable/gpl/${MY_P}.tar.bz2 " S="${WORKDIR}/${MY_P}" src_unpack() { unpack ${A} mkdir "${WORKDIR}"/build cd "${S}" einfo "Applying patches..." epatch "${FILESDIR}"/${P}-install_sh.patch epatch "${FILESDIR}"/${P}-soundon_no_libsalsa.patch epatch "${FILESDIR}"/${P}-build-fixes.patch epatch "${FILESDIR}"/${P}-fix_ossxmix.patch # replace with our own init.script cp "${FILESDIR}"/oss "${S}"/setup/Linux/oss/etc/S89oss } src_compile() { # Configure has to be run from build dir with full path. cd "${WORKDIR}"/build "${S}"/configure || die "configure failed" einfo "Stripping compiler flags..." sed -i -e 's/$(CFLAGS) $(OSFLAGS)//;s/$(CFLAGS) $(LIBRARIES)//' \ "${WORKDIR}"/build/cmd/*/Makefile \ "${WORKDIR}"/build/os_cmd/Linux/ossvermagic/Makefile \ "${WORKDIR}"/build/os_cmd/Linux/ossdetect/Makefile \ || die "sed failed" sed -i -e 's/ossxmix//g' \ "${WORKDIR}"/build/cmd/Makefile emake build || die "emake build failed" # As the Makefile works not well with ossxmix and seperate building works, we build it. cd "${WORKDIR}"/build/cmd/ossxmix $(tc-getCC) -oossxmix -I"${WORKDIR}/build/include" \ $(pkg-config --libs --cflags gtk+-2.0) *.c ${CFLAGS} \ || die "compiling ossxmix failed" cp ossxmix "${WORKDIR}"/build/prototype/usr/bin || die "command `cp ossxmix ...` failed" } src_install() { newinitd "${FILESDIR}"/oss oss cd "${WORKDIR}"/build cp -R prototype/* "${D}" } pkg_postinst() { elog "To start OSS, simply type:" elog "# /etc/init.d/oss start " }