Skip to content

Commit

Permalink
biology/molden: Unbreak build; Correct WWW
Browse files Browse the repository at this point in the history
For unbreak:
- pass FFLAGS to the build
- fix several errors in C
- remove the failing 'ex' command from makefile

Reported by:	fallout
Approved by:	portmgr (unbreak)

(cherry picked from commit 328d02d)
  • Loading branch information
yurivict committed Jul 19, 2022
1 parent 961e546 commit ad478ae
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1 deletion.
41 changes: 41 additions & 0 deletions biology/molden/files/patch-makefile
@@ -0,0 +1,41 @@
- pass supplied FFLAGS to the build

--- makefile.orig 2021-01-28 14:05:10 UTC
+++ makefile
@@ -107,7 +107,7 @@ ifneq ($(comgcc), $(empty))
EXTRAZ = -Wno-implicit-function-declaration
EXT = ${EXTRAZ}
endif
-FFLAGS = -g ${AFLAG}
+FFLAGS += -g ${AFLAG}
LIBS = -L/usr/X11R6/lib -lX11 -lm
ifeq ($(AFLAG),"-m64")
LIBS = -L/usr/X11R6/lib64 -lX11 -lm
@@ -132,11 +132,11 @@ ifeq ($(uname), Darwin)
#
CC=cc
CFLAGS= -std=gnu89 -Wno-return-type -DDARWIN -I/usr/X11R6/include -DDOBACK -DHASTIMER -DCOLOR_OFFSET=0.0 -Wno-logical-op-parentheses
-FFLAGS=-O3 -funroll-loops
+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
EXT= -std=gnu89 -Wno-return-type -DDARWIN ${EXTRAZ}
-FFLAGS=-O3 -funroll-loops
+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 -Wno-implicit-function-declaration -Wno-tautological-pointer-compare -Wno-tautological-constant-out-of-range-compare
@@ -306,11 +306,11 @@ gmolden: $(OBJS) src/mpdum.o src/xwingl.o
mv gmolden bin/gmolden

ambfor/ambfor: src/ambfor/*.f src/ambfor/*.c
- $(MAKE) -C src/ambfor FC=${FC} LDR="${LDR}" EXT="${EXT}"
+ $(MAKE) -C src/ambfor FC=${FC} LDR="${LDR}" EXT="${EXT}" FFLAGS="$(FFLAGS)"
mv src/ambfor/ambfor bin/ambfor

ambfor/ambmd: src/ambfor/*.f src/ambfor/*.c
- $(MAKE) -C src/ambfor ambmd FC=${FC} LDR="${LDR}" EXT="${EXT}"
+ $(MAKE) -C src/ambfor ambmd FC=${FC} LDR="${LDR}" EXT="${EXT}" FFLAGS="$(FFLAGS)" FFLAGS="$(FFLAGS)"
mv src/ambfor/ambmd bin/ambmd

surf/surf: src/surf/*.h src/surf/*.c
13 changes: 13 additions & 0 deletions biology/molden/files/patch-src_surf_Makefile
@@ -0,0 +1,13 @@
- disable ex: it breaks the build, not sure why is it there

--- src/surf/Makefile.orig 2022-07-15 23:19:54 UTC
+++ src/surf/Makefile
@@ -58,7 +58,7 @@ depend: $(DEPEND)
@ echo '$$r makedep' >>eddep
@ echo 'w' >>eddep
@ cp Makefile Makefile.bak
- @ ex - Makefile < eddep
+ #@ ex - Makefile < eddep
@ rm eddep makedep
@ echo ' ' >> Makefile
@ echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
21 changes: 21 additions & 0 deletions biology/molden/files/patch-src_surf_utils.c
@@ -0,0 +1,21 @@
- fix return statements in the function the returns int

--- src/surf/utils.c.orig 2022-07-15 23:20:39 UTC
+++ src/surf/utils.c
@@ -91,7 +91,7 @@ float radius;
disc = radius*radius - DOTPROD3(EO, EO);
if (FP_EQ_EPS(disc, 0, GP_EPS*GP_EPS))
{ VEC3_ASN_OP(int_point, =, ray_pt);
- return;
+ return -1;
}

one_by_sq_dir_mag = 1.0/DOTPROD3(ray_dir, ray_dir);
@@ -107,6 +107,7 @@ float radius;
{ t = v*one_by_sq_dir_mag - sqrt(disc*one_by_sq_dir_mag);
VEC3_V_OP_V_OP_S(int_point, ray_pt, +, ray_dir, *, t);
}
+ return -1;
}

/*----------------------------------------------------------------------------------
10 changes: 10 additions & 0 deletions biology/molden/files/patch-src_xwin.c
@@ -0,0 +1,10 @@
- disable GLIBC symbols specific to linux

--- src/xwin.c.orig 2022-07-15 23:09:11 UTC
+++ src/xwin.c
@@ -1,4 +1,4 @@
-#ifndef DARWIN
+#if !defined(DARWIN) && !defined(__FreeBSD__)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
__asm__(".symver memmove,memmove@GLIBC_2.2.5");
__asm__(".symver log,log@GLIBC_2.2.5");
2 changes: 1 addition & 1 deletion biology/molden/pkg-descr
Expand Up @@ -21,4 +21,4 @@ optimisation jobs. Molden has a powerful Z-matrix editor which give full control
over the geometry and allows you to build molecules from scratch, including
polypeptides.

WWW: http://cheminf.cmbi.ru.nl/molden/
WWW: https://www.theochem.ru.nl/molden/

0 comments on commit ad478ae

Please sign in to comment.