summaryrefslogtreecommitdiff
blob: 66de7f115a53a2519134bbc6fa9a7aa7ec7689cb (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-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-sci/xfoil/xfoil-6.94-r1.ebuild,v 1.1 2004/02/04 09:48:50 george Exp $

inherit gcc

MY_PN="${PN}"
MY_PN_upper="`echo ${PN} | tr '[:lower:]' '[:upper:]'`"
MY_PV="${PV/./}"
MY_P="${MY_PN}${MY_PV}"
MY_P_upper="${MY_PN_upper}${MY_PV}"

DESCRIPTION="XFOIL - design and analysis of subsonic isolated airfoils"
HOMEPAGE="http://raphael.mit.edu/xfoil/"
SRC_FILE="${MY_P}.tar.gz"
SRC_URI="${HOMEPAGE}/${SRC_FILE} doc? ( ${HOMEPAGE}/xfoil_doc.ps ${HOMEPAGE}/xfoil_doc.pdf )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
DEPEND="virtual/blas
	app-sci/blas-config
	x11-base/xfree"

RDEPEND="x11-base/xfree"

S=${WORKDIR}/${MY_P_upper}


src_unpack() {
	unpack ${A}
	cd ${S}
	[ -z "$FC" ] && FC=g77 # because gcc-config doesn't do it yet
	[ -z "${FFLAGS}" ] && FFLAGS="${CFLAGS}" # because gcc-config doesn't do it yet
	echo "CC = ${CC}" >>plotlib/config.make
	echo "FC = ${FC}" >>plotlib/config.make
	echo "CFLAGS += ${CFLAGS}" >>plotlib/config.make
	echo "FFLAGS += ${FFLAGS}" >>plotlib/config.make
	sed -i bin/Makefile \
	-e "s/^\(FC.*\)/FC = ${FC}/g" \
	-e "s/^\(CC.*\)/CC = ${CC}/g" \
	-e "s/^\(FFLAGS .*\)/FFLAGS = ${FFLAGS}/g" \
	-e "s/^\(FFLOPT .*\)/FFLOPT = \$(FFLAGS)/g" \
	-e "s/^\(FFLAGS2 .*\)/FFLAGS2 = \$(FFLAGS)/g"
}

src_compile() {
	cd ${S}/plotlib
	emake || die "failed to build plotlib"
	cd ${S}/bin
	for i in xfoil pplot pxplot; do
		emake ${i} || die "failed to build ${i}"
	done
}

src_install() {
	dobin bin/pplot bin/pxplot bin/xfoil
	dodoc version_notes.txt  xfoil_doc.txt sessions.txt README
	use doc && dodoc ${DISTDIR}/xfoil_doc.ps ${DISTDIR}/xfoil_doc.pdf
	docinto runs
	dodoc runs/*
}