summaryrefslogtreecommitdiff
blob: e427346622681f47ce2e925cc409e2619359d57d (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
73
74
75
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-biology/seaview/seaview-4.1.ebuild,v 1.1 2009/10/07 18:36:07 weaver Exp $

EAPI="2"

inherit toolchain-funcs multilib eutils

DESCRIPTION="A graphical multiple sequence alignment editor"
HOMEPAGE="http://pbil.univ-lyon1.fr/software/seaview.html"
SRC_URI="ftp://pbil.univ-lyon1.fr/pub/mol_phylogeny/seaview/archive/${PN}_${PV}.tar.gz"

LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+pdf +xft"

DEPEND="x11-libs/fltk:1.1
	pdf? ( media-libs/pdflib )
	xft? (	x11-libs/libXft
			x11-libs/fltk[-noxft] )"
RDEPEND="${DEPEND}
	sci-biology/clustalw
	|| ( sci-libs/libmuscle sci-biology/muscle )
	sci-biology/phyml"

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

src_prepare() {
	# respect CXXFLAGS (package uses them as CFLAGS)
	sed -i \
		-e "s:^CXX.*:CXX = $(tc-getCXX):" \
		-e "s:\$(OPT):${CXXFLAGS}:" \
		-e "s:^OPT:#OPT:" \
		-e "s:^#IFLTK .*:IFLTK = $(fltk-config --use-images --cxxflags):" \
		-e "s:^#LFLTK .*:LFLTK = $(fltk-config --use-images --ldflags):" \
		-e "s:^USE_XFT:#USE_XFT:" \
		-e "s:^#HELPFILE:HELPFILE:" \
		-e "s:^#PHYMLNAME:PHYMLNAME:" \
		Makefile || die "sed failed while editing Makefile"

	if use pdf; then
		sed -i \
			-e "s:PDF_PS_FLAGS = -DNO_PDF:#PDF_PS_FLAGS = -DNO_PDF:" \
			-e "s:PDF_PS = postscript:#PDF_PS = postscript:" \
			-e "s:#PDF_INC = \$(HOME)/PDFlibLite:PDF_INC = /usr/include:" \
			-e "s:#PDF_LIB = \$(HOME)/PDFlibLite:PDF_LIB = /usr/lib:" \
			-e "s:#PDF_PS = pdf:PDF_PS = pdf:" \
			-e "s:#PDF_PS_FLAGS = -I\$(PDF_INC):PDF_PS_FLAGS = -I\$(PDF_INC):" \
			-e "s:#LPDF = -L\$(PDF_LIB) -lpdf:LPDF = -L\$(PDF_LIB) -lpdf:" \
			Makefile || die "sed failed while editing Makefile to enable pdf output"
	fi

	if use xft; then
		sed -i \
			-e "s:^#USE_XFT .*:USE_XFT = -DUSE_XFT $(xft-config --cflags):" \
			-e "s:-lXft:$(xft-config --libs):" \
			Makefile || die "sed failed while editing Makefile to enable xft"
	fi
}

src_install() {
	dobin seaview || die

	# /usr/share/seaview/seaview.html is hardcoded in the binary, see Makefile
	insinto /usr/share/seaview
	doins example.nxs seaview.html

	insinto /usr/share/seaview/images
	doins seaview.xpm || die

	make_desktop_entry seaview Seaview /usr/share/pixmaps/seaview.xpm || die

	doman seaview.1 || die
}