summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-chemistry/molden/Manifest1
-rw-r--r--sci-chemistry/molden/files/molden-6.9-ldflags.patch87
-rw-r--r--sci-chemistry/molden/molden-6.9.ebuild81
3 files changed, 169 insertions, 0 deletions
diff --git a/sci-chemistry/molden/Manifest b/sci-chemistry/molden/Manifest
index 40b345e4497e..7a87ae783800 100644
--- a/sci-chemistry/molden/Manifest
+++ b/sci-chemistry/molden/Manifest
@@ -1 +1,2 @@
DIST molden5.5.tar.gz 4934764 BLAKE2B 6ce71f928ed9aacf8fe9830c4c36a675f81d63e97d08e96519ff74d172540ae0a9af25ca966d6c02cdcbbc43633a0ef80be9d31ef98a80d59a8e1a13374c2f51 SHA512 45269d2c7a52b3b2bf4fdb5f4ca3912637b3414ff9dfcd0d4f23815b3dcf7a53ffee717420d4fbf286b71c972539e756a440f5e37b7b7325ab312c25fc6c47b0
+DIST molden6.9.tar.gz 8536291 BLAKE2B f50fd9c6303d215f3b1ea73136a8ecada07102a33cfc5831c412341731d00bd166f59bc260615d4a96c59d50a6a308087f02b637f8a8d36bf19f256ac407ba72 SHA512 dbb4a602f2957d0b1d5afb8748fb8ad012a41fb0dfa816b78e4d2748ea78ee39251846a549fce4b276641d4838a336ecd9cf02b92fcf9739adeb25bb550656ec
diff --git a/sci-chemistry/molden/files/molden-6.9-ldflags.patch b/sci-chemistry/molden/files/molden-6.9-ldflags.patch
new file mode 100644
index 000000000000..9e8258aeacd7
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-6.9-ldflags.patch
@@ -0,0 +1,87 @@
+diff --git a/makefile b/makefile
+index f71a20df..564f9f4e 100644
+--- a/makefile
++++ b/makefile
+@@ -299,11 +299,11 @@ src/xwin.o: src/xwin.c src/rots.h
+ src/xwingl.o: src/xwin.c src/rots.h
+
+ molden: $(OBJS) src/mpdum.o src/xwin.o
+- $(LDR) -o molden $(OBJS) src/mpdum.o src/xwin.o $(LIBS)
++ $(LDR) $(LDFLAGS) -o molden $(OBJS) src/mpdum.o src/xwin.o $(LIBS)
+ mv molden bin/molden
+
+ gmolden: $(OBJS) src/mpdum.o src/xwingl.o
+- $(LDR) -fno-builtin -o gmolden $(OBJS) src/mpdum.o src/xwingl.o $(LIBSG)
++ $(LDR) $(LDFLAGS) -fno-builtin -o gmolden $(OBJS) src/mpdum.o src/xwingl.o $(LIBSG)
+ mv gmolden bin/gmolden
+
+ ambfor/ambfor: src/ambfor/*.f src/ambfor/*.c
+@@ -322,14 +322,14 @@ surf/surf: src/surf/*.h src/surf/*.c
+ # noxwin will not work as long as the old ocglbck calls arent in dummys
+
+ noxwin: $(OBJS) $(DOBJ) src/mpdum.o
+- $(LDR) -o molden $(OBJS) $(DOBJ) src/mpdum.o -lm
++ $(LDR) $(LDFLAGS) -o molden $(OBJS) $(DOBJ) src/mpdum.o -lm
+ mv molden bin/molden.noxwin
+
+ # This version allows the fitting of multipole moments to the electrostatic
+ # pontential
+
+ molden.mpfit: $(OBJS) src/mpolefit.o src/xwinmp.o
+- $(LDR) -o molden $(OBJS) src/mpolefit.o src/xwinmp.o $(LIBS)
++ $(LDR) $(LDFLAGS) -o molden $(OBJS) src/mpolefit.o src/xwinmp.o $(LIBS)
+ mv molden bin/molden.mpfit
+
+ src/xwinmp.o: src/xwin.c
+@@ -340,18 +340,18 @@ src/xwingl.o: src/xwin.c
+ $(CC) $(CFLAGS) -DDOGL -c src/xwin.c -o src/xwingl.o
+
+ unmullik: src/unmullik.o
+- $(LDR) -o bin/unmullik src/unmullik.o
++ $(LDR) $(LDFLAGS) -o bin/unmullik src/unmullik.o
+
+ # short_wrl removes redundant vertices from molden's VRML2 files
+ # with the courtesy of Andreas Klamt of COSMOSlogic
+ #
+ short_wrl: src/short_wrl.o
+- $(LDR) -o bin/short_wrl src/short_wrl.o
++ $(LDR) $(LDFLAGS) -o bin/short_wrl src/short_wrl.o
+
+ # conversion of CADPAC output to molden format
+
+ cad2mol: src/cad2mol.o
+- $(LDR) -o bin/cad2mol src/cad2mol.o
++ $(LDR) $(LDFLAGS) -o bin/cad2mol src/cad2mol.o
+
+ clean:
+ rm -f src/$(OBJS) src/mpdum.o src/xwin.o src/xwingl.o bin/molden bin/gmolden bin/ambfor bin/ambmd bin/surf src/ambfor/*.o src/surf/*.o
+diff --git a/src/ambfor/makefile b/src/ambfor/makefile
+index 9938527e..5de7c65e 100644
+--- a/src/ambfor/makefile
++++ b/src/ambfor/makefile
+@@ -50,10 +50,10 @@ mpi: FFLAGS = -c -g -ffast-math -funroll-loops -O3
+ mpi: ambfor.mpi ambmd.mpi
+
+ ambfor: ambfor.o qvdw.o alloc.o optimise.o lbfgs.o $(OBJS)
+- $(LDR) -o ambfor ambfor.o qvdw.o alloc.o optimise.o lbfgs.o $(OBJS) $(LIBS)
++ $(LDR) $(LDFLAGS) -o ambfor ambfor.o qvdw.o alloc.o optimise.o lbfgs.o $(OBJS) $(LIBS)
+
+ ambmd: md.o verlet.o qvdw.o allocmd.o $(OBJS)
+- $(LDR) -o ambmd md.o verlet.o qvdw.o allocmd.o $(OBJS) $(LIBS)
++ $(LDR) $(LDFLAGS) -o ambmd md.o verlet.o qvdw.o allocmd.o $(OBJS) $(LIBS)
+
+ ambfor.o: ambfor.f
+ ${FC} -c -g -ffast-math -funroll-loops -o ambfor.o ambfor.f
+diff --git a/src/surf/Makefile b/src/surf/Makefile
+index 54b7af8e..f216c9eb 100644
+--- a/src/surf/Makefile
++++ b/src/surf/Makefile
+@@ -25,7 +25,7 @@ OBJS = surf.o io.o compute.o dual.o utils.o lp.o chull.o tessel_cases.o \
+
+ # make objects
+ surf: $(OBJS) Makefile
+- $(CC) $(CFLAGS) $(OBJS) -o surf $(LINCLUDE)
++ $(CC) $(CFLAGS) $(OBJS) -o surf $(LINCLUDE) $(LDFLAGS)
+
+ lint:
+ lint $(INCLUDE) $(SRCS)
diff --git a/sci-chemistry/molden/molden-6.9.ebuild b/sci-chemistry/molden/molden-6.9.ebuild
new file mode 100644
index 000000000000..df6e76dbfe75
--- /dev/null
+++ b/sci-chemistry/molden/molden-6.9.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop fortran-2 flag-o-matic toolchain-funcs
+
+MY_P="${PN}${PV}"
+
+DESCRIPTION="Display molecular density from GAMESS-UK, GAMESS-US, GAUSSIAN and Mopac/Ampac"
+HOMEPAGE="https://www.theochem.ru.nl/molden/"
+SRC_URI="ftp://ftp.science.ru.nl/pub/Molden/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="MOLDEN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="opengl"
+
+RDEPEND="
+ x11-libs/libXmu
+ opengl? (
+ media-libs/freeglut
+ virtual/opengl
+ virtual/glu
+ )
+"
+DEPEND="${RDEPEND}
+ x11-misc/gccmakedep
+ app-editors/vim"
+ # vim provides ex, which the build system uses (surf/Makefile, at least)
+
+PATCHES=(
+ "${FILESDIR}/${P}-ldflags.patch"
+)
+
+src_prepare() {
+ default
+ sed \
+ -e 's:makedepend:gccmakedep:g' \
+ -i src/surf/Makefile || die
+ sed 's:shell g77:shell $(FC):g' -i makefile || die
+}
+
+src_compile() {
+ local args=()
+
+ # Use -mieee on alpha, according to the Makefile
+ use alpha && append-flags -mieee
+
+ # GCC 10 workaround
+ # bug #724556
+ append-fflags $(test-flags-FC -fallow-argument-mismatch)
+
+ args=(
+ CC="$(tc-getCC) ${CFLAGS}"
+ FC="$(tc-getFC)"
+ LDR="$(tc-getFC)"
+ FFLAGS="${FFLAGS}"
+ )
+
+ einfo "Building Molden..."
+ emake -j1 molden ambfor/ambfor ambfor/ambmd surf/surf "${args[@]}"
+ if use opengl ; then
+ einfo "Building Molden OpenGL helper..."
+ emake -j1 "${args[@]}" gmolden
+ fi
+}
+
+src_install() {
+ dobin bin/molden bin/ambfor bin/ambmd bin/surf
+ if use opengl; then
+ dobin bin/gmolden
+ doicon -s 64 haux/gmolden.png
+ make_desktop_entry gmolden MOLDEN gmolden
+ fi
+
+ dodoc HISTORY README REGISTER
+ cd doc || die
+ uncompress * && dodoc *
+}