summaryrefslogtreecommitdiff
blob: f42ed7a99b29a3b42db353a2336c0c2164e842a6 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcslib/wcslib-4.3.3-r1.ebuild,v 1.3 2009/08/11 18:55:50 mr_bones_ Exp $

EAPI=2
inherit eutils versionator virtualx flag-o-matic

DESCRIPTION="Astronomical World Coordinate System transformations library"
HOMEPAGE="http://www.atnf.csiro.au/people/mcalabre/WCS/"
SRC_URI="ftp://ftp.atnf.csiro.au/pub/software/${PN}/${P}.tar.gz"

LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"

RDEPEND="sci-libs/pgplot
	sci-libs/cfitsio"
DEPEND="${RDEPEND}
	test? (
		media-fonts/font-misc-misc
		media-fonts/font-cursor-misc )"

src_prepare() {
	sed -i \
		-e 's/$(SHRLD)/$(SHRLD) $(LDFLAGS)/' \
		C/GNUmakefile || die
	epatch "${FILESDIR}"/${P}-flibs.patch
	epatch "${FILESDIR}"/${P}-tests.patch
	append-flags -U_FORTIFY_SOURCE
}

src_compile() {
	# -j1 forced. build system too crappy to be worth debugging
	# does not really fix anything
	emake -j1 || die "emake failed"
}

src_test() {
	Xemake -j1 check || die "emake test failed"
}

src_install () {
	# make install from makefile is buggy
	dobin utils/{HPXcvt,fitshdr,wcsgrid} || die "dobin failed"
	WCSV=$(get_version_component_range 1-2)
	dolib.a C/libwcs-${WCSV}.a pgsbox/libpgsbox-${WCSV}.a || die
	dolib.so C/libwcs.so.${WCSV} || die
	dosym libwcs.so.${WCSV} /usr/$(get_libdir)/libwcs.so
	dosym libwcs-${WCSV}.a /usr/$(get_libdir)/libwcs.a
	dosym libpgsbox-${WCSV}.a /usr/$(get_libdir)/libpgsbox.a

	insinto /usr/include/${P}
	doins wcsconfig.h wcsconfig_f77.h || die
	doins pgsbox/*.h C/*.h Fortran/*inc || die
	dosym ${P} /usr/include/${PN}

	dodoc README
	newdoc C/CHANGES CHANGES_C
	newdoc Fortran/CHANGES CHANGES_FORTRAN
	newdoc pgsbox/CHANGES CHANGES_PGSBOX
}