git: aa24c57f08b0 - main - cad/calculix: Update to 2.22

From: Zsolt Udvari <uzsolt_at_FreeBSD.org>
Date: Tue, 22 Oct 2024 18:40:46 UTC
The branch main has been updated by uzsolt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aa24c57f08b0b831824961acf905cd54cba3ee45

commit aa24c57f08b0b831824961acf905cd54cba3ee45
Author:     rsmith <rsmith@xs4all.nl>
AuthorDate: 2024-10-22 18:35:59 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-10-22 18:40:25 +0000

    cad/calculix: Update to 2.22
    
    Use xdg-open as BROWSER instead of firefox.
    Use freeglut instead of bundled library.
    Merge two OPSYS==FreeBSD into one.
    Add LICENSE_FILE.
    Switch to DISTVERSION.
    
    PR:             282050
    Approved by:    submitter is maintainer
---
 cad/calculix/Makefile                            | 28 +++++-----
 cad/calculix/distinfo                            | 18 +++---
 cad/calculix/files/patch-cgx__2.20_src_Makefile  | 26 ---------
 cad/calculix/files/patch-cgx__2.22_src_Makefile  | 70 ++++++++++++++++++++++++
 cad/calculix/files/patch-cgx__2.22_src_extUtil.h | 11 ++++
 cad/calculix/pkg-plist                           | 23 +++++++-
 6 files changed, 124 insertions(+), 52 deletions(-)

diff --git a/cad/calculix/Makefile b/cad/calculix/Makefile
index c495307f6d95..6ae613b3d2e6 100644
--- a/cad/calculix/Makefile
+++ b/cad/calculix/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	calculix
-PORTVERSION=	2.21
+DISTVERSION=	2.22
 CATEGORIES=	cad
 MASTER_SITES=	http://www.dhondt.de/
 DISTFILES=	${DIST_SOURCES}
@@ -11,11 +11,12 @@ COMMENT=	Three-Dimensional Structural Finite Element Program
 WWW=		http://www.calculix.de/
 
 LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/cgx_${DISTVERSION}/COPYING
 
 RUN_DEPENDS=	ccx:cad/calculix-ccx
 
-USES=		gl gmake tar:bzip2 compiler:c++11-lib xorg
-USE_GL=		gl glu # uses its own glut
+USES=		compiler:c++11-lib gl gmake tar:bzip2 xorg
+USE_GL=		gl glu glut
 USE_XORG=	ice sm x11 xext xi xmu xt
 
 CXXFLAGS+=	-std=c++98
@@ -31,29 +32,25 @@ DOCS_EXTRACT_ONLY=	${DIST_HTM}
 EXAMPLES_DISTFILES=	${DIST_EXAMPLES}
 EXAMPLES_EXTRACT_ONLY=	${DIST_EXAMPLES}
 
-BROWSER?=	firefox
-CGX_VER=	cgx_${PORTVERSION}
-DIST_EXAMPLES=	cgx_${PORTVERSION}.exa${EXTRACT_SUFX}
-DIST_HTM=	cgx_${PORTVERSION}.htm${EXTRACT_SUFX}
-DIST_PDF=	cgx_${PORTVERSION}.pdf
-DIST_SOURCES=	cgx_${PORTVERSION}.all${EXTRACT_SUFX}
+BROWSER?=	xdg-open
+CGX_VER=	cgx_${DISTVERSION}
+DIST_EXAMPLES=	cgx_${DISTVERSION}.exa${EXTRACT_SUFX}
+DIST_HTM=	cgx_${DISTVERSION}.htm${EXTRACT_SUFX}
+DIST_PDF=	cgx_${DISTVERSION}.pdf
+DIST_SOURCES=	cgx_${DISTVERSION}.all${EXTRACT_SUFX}
 PSVIEWER?=	gv
 
 .include <bsd.port.options.mk>
 
 .if ${OPSYS} == FreeBSD
-USES+=	llvm:max=15
+USES+=		llvm:max=15
+CPPFLAGS+=	-Wno-error=int-conversion
 .endif
