Skip to content
Permalink
Browse files

molden: Update to 6.4-20200625124000 and build all

Now build and install all targets including gmolden, not just the molden
target.

Remove the opengl variant because the moldenogl target has been removed
from the makefile. It's still in makefile.old so it could possibly be
brought back, but moldenogl seems to be superseded by gmolden.

Closes: https://trac.macports.org/ticket/51722
  • Loading branch information
ryandesign committed Jun 29, 2020
1 parent cc7c84b commit 2a765437fbb511c7b25e93db1e3130e28fd458a4
Showing with 109 additions and 45 deletions.
  1. +32 −27 science/molden/Portfile
  2. +35 −0 science/molden/files/no-symver.patch
  3. +42 −18 science/molden/files/patch-makefile.diff
@@ -14,18 +14,19 @@ name molden
# as well as checksums should be updated each time this happens.
# See https://trac.macports.org/wiki/PortfileRecipes#stealth-updates
epoch 1
version 6.3-20200416125300
version 6.4-20200625124000
revision 0
checksums rmd160 b552f06daed151f936764ff3e4447da68cb37d46 \
sha256 01b3018942397a07ad255cf1745675fc3be52096b71dc2d8b0ce71f1af09110b \
size 6544338
checksums rmd160 749fe151625bc78d691c9e6a9abefc9e5603c86a \
sha256 36f5d653db6d5cfb01030a842289e56ffd639f919bfcb1221d9a8e85fd4c7f96 \
size 6119574

set version_number [lindex [split ${version} -] 0]
set branch [join [lrange [split ${version_number} .] 0 1] .]
categories science graphics chemistry
platforms darwin
license Restrictive Noncommercial Nomirror
maintainers {ryandesign @ryandesign} openmaintainer
homepage http://www.cmbi.ru.nl/molden/
homepage http://cheminf.cmbi.ru.nl/molden/
distname ${name}${version_number}
worksrcdir ${name}${branch}
dist_subdir ${name}/${version}
@@ -36,26 +37,38 @@ long_description Molden is a package for displaying Molecular Density from \
the Ab Initio packages GAMESS-UK, GAMESS-US and \
GAUSSIAN and the Semi-Empirical packages Mopac/Ampac, it \
also supports a number of other programs via the Molden Format. \
In order to keep up support for Molden, proof that \
\n\nIn order to keep up support for Molden, proof that \
it is being used outside the CMBI is required. \
Please register your copy of molden at: \
${homepage}form.html

notes "
In order to keep up support for Molden, proof that\
it is being used outside the CMBI is required.\
Please register your copy of molden at:\
\n\n${homepage}form.html
Please register your copy of molden at:
${homepage}form.html
"

platforms darwin
depends_build port:gmake
depends_lib port:xorg-libX11
patchfiles patch-makefile.diff
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/makefile
depends_build port:gmake \
port:makedepend

depends_lib-append port:libGLU \
port:mesa \
port:xorg-libX11 \
port:xorg-libXmu

post-extract {
# Copy "group" permission to "others", which is empty.
fs-traverse item ${worksrcpath} {
set p [file attributes ${item} -permissions]
file attributes ${item} -permissions [format {0%o} [expr {(${p} >> 3 & 7) + ${p}}]]
}
}

patchfiles patch-makefile.diff
patchfiles-append no-symver.patch

compilers.choose fc
compilers.setup require_fortran -gcc10
# This should allow gcc10 to work but the port doesn't honor MacPorts flags.
@@ -64,15 +77,16 @@ compilers.setup require_fortran -gcc10
minimum_xcodeversions {9 3.1}
use_parallel_build yes
use_configure no
build.target molden
build.cmd ${prefix}/bin/gmake
pre-build {
build.args CC=${configure.cc} \
FC=${configure.fc}
FC=${configure.fc} \
PREFIX=${prefix}
}

