]> Pileus Git - ~andy/sunrise/blob - dev-lang/scheme2c/scheme2c-9999.ebuild
sunrise/ app-portage/elog-list/elog-list-0.0.6.ebuild: Update headers for 2010
[~andy/sunrise] / dev-lang / scheme2c / scheme2c-9999.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EDARCS_REPOSITORY="http://darcs.debian.org/darcs/${PN}/${PN}/"
6
7 inherit eutils darcs multilib
8
9 DESCRIPTION="The Scheme->C compiler, R4RS compliant"
10 HOMEPAGE="http://alioth.debian.org/projects/scheme2c/"
11 SRC_URI=""
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="" #only x32 and amd64 are tested and supported
16 IUSE="X doc"
17
18 DEPEND="dev-libs/libsigsegv
19            doc? ( app-text/ghostscript-gpl )
20            X? ( x11-libs/libX11 )"
21 RDEPEND="${DEPEND}"
22
23 src_compile() {
24         if use doc; then
25                 emake -C doc/ embedded.pdf index.pdf intro.pdf smithnotes.pdf || \
26                         die "Failed to build documents"
27         fi
28
29         if use x86; then
30                 emake forLINUX || die "Failed to set up Linux build"
31                 cd LINUX
32         elif use amd64; then
33                 emake forAMD64 || die "Failed to set up AMD64 build"
34                 cd AMD64
35         else
36                 die "Unimplemented architecture"
37         fi
38
39         # Due to insanity in the build system we have to touch these to
40         # guarantee that everything will always get built
41         touch scrt/*.c
42         touch scsc/*.c
43
44         emake -j1 all || die "Failed to compile"
45
46         if use X; then
47                 emake -C cdecl || die "cdecl couldn't build"
48                 emake -C xlib -B sizeof.cdecl || die "cdecl couldn't run"
49                 emake -C xlib all || die "xlib bindings failed to build"
50         fi
51 }
52
53 src_install() {
54         if use x86; then
55                 cd LINUX
56         elif use amd64; then
57                 cd AMD64
58         else
59                 die "Unimplemented architecture"
60         fi
61
62         insinto /usr/$(get_libdir)/${PN}
63
64 # Only a small subset of files from scrt is required
65         doins scrt/libsc.a scrt/predef.sc scrt/objects.h scrt/options.h ||  \
66                 die "Failed to install scrt files"
67
68         dobin scrt/sci scsc/{scc,sccomp} || die "Failed to install binaries"
69
70         if use X; then
71                 doins xlib/scxl.a || die "Failed to install X11 bindings"
72                 dobin xlib/scixl || die "Failed to install X11-aware interpreter"
73                 newdoc xlib/doc.txt xlib.txt || die "Failed to install X documentation"
74         fi
75
76         cd ..
77
78         cp doc/scc.l doc/scc.1 || die
79         cp doc/sci.l doc/sci.1 || die
80         doman doc/{scc,sci}.1 || die "Failed to install man pages"
81
82         if use doc; then
83                 dodoc doc/*.pdf || die "Failed to install pdf documentation"
84         fi
85
86         dodoc CHANGES README || die "Failed to install documentation"
87
88         dosed "s:.*sccomp:sccomp:g" /usr/bin/scc || die
89         dosed "s:-LIBDIR.*t:-LIBDIR /usr/$(get_libdir)/scheme2c/ \
90                            -I/usr/$(get_libdir)/scheme2c/:g" /usr/bin/scc || die
91         dosed "s:-scmh 40:-scmh 1000 -sch 10:g" /usr/bin/scc || die
92 }