aboutsummaryrefslogtreecommitdiff
blob: 6e031ef5c77878cfa8d4a6c8b4e1811c6965c275 (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
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MY_PN=FormCalc
MY_P=${MY_PN}-${PV}

DESCRIPTION="FormCalc can be used for automatic Feynman diagram computation."
HOMEPAGE="http://feynarts.de/formcalc"
SRC_URI="http://feynarts.de/formcalc/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="LGPL-3+"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
	sci-mathematics/mathematica
	sci-mathematics/form
	"
DEPEND="${RDEPEND}"
BDEPEND="
	sci-mathematics/mathematica
	sci-mathematics/form
	"

PATCHES=( "${FILESDIR}"/${P}-compile.patch )

src_compile() {
	# remove shipped binaries
	rm bin/Linux-x86-64/* || die
	rm bin/Linux-x86-64-old/* || die

	export DEST=Linux-x86-64
	./compile ${LDFLAGS} || die
}

src_install() {
	MMADIR=/usr/share/Mathematica/Applications
	dosym ${MY_P} ${MMADIR}/${MY_PN}
	dodir ${MMADIR}/${MY_P}
	insinto ${MMADIR}
	doins -r "${S}"
	# Copy executable, etc. permissions
	for f in $(find * ! -type l); do
		fperms --reference="${S}/$f" ${MMADIR}/${MY_P}/$f
	done
	# switch to system form
	dosym `command -v form` ${MMADIR}/${MY_P}/Linux-x86-64/form
	dosym `command -v form` ${MMADIR}/${MY_P}/Linux-x86-64/tform

	dodoc manual/*.pdf
}