# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-scheme/tinyscheme/tinyscheme-1.40.ebuild,v 1.2 2011/11/30 14:51:15 grobian Exp $ EAPI="5" inherit flag-o-matic multilib DESCRIPTION="Lightweight scheme interpreter" HOMEPAGE="http://tinyscheme.sourceforge.net" SRC_URI="mirror://sourceforge/tinyscheme/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86 ~ppc-macos ~x64-macos" IUSE="static-libs" src_prepare() { epatch "${FILESDIR}"/${P}-makefile.patch if [[ ${CHOST} == *-darwin* ]] ; then append-flags -DOSX sed -i \ -e 's/SOsuf=so/SOsuf=dylib/' \ -e "s|\(\$(LD)\)[^\$]\+\(\$(\)|\1 -Wl,-install_name,${EPREFIX}/usr/lib/lib${PN}.${PV}.dylib \2|" \ makefile || die fi } src_compile() { emake LDFLAGS="${LDFLAGS}"\ AR=$(tc-getAR) CC=$(tc-getCC) } src_install() { newbin scheme ${PN} if [[ ${CHOST} == *-darwin* ]] ; then # this should be done for ELF (all other systems) as well, but only # Darwin/MachO is strict in the install_name (soname) actually pointing # somewhere, so we won't change the ELF scheme here (up to maintainer) mv libtinyscheme$(get_libname) libtinyscheme$(get_libname ${PV}) || die dosym libtinyscheme$(get_libname ${PV}) libtinyscheme$(get_libname) dolib libtinyscheme$(get_libname ${PV}) fi if use static-libs; then dolib.a libtinyscheme.a fi newlib.so libtinyscheme.so libtinyscheme$(get_libname ${PV}) dosym libtinyscheme$(get_libname ${PV}) /usr/$(get_libdir)/libtinyscheme.so dodoc Manual.txt # Bug 328967: dev-scheme/tinyscheme-1.39-r1 doesn't install header file insinto /usr/include/ newins scheme.h tinyscheme.h local INIT_DIR=/usr/share/${PN}/ insinto ${INIT_DIR} doins init.scm dodir /etc/env.d/ && echo "TINYSCHEMEINIT=\"${EPREFIX}${INIT_DIR}init.scm\"" > "${ED}"/etc/env.d/50tinyscheme }