summaryrefslogtreecommitdiff
blob: bceb98549fdbc9d394b3f11911c7770c8898065a (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
69
70
71
72
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/xgks-pmel/xgks-pmel-2.5.5.ebuild,v 1.2 2009/05/16 15:34:28 nerdboy Exp $

inherit eutils fortran toolchain-funcs multilib

DESCRIPTION="PMEL fork of XGKS, an X11-based version of the ANSI Graphical Kernel System."
HOMEPAGE="http://www.gentoogeek.org/viewvc/Linux/xgks-pmel/"
SRC_URI="http://www.gentoogeek.org/files/${P}.tar.gz"
LICENSE="UCAR-Unidata"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="doc"

RDEPEND="x11-libs/libX11"

DEPEND="${RDEPEND}
	sys-devel/flex
	sys-apps/groff"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/aclocal.patch
}

src_compile() {
	sed -i -e "s:lib64:$(get_libdir):g" port/master.mk.in \
	    fontdb/Makefile.in || die "sed 1 failed"

	CFLAGS=${CFLAGS} LD_X11='-L/usr/$(get_libdir) -lX11' \
	    FC=${FORTRANC} CC=$(tc-getCC) OS=linux \
	    ./configure --prefix=/usr --exec_prefix=/usr/bin \
	    || die "configure failed"

	sed -i -e "s:port/all port/install:port/all:g" Makefile \
	    || die "sed 2 failed"

	make || die "make failed"

	cd src/fortran
	make || die "make fortran failed"
}

src_install() {
	dobin progs/{defcolors,font,mi,pline,pmark} || die
	dolib.a src/lib/libxgks.a || die

	dodoc COPYRIGHT HISTORY INSTALL README || die
	doman doc/{xgks.3,xgks_synop.3} || die
	if use doc; then
	    newdoc doc/binding/cbinding.me cbinding || die
	    newdoc doc/userdoc/userdoc.me userdoc || die
	    insinto /usr/share/doc/${P}/examples
	    doins progs/{hanoi.c,star.c} || die
	fi

	insinto /usr/include/xgks
	doins src/lib/gks*.h || die
	doins src/lib/gksm/gksm*.h || die
	doins src/fortran/f*.h || die
	doins src/lib/w*.h || die
	doins src/lib/{input.h,metafile.h,polylines.h,polymarkers.h,text.h} \
	    || die

	insinto /usr/include
	doins src/lib/xgks.h || die
	doins port/udposix.h || die

	insinto /usr/share/xgksfonts
	doins fontdb/{[1-9],*.gksfont} || die
}