destroot {
xinstall -W ${worksrcpath} molden ${destroot}${prefix}/bin
destroot.args PREFIX=${prefix}

post-destroot {
set docdir ${destroot}${prefix}/share/doc/molden
xinstall -m 0755 -d ${docdir}
xinstall -W ${worksrcpath} \
@@ -84,15 +98,6 @@ destroot {
${docdir}
}

variant opengl description "Install moldenogl OpenGL helper program" {
depends_lib-append port:freeglut \
port:mesa
build.target-append moldenogl
post-destroot {
xinstall -W ${worksrcpath} moldenogl ${destroot}${prefix}/bin
}
}

livecheck.type regex
livecheck.url http://www.ryandesign.com/macports/version.php/${name}
livecheck.regex {^(.+)$}
@@ -0,0 +1,35 @@
Fix:

<inline asm>:1:1: error: unknown directive
.symver logf,logf@GLIBC_2.2.5
^
<inline asm>:2:1: error: unknown directive
.symver powf,powf@GLIBC_2.2.5
^
<inline asm>:3:1: error: unknown directive
.symver memcpy,memcpy@GLIBC_2.2.5
^
<inline asm>:4:1: error: unknown directive
.symver memmove,memmove@GLIBC_2.2.5
^

This problem has been reported to the developer by email.
--- src/xwin.c.orig 2020-06-19 07:05:40.000000000 -0500
+++ src/xwin.c 2020-06-26 11:56:48.000000000 -0500
@@ -1,16 +1,3 @@
-#if __LP64__
-# define SYMVER "GLIBC_2.2.5"
-#else
-# define SYMVER "GLIBC_2.0"
-#endif
-#define USE_OLD_SYM(F,V) __asm__(".symver " #F "," #F "@" V)
-USE_OLD_SYM(logf,SYMVER);
-USE_OLD_SYM(powf,SYMVER);
-USE_OLD_SYM(memcpy,SYMVER);
-USE_OLD_SYM(memmove,SYMVER);
-
-//__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
-//__asm__(".symver memmove,memmove@GLIBC_2.2.5");
#ifdef VMS
#include "decw$include:xlib.h"
#include "decw$include:xutil.h"
@@ -1,11 +1,14 @@
--- makefile.orig 2018-11-12 09:16:22.000000000 -0600
+++ makefile 2018-11-26 14:42:43.000000000 -0600
The lack of a PREFIX or X11 path variable, the problems with the install
target, and the duplicate lines in the Darwin section have been reported
to the developer by email.
--- makefile.orig 2020-06-19 07:14:57.000000000 -0500
+++ makefile 2020-06-29 11:07:39.000000000 -0500
@@ -16,7 +16,7 @@
CC = cc
LIBS = -lX11 -lm
LDR = ${FC}
-LIBSG = -L/usr/X11R6/lib -lGLU -lGL -lXmu -lX11 -lm
+LIBSG = -L@PREFIX@/lib -lGLU -lGL -lXmu -lX11 -lm
+LIBSG = -L$(PREFIX)/lib -lGLU -lGL -lXmu -lX11 -lm
ARCH := $(shell getconf LONG_BIT)
AFLAG= -m$(ARCH)
EXTEN=
@@ -14,29 +17,40 @@
EXTEN = exten
EXTENZ = exten2
- LIBSG = -L/usr/X11R6/lib -lGLU -lGL -lX11 -lm
+ LIBSG = -L@PREFIX@/lib -lGLU -lGL -lX11 -lm
+ LIBSG = -L$(PREFIX)/lib -lGLU -lGL -lX11 -lm
endif
ifeq ($(os), Debian)
- LIBSG = -L/usr/lib/X11 -lGLU -lGL -lX11 -lm
+ LIBSG = -L@PREFIX@/lib -lGLU -lGL -lX11 -lm
+ LIBSG = -L$(PREFIX)/lib -lGLU -lGL -lX11 -lm
endif

choosefc := 'yes'
@@ -91,25 +91,13 @@
@@ -91,36 +91,13 @@

ifeq ($(uname), Linux)
CC = gcc
-comgcc := $(shell gcc --version | grep 5.4)
-ifeq ($(comgcc), $(empty))
- comgcc := $(shell gcc --version | grep 6.)
-endif
-ifeq ($(comgcc), $(empty))
- comgcc := $(shell gcc --version | grep 7.)
-endif
-ifeq ($(comgcc), $(empty))
- comgcc := $(shell gcc --version | grep 9.)
-# EXTRAZ = -Wno-format-truncation
- EXTRAZ = -Wno-format-truncation
-endif
-ifneq ($(comgcc), $(empty))
- EXTRAZ = -Wno-implicit-function-declaration
- EXT = ${EXTRAZ}
-endif
FFLAGS = -g ${AFLAG}
-LIBS = -L/usr/X11R6/lib -lX11 -lm
+LIBS = -L@PREFIX@/lib -lX11 -lm
+LIBS = -L$(PREFIX)/lib -lX11 -lm
ifeq ($(AFLAG),"-m64")
-LIBS = -L/usr/X11R6/lib64 -lX11 -lm
+LIBS = -L@PREFIX@/lib64 -lX11 -lm
+LIBS = -L$(PREFIX)/lib64 -lX11 -lm
endif
LDR = ${FC} -g ${AFLAG}
-CFLAGS = ${AFLAG} ${EXTRAZ} -c -g -I/usr/X11R6/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0
@@ -47,38 +61,48 @@
- LIBS = -L/usr/X11R6/lib64 -lX11 -lm
- endif
- endif
+CFLAGS = ${AFLAG} ${EXTRAZ} -c -g -I@PREFIX@/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0
+CFLAGS = ${AFLAG} ${EXTRAZ} -c -g -I$(PREFIX)/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0
ifeq ($(os), FreeBSD)
CFLAGS = ${CFLAGS} -DFREEBSD
endif
@@ -120,15 +108,15 @@
@@ -131,15 +108,15 @@
# Mac OS X g77
#
CC=cc
-CFLAGS= -std=gnu89 -Wno-return-type -DDARWIN -I/usr/X11R6/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
+CFLAGS= -std=gnu89 -Wno-return-type -DDARWIN -I@PREFIX@/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
+CFLAGS= -std=gnu89 -Wno-return-type -DDARWIN -I$(PREFIX)/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
FFLAGS=-O3 -funroll-loops
-LIBS = -L/usr/X11R6/lib -lX11 -lm
-LIBSG = -L/usr/X11R6/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
+LIBS = -L@PREFIX@/lib -lX11 -lm
+LIBSG = -L@PREFIX@/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
+LIBS = -L$(PREFIX)/lib -lX11 -lm
+LIBSG = -L$(PREFIX)/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
EXT= -std=gnu89 -Wno-return-type -DDARWIN ${EXTRAZ}
FFLAGS=-O3 -funroll-loops
-LIBS = -L/usr/X11R6/lib -lX11 -lm
-LIBSG = -L/usr/X11R6/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
-CFLAGS= -g -std=gnu89 -Wno-return-type -DDARWIN -I/usr/X11R6/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
+LIBS = -L@PREFIX@/lib -lX11 -lm
+LIBSG = -L@PREFIX@/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
+CFLAGS= -g -std=gnu89 -Wno-return-type -DDARWIN -I@PREFIX@/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
+LIBS = -L$(PREFIX)/lib -lX11 -lm
+LIBSG = -L$(PREFIX)/lib -lGLU "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -lGL -lXmu -lX11 -lm
+CFLAGS= -g -std=gnu89 -Wno-return-type -DDARWIN -I$(PREFIX)/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
LDR = ${FC}
endif

@@ -259,7 +247,7 @@
@@ -270,7 +247,7 @@
# and the full opengl version of molden 'gmolden', (does not need glut)
# (make gmolden)
#
-LIBSOGL = -lglut -lGLU -lGL -lXmu -lX11 -lm
+LIBSOGL = -L@PREFIX@/lib -lglut -lGLU -lGL -lXmu -lX11 -lm
+LIBSOGL = -L$(PREFIX)/lib -lglut -lGLU -lGL -lXmu -lX11 -lm
#
# on linux :
#
@@ -363,7 +340,7 @@
endif

exten2:
- utils/register_extension.sh /usr/local/bin
+ utils/register_extension.sh $(PREFIX)/bin

install: $(EXTENZ)
- sudo install -t /usr/local/bin -m 755 bin/molden bin/gmolden bin/ambfor bin/ambmd bin/surf
+ install -m 755 bin/molden bin/gmolden bin/ambfor bin/ambmd bin/surf $(DESTDIR)$(PREFIX)/bin

0 comments on commit 2a76543

Please sign in to comment.
You can’t perform that action at this time.