-
 CFLAGS+=	-fpic
 FFLAGS+=	-fpic
 
 .include <bsd.port.pre.mk>
 
-.if ${OPSYS} == FreeBSD
-CPPFLAGS+=	-Wno-error=int-conversion
-.endif
-
 pre-build:
 	@${REINPLACE_CMD} -e 's!c++!${CXX}!g;' \
 		${WRKSRC}/libSNL/src/makefile
@@ -74,6 +71,7 @@ do-install:
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}/cgx
+	@(cd ${WRKSRC}/${CGX_VER}/doc/cgx && ${RM} *.old *~)
 	@(cd ${WRKSRC}/${CGX_VER}/doc/cgx && ${COPYTREE_SHARE} . \
 	  ${STAGEDIR}${DOCSDIR}/cgx)
 	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${DIST_PDF} \
diff --git a/cad/calculix/distinfo b/cad/calculix/distinfo
index fc9a30014fe3..d94582b2a25a 100644
--- a/cad/calculix/distinfo
+++ b/cad/calculix/distinfo
@@ -1,9 +1,9 @@
-TIMESTAMP = 1690913771
-SHA256 (calculix/cgx_2.21.all.tar.bz2) = 55ae561903df011e944d7f82f9e00039dbc4c68ac9195a5a862d446eb56bcfc1
-SIZE (calculix/cgx_2.21.all.tar.bz2) = 5758392
-SHA256 (calculix/cgx_2.21.htm.tar.bz2) = f2c8aa71f4c81a537e7f3fffa62862b1f617d95ac31ac41a994799df7d28824f
-SIZE (calculix/cgx_2.21.htm.tar.bz2) = 384268
-SHA256 (calculix/cgx_2.21.pdf) = 0b392abde2041f7d646c668d42bf317487884fae2153145fdd7cb9ccd2496a5e
-SIZE (calculix/cgx_2.21.pdf) = 1240552
-SHA256 (calculix/cgx_2.21.exa.tar.bz2) = 0569cdeca93eab827277904519e7b5f7b04a1326e7a3a11cc148f3dde585c054
-SIZE (calculix/cgx_2.21.exa.tar.bz2) = 3917880
+TIMESTAMP = 1728732023
+SHA256 (calculix/cgx_2.22.all.tar.bz2) = c642431089560eec21b1a6a5d7f5a40bc23ea946115a296b8dd8cb8a596921d1
+SIZE (calculix/cgx_2.22.all.tar.bz2) = 6237681
+SHA256 (calculix/cgx_2.22.htm.tar.bz2) = 0728e76485d0673f0f70510238777e66c8494ad8ff85c8738af299482d4370e7
+SIZE (calculix/cgx_2.22.htm.tar.bz2) = 598391
+SHA256 (calculix/cgx_2.22.pdf) = da65269671b12174b3c6f0d53840c4d966e6e11a99549e0d8941e051835ac838
+SIZE (calculix/cgx_2.22.pdf) = 1295175
+SHA256 (calculix/cgx_2.22.exa.tar.bz2) = 4f01decc07c94c639f2b1369a44cbee154622e742a3decdf240dddfe4d15538c
+SIZE (calculix/cgx_2.22.exa.tar.bz2) = 7920521
diff --git a/cad/calculix/files/patch-cgx__2.20_src_Makefile b/cad/calculix/files/patch-cgx__2.20_src_Makefile
deleted file mode 100644
index a27e25b9828b..000000000000
--- a/cad/calculix/files/patch-cgx__2.20_src_Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
---- cgx_2.21/src/Makefile.orig	2022-07-29 09:41:00 UTC
-+++ cgx_2.21/src/Makefile
-@@ -5,11 +5,11 @@ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I/usr/include/GL \
-   -I../../libSNL/src \
-   -I../../glut-3.5/src \
--  -I/usr/X11/include 
-+  -I$(LOCALBASE)/include 
- 
- LFLAGS = \
--  -L/usr/lib64 -lGL -lGLU \
--  -L/usr/X11R6/lib64 -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
-+  -L$(LOCALBASE)/lib -lGL -lGLU \
-+  -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
-   -lm -lpthread -lrt
- 
- 
-@@ -67,7 +67,7 @@ OULIB = $(ULIB:.c=.o)
- OUTIL = $(SUTIL:.c=.o)
- 
- cgx: $(OLIB) $(OUTIL) $(OULIB)
--	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
- 
- 
- 
diff --git a/cad/calculix/files/patch-cgx__2.22_src_Makefile b/cad/calculix/files/patch-cgx__2.22_src_Makefile
new file mode 100644
index 000000000000..36b87e97368f
--- /dev/null
+++ b/cad/calculix/files/patch-cgx__2.22_src_Makefile
@@ -0,0 +1,70 @@
+--- cgx_2.22/src/Makefile.orig	2024-05-29 18:48:12 UTC
++++ cgx_2.22/src/Makefile
+@@ -4,12 +4,12 @@ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I/usr/include \
+   -I/usr/include/GL \
+   -I../../libSNL/src \
+-  -I../../glut-3.5/src \
+-  -I/usr/X11/include 
++  -I$(LOCALBASE)/include \
++  -I$(LOCALBASE)/include/GL 
+ 
+ LFLAGS = \
+-  -L/usr/lib64 -lGL -lGLU \
+-  -L/usr/X11R6/lib64 -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
++  -L$(LOCALBASE)/lib -lGL -lGLU -lglut \
++  -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
+   -lm -lpthread -lrt
+ 
+ 
+@@ -23,41 +23,6 @@ SUTIL = \
+  userFunction.c
+ 
+ SUTIL = \
+- ../../glut-3.5/src/layerutil.c \
+- ../../glut-3.5/src/glut_dials.c \
+- ../../glut-3.5/src/glut_ext.c \
+- ../../glut-3.5/src/glut_mesa.c \
+- ../../glut-3.5/src/glut_menu.c \
+- ../../glut-3.5/src/glut_modifier.c \
+- ../../glut-3.5/src/glut_space.c \
+- ../../glut-3.5/src/glut_shapes.c \
+- ../../glut-3.5/src/glut_tablet.c \
+- ../../glut-3.5/src/glut_warp.c \
+- ../../glut-3.5/src/glut_8x13.c \
+- ../../glut-3.5/src/glut_9x15.c \
+- ../../glut-3.5/src/glut_hel10.c \
+- ../../glut-3.5/src/glut_hel18.c \
+- ../../glut-3.5/src/glut_hel12.c \
+- ../../glut-3.5/src/glut_tr10.c \
+- ../../glut-3.5/src/glut_tr24.c \
+- ../../glut-3.5/src/glut_bitmap.c \
+- ../../glut-3.5/src/glut_cursor.c \
+- ../../glut-3.5/src/glut_event.c \
+- ../../glut-3.5/src/glut_get.c \
+- ../../glut-3.5/src/glut_overlay.c \
+- ../../glut-3.5/src/glut_input.c \
+- ../../glut-3.5/src/glut_stroke.c \
+- ../../glut-3.5/src/glut_teapot.c \
+- ../../glut-3.5/src/glut_winmisc.c \
+- ../../glut-3.5/src/glut_fullscrn.c \
+- ../../glut-3.5/src/glut_cindex.c \
+- ../../glut-3.5/src/glut_roman.c \
+- ../../glut-3.5/src/glut_mroman.c \
+- ../../glut-3.5/src/glut_swidth.c \
+- ../../glut-3.5/src/glut_bwidth.c \
+- ../../glut-3.5/src/glut_win.c \
+- ../../glut-3.5/src/glut_init.c \
+- ../../glut-3.5/src/glut_util.c \
+  uselibSNL.cpp \
+  generateTet.cpp \
+  ../../libSNL/src/*.cpp
+@@ -67,7 +32,7 @@ cgx: $(OLIB) $(OUTIL) $(OULIB)
+ OUTIL = $(SUTIL:.c=.o)
+ 
+ cgx: $(OLIB) $(OUTIL) $(OULIB)
+-	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
+ 
+ 
+ 
diff --git a/cad/calculix/files/patch-cgx__2.22_src_extUtil.h b/cad/calculix/files/patch-cgx__2.22_src_extUtil.h
new file mode 100644
index 000000000000..8c25583549d3
--- /dev/null
+++ b/cad/calculix/files/patch-cgx__2.22_src_extUtil.h
@@ -0,0 +1,11 @@
+--- cgx_2.22/src/extUtil.h.orig	2024-10-21 22:22:47 UTC
++++ cgx_2.22/src/extUtil.h
+@@ -37,7 +37,7 @@ void printf_fflush(const char *fmt,...);
+ }
+   #endif
+ #else
+-  #include <GL/glut_cgx.h>
++  #include <GL/glut.h>
+ #endif
+ 
+ #define     PI          3.14159265358979323846264338327950288
diff --git a/cad/calculix/pkg-plist b/cad/calculix/pkg-plist
index b5a6fa164a37..cc9ad1a156b2 100644
--- a/cad/calculix/pkg-plist
+++ b/cad/calculix/pkg-plist
@@ -1,10 +1,12 @@
 bin/cgx
-%%PORTDOCS%%%%DOCSDIR%%/cgx/WARNINGS
+%%PORTDOCS%%%%DOCSDIR%%/cgx_2.22.pdf
 %%PORTDOCS%%%%DOCSDIR%%/cgx/cgx.css
 %%PORTDOCS%%%%DOCSDIR%%/cgx/cgx.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/contents.png
 %%PORTDOCS%%%%DOCSDIR%%/cgx/images.aux
 %%PORTDOCS%%%%DOCSDIR%%/cgx/images.log
 %%PORTDOCS%%%%DOCSDIR%%/cgx/images.out
+%%PORTDOCS%%%%DOCSDIR%%/cgx/images.pdf
 %%PORTDOCS%%%%DOCSDIR%%/cgx/images.pl
 %%PORTDOCS%%%%DOCSDIR%%/cgx/images.tex
 %%PORTDOCS%%%%DOCSDIR%%/cgx/img1.png
@@ -52,6 +54,8 @@ bin/cgx
 %%PORTDOCS%%%%DOCSDIR%%/cgx/index.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/internals.pl
 %%PORTDOCS%%%%DOCSDIR%%/cgx/labels.pl
+%%PORTDOCS%%%%DOCSDIR%%/cgx/next.png
+%%PORTDOCS%%%%DOCSDIR%%/cgx/next_g.png
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node1.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node10.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node100.html
@@ -249,7 +253,13 @@ bin/cgx
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node274.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node275.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node276.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node277.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node278.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node279.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node28.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node280.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node281.html
+%%PORTDOCS%%%%DOCSDIR%%/cgx/node282.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node29.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node3.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node30.html
@@ -328,7 +338,11 @@ bin/cgx
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node97.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node98.html
 %%PORTDOCS%%%%DOCSDIR%%/cgx/node99.html
-%%PORTDOCS%%%%DOCSDIR%%/cgx_2.21.pdf
+%%PORTDOCS%%%%DOCSDIR%%/cgx/prev_g.png
+%%PORTDOCS%%%%DOCSDIR%%/cgx/prev.png
+%%PORTDOCS%%%%DOCSDIR%%/cgx/up_g.png
+%%PORTDOCS%%%%DOCSDIR%%/cgx/up.png
+%%PORTDOCS%%%%DOCSDIR%%/cgx/WARNINGS
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/OpenFOAM/README
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/OpenFOAM/couette/0.00100001/T
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/OpenFOAM/couette/0.00100001/U
@@ -381,6 +395,11 @@ bin/cgx
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/duns.fbl
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/duns.hdr
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/duns.trl
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/save.g
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/save.q
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/save.rstrt
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/save.tec
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/duns/save.v
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/airfoil/rae2822.fbd
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/basic/cylinder.fbd
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/basic/disc.fbd