# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit git-r3

EGIT_REPO_URI="http://haltp.org/git/${PN}.git"
EGIT_MIN_CLONE_TYPE="mirror"

DESCRIPTION="a purely functional dialect of Scheme"
HOMEPAGE="http://code.google.com/p/ouspg/wiki/Blab https://github.com/aoh/blab"

LICENSE="AS-IS"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

CDEPENDS="dev-lisp/owl-lisp"
DEPENDS="${CDEPENDS}"

DOCS="README"

src_prepare() {
	sed -i -e 's|DESTDIR=|DESTDIR?=|g' Makefile || die 'sed failed'
	sed -i -e 's|CC=|CC?=|g' Makefile || die 'sed failed'
	sed -i -e 's|PREFIX=|PREFIX?=|g' Makefile || die 'sed failed'
	sed -i -e 's|CFLAGS=|CFLAGS?=|g' Makefile || die 'sed failed'
	sed -i -e 's|OFLAGS=|OFLAGS?=|g' Makefile || die 'sed failed'
	sed -i -e 's|OL=owl-lisp/bin/ol|OL=ol|g' Makefile || die 'sed failed'
	sed -i -e 's|make get-owl|/bin/true|g' Makefile || die 'sed failed'
	sed -i -e 's|git clone|/bin/true|g' Makefile || die 'sed failed'
	sed -i -e 's|git pull|/bin/true|g' Makefile || die 'sed failed'
	sed -i -e 's|${CC} -O2 |${CC} ${CFLAGS} |g' Makefile || die 'sed failed'
	sed -i -e 's|../owl-lisp/bin/ol|ol|g' tests/script-{client,owlish,socket}.sh || die 'sed failed'
	rm tests/script-client.sh || die 'removing script-client.sh failed'
	rm tests/script-socket.sh || die 'removing script-socket.sh failed'
}