summaryrefslogtreecommitdiff
blob: 366d41a75bd97ce04a7110261492562a77c8dff0 (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
76
77
78
79
80
81
82
83
84
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=4

inherit eutils multilib prefix toolchain-funcs

MY_PV="${PV/_p/.}.0"
MY_P="${PN}-${MY_PV}"

DESCRIPTION="Publication-quality molecular visualization package"
HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
SRC_URI="
	ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
	ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"

LICENSE="molmol"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
IUSE=""

DEPEND="
	|| (
		(	media-libs/mesa
			x11-libs/libGLw )
		media-libs/mesa[motif] )
	media-libs/libpng:0
	media-libs/tiff:0
	sys-libs/zlib
	virtual/glu
	virtual/jpeg
	x11-libs/libXpm
	x11-libs/motif:0
	x11-apps/xdpyinfo"
RDEPEND="${DEPEND}"

S="${WORKDIR}"

MAKEOPTS="${MAKEOPTS} -j1"

pkg_setup() {
	MMDIR="/usr/$(get_libdir)/molmol"
}

src_prepare() {
	rm -rf tiff*
	# Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
	epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff

	epatch "${FILESDIR}"/prefix.patch
	eprefixify molmol

	epatch "${FILESDIR}"/ldflags.patch

	ln -s makedef.lnx "${S}"/makedef || die

	sed \
		-e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
		-e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
		-i "${S}"/molmol || die
	sed \
		-e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
		-e "s:^CC.*:CC = $(tc-getCC):" \
		-i "${S}"/makedef || die

	epatch "${FILESDIR}"/cast.patch
	epatch "${FILESDIR}"/libpng15.patch

	# patch from fink
	# fixes numerous bad bracings and hopefully the OGL bug 429974
	epatch "${FILESDIR}"/${P}-fink.patch
}

src_install() {
	dobin molmol

	exeinto ${MMDIR}
	newexe src/main/molmol molmol.lnx
	insinto ${MMDIR}
	doins -r auxil help macros man setup tips

	dodoc HISTORY README
}