summaryrefslogtreecommitdiff
blob: b4a6cfd979f49aa0eb6ac43205bd414062a2f03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/tendra/tendra-5.0_pre20060322.ebuild,v 1.2 2006/09/06 16:18:31 truedfx Exp $

inherit eutils toolchain-funcs bsdmk

MY_PV=${PV#*_pre}

DESCRIPTION="A C/C++ compiler initially developed by DERA"
HOMEPAGE="http://www.ten15.org/"
SRC_URI="ftp://ftp.ten15.org/pub/snapshot/tendra-${MY_PV}.tar.bz2
	mirror://gentoo/${P}-misc.patch.bz2
	http://dev.gentoo.org/~truedfx/${P}-misc.patch.bz2"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

DEPEND=""
# Both tendra and tinycc install /usr/bin/tcc
RDEPEND="!dev-lang/tcc"

S=${WORKDIR}/${PN}

pkg_setup() {
	export MAKE=$(get_bmake)
}

src_unpack() {
	unpack tendra-${MY_PV}.tar.bz2
	cd "${S}"
	epatch "${DISTDIR}"/${P}-misc.patch.bz2
}

src_compile() {
	rm -f config.mk

	export MAKE

	# Note: despite the below code block, only x86 linux
	# is supported or even known to work for now
	case $(tc-arch) in
	*-macos) emake darwin  || die ;;
	*-fbsd)  emake freebsd || die ;;
	*-nbsd)  emake netbsd  || die ;;
	*-obsd)  emake openbsd || die ;;
	*)       emake linux   || die ;;
	esac

	for program in CC AS LD
	do
		set -- $(tc-get${program})
		local path=$(type -P $1)
		shift
		export BIN_${program}="${path} $*"
	done

	PREFIX=/usr MANPATH=/usr/share/man \
	emake || die "compilation failed"
}

src_install() {
	export MAKE

	PREFIX=${D}usr MANPATH=${D}usr/share/man \
	emake install || die "installation failed"
}