aboutsummaryrefslogtreecommitdiff
blob: 9521bbda1dc745db13ff0b4d583b177897e33c17 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit flag-o-matic eutils

MY_PV="4.0b7"
DESCRIPTION="Astronomical imaging and data visualization application for FITS images"
HOMEPAGE="http://hea-www.harvard.edu/RD/ds9"
SRC_URI="http://hea-www.harvard.edu/saord/download/${PN}/source/${PN}.${MY_PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="doc xpa"
DEPEND=">=sys-devel/gcc-3.4
        virtual/x11"
RDEPEND="virtual/x11"

S=${WORKDIR}/sao${PN}

# This is a long and fragile compilation
# which recompiles tcl/tk, blt, funtools, and who knows what else
# The make install in src_compile only install and strip the ds9 exec
# One day scientists will use tools like autotools, cmake, scons

src_unpack() {
	unpack ${A}
	cd ${S}
    # The patch is to speed up the compilation 
    # (avoid generating tcl man files for ex.) 
    # and avoid local install bugs with symbolic linking.
	epatch ${FILESDIR}/${PN}-Makefile.patch
}

src_compile() {
	! is-flag -fPIC && append-flags -fPIC
	sed -i -e '1i #!/bin/sh' funtools-*/filter/inc.sed
	use x86   && ln -s make.linux make.include
	use amd64 && ln -s make.linux64 make.include
	emake -j1 || die "emake failed"
	make install || die "make install (local) failed"
}

src_install () {
	dobin bin/ds9 || die "dobin ds9 failed"
	if use xpa; then
		dobin bin/xpa* || die "dobin xpa failed"
		doman man/man?/xpa* || die "doman xpa failed"
	fi
	dodoc README acknowledgement copyright || die "dodoc failed"
	use doc && dohtml ds9/doc/* || die "dohtml failed"
}