summaryrefslogtreecommitdiff
blob: 9c21e754f68b64f02a81f92a66902e2d68f725cb (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/c-intercal/c-intercal-28.0.ebuild,v 1.1 2008/10/08 00:58:26 ulm Exp $

inherit elisp-common eutils multilib versionator

# Yes, C-INTERCAL uses minor-major...
MY_PV=$(get_version_component_range 2).$(get_version_component_range 1)

DESCRIPTION="C-INTERCAL - INTERCAL to binary (via C) compiler"
HOMEPAGE="http://intercal.freeshell.org"
SRC_URI="http://intercal.freeshell.org/download/ick-${MY_PV/./-}.tgz"

LICENSE="GPL-2 FDL-1.2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="emacs examples"

DEPEND="emacs? ( virtual/emacs )"
RDEPEND="${DEPEND}"

S=${WORKDIR}/ick-${MY_PV}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}-fix-install-info.patch
	epatch "${FILESDIR}"/${P}-fix-64bit.patch
	epatch "${FILESDIR}"/${P}-parallel-make.patch

	# This was done for DOS compatiblity it seems. Go figure...
	ln -s config.sh configure || die "ln -s failed"
}

src_compile() {
	econf || die "econf failed"
	emake || die "emake failed"

	if use emacs; then
		elisp-compile etc/intercal.el || die "elisp-compile failed"
	fi
}

src_install() {
	# Thinks the directories exist, won't as this is done to a DESTDIR...
	dodir /usr/bin
	dodir /usr/$(get_libdir)
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc BUGS.txt NEWS.txt README.txt doc/THEORY.txt

	if use emacs; then
		elisp-install ${PN} etc/intercal.{el,elc} || die "elisp-install failed"
	fi

	if use examples; then
		insinto /usr/share/doc/${PF}
		doins -r pit || die "doins -r pit failed"
	fi
}