1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools fortran-2 flag-o-matic toolchain-funcs
8 DESCRIPTION="Autotooled, updated version of a powerful, fast semi-empirical package"
9 HOMEPAGE="https://sourceforge.net/projects/mopac7/"
11 http://www.bioinformatics.org/ghemical/download/current/${P}.tar.gz
12 http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/dcart.f
13 http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/gmxmop.f"
15 LICENSE="public-domain"
17 KEYWORDS="amd64 ppc ~x86 ~amd64-linux"
18 IUSE="gmxmopac7 static-libs"
20 DEPEND="dev-libs/libf2c"
24 # Install the executable
26 -e "s:noinst_PROGRAMS = mopac7:bin_PROGRAMS = mopac7:g" \
28 || die "sed failed: install mopac7"
29 # Install the script to run the executable
31 -e "s:EXTRA_DIST = autogen.sh run_mopac7:bin_SCRIPTS = run_mopac7:g" \
33 || die "sed failed: install run_mopac7"
36 append-fflags -std=legacy -fno-automatic
41 if use gmxmopac7; then
42 einfo "Making mopac7 lib for gromacs"
43 mkdir "${S}"/fortran/libgmxmopac7 && cd "${S}"/fortran/libgmxmopac7
44 cp -f ../SIZES ../*.f "${FILESDIR}"/Makefile . || die
46 cp -f "${DISTDIR}"/gmxmop.f "${DISTDIR}"/dcart.f . || die
47 sed "s:GENTOOVERSION:${PV}:g" -i Makefile
49 use static-libs && emake static
54 # A correct fix would have a run_mopac7.in with @bindir@ that gets
55 # replaced by configure, and run_mopac7 added to AC_OUTPUT in configure.ac
56 sed -i "s:./fortran/mopac7:mopac7:g" run_mopac7 || die
60 if use gmxmopac7; then
61 cd "${S}"/fortran/libgmxmopac7
62 dolib.so libgmxmopac7.so*
63 use static-libs && dolib.a libgmxmopac7.a