summaryrefslogtreecommitdiff
blob: f21163a4e7e95f1497655ef4fd27f909aa2d1700 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/ds9/ds9-4.13.ebuild,v 1.5 2007/11/02 09:12:23 bicatali Exp $

inherit flag-o-matic eutils toolchain-funcs

DESCRIPTION="Data visualization application for astronomical FITS images"
HOMEPAGE="http://hea-www.harvard.edu/RD/ds9"
SRC_URI="http://hea-www.harvard.edu/saord/download/${PN}/source/${PN}.${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"
RDEPEND="x11-libs/libX11
	x11-libs/libXdmcp
	x11-libs/libXau"
DEPEND="${RDEPEND}
	|| ( virtual/emacs virtual/xemacs )
	app-arch/zip"

RESTRICT="strip test"

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

src_unpack() {
	unpack ${A}
	cd "${S}"
	# patch to speed up compilation (no man pages generation)
	epatch "${FILESDIR}"/${P}-Makefile.patch
}

src_compile() {
	local ds9arch
	case ${ARCH} in
		x86) ds9arch=linux ;;
		amd64) ds9arch=linux64 ;;
		ppc) ds9arch=linuxppc ;;
		x86-fbsd) ds9arch=freebsd ;;
		*) die "ds9 not supported upstream for this architecture";;
	esac
	ln -s make.${ds9arch} make.include

	# This is a long and fragile compilation
	# which recompiles tcl/tk, tkimg, blt, funtools,
	# and a lot of other packages
	emake -j1 \
		CC="$(tc-getCC)" \
		CXX="$(tc-getCXX)" \
		OPTS="${CXXFLAGS}" \
		|| die "emake failed"
}

src_install () {
	dobin bin/ds9 || die "failed installing ds9 binary"
	dobin bin/xpa* || die "failed installing xpa* binaries"
	doman man/man?/xpa* || die " failed installing man pages"
	dodoc README acknowledgement || die "failed installing basic doc"
	if use doc; then
		dohtml -r doc/* || die "failed installing html doc"
	fi
}