Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] CalculiX-2.20
@ 2022-10-16 10:05 Phicem
  2022-10-16 10:21 ` [PR REVIEW] CalculiX-2.20 classabbyamp
                   ` (103 more replies)
  0 siblings, 104 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 10:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1807 bytes --]

There is a new pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations).

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to i686: **OK**
- Cross-compiling to *-musl: **FAILED** (package building has been disabled for musl architectures in the template file of this PR, until someone is able to test building on native musl architecture)
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so it's probably not a big issue)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 8423 bytes --]

From 5fa72d179479bac45b4054f7d2d627eda1d7f68d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 11:14:40 +0200
Subject: [PATCH 1/5] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..c38940c96a02
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,26 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+wrksrc="${pkgname}-${version}"
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+ 		vmkdir ${HEADERS_DIR}/${dir}
+ 		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+ 	done
+
+}

From 4cd7f52d0e5186a2937f746a8372a3543e4ac8e0 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 11:14:55 +0200
Subject: [PATCH 2/5] CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 36 +++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..e3c485f85298
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,36 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+archs=~"*-musl"
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 8a42d9c6739ccd880c1fe221b63eb784846395c8 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 11:15:07 +0200
Subject: [PATCH 3/5] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..6dddf28d446e
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,25 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From aaacc09a04aee53b632b9412b709c17b4bd3ade5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 11:15:26 +0200
Subject: [PATCH 4/5] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 28 +++++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..771210a04545
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,28 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+archs=~"*-musl"
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From e4342c2dc5bdc8c947815f4a4575f0016fe37de9 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 11:15:33 +0200
Subject: [PATCH 5/5] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
  2022-10-16 10:21 ` [PR REVIEW] CalculiX-2.20 classabbyamp
@ 2022-10-16 10:21 ` classabbyamp
  2022-10-16 11:22 ` Phicem
                   ` (101 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-16 10:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996421794

Comment:
this should probably be a subpackage of cgx

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
@ 2022-10-16 10:21 ` classabbyamp
  2022-10-16 10:21 ` classabbyamp
                   ` (102 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-16 10:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996421636

Comment:
why no musl? (here and cgx) 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
  2022-10-16 10:21 ` [PR REVIEW] CalculiX-2.20 classabbyamp
  2022-10-16 10:21 ` classabbyamp
@ 2022-10-16 11:22 ` Phicem
  2022-10-16 11:23 ` paper42
                   ` (100 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 11:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996429086

Comment:
Cross-compiling from x86_64 to x86_64-musl failed. Since I could not test this on native x86_64-musl, I don't know if this package works on musl systems.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (2 preceding siblings ...)
  2022-10-16 11:22 ` Phicem
@ 2022-10-16 11:23 ` paper42
  2022-10-16 11:23 ` paper42
                   ` (99 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: paper42 @ 2022-10-16 11:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996429186

Comment:
x86_64-musl is not cross compiled, create a musl masterdir instead

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (3 preceding siblings ...)
  2022-10-16 11:23 ` paper42
@ 2022-10-16 11:23 ` paper42
  2022-10-16 11:37 ` Phicem
                   ` (98 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: paper42 @ 2022-10-16 11:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996429186

Comment:
x86_64-musl is not cross compiled, create a musl masterdir instead: https://github.com/void-linux/void-packages#building-packages-natively-for-the-musl-c-library

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (4 preceding siblings ...)
  2022-10-16 11:23 ` paper42
@ 2022-10-16 11:37 ` Phicem
  2022-10-16 11:46 ` Phicem
                   ` (97 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 11:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996430789

Comment:
Oops I missed that part of the manual, thank you very much. It seems to work! I will update the package.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (5 preceding siblings ...)
  2022-10-16 11:37 ` Phicem
@ 2022-10-16 11:46 ` Phicem
  2022-10-16 18:27 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
                   ` (96 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 11:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996431780

Comment:
Tetgen is actually a separate program, with different authors. It is distributed by tetgen website, but it is necessary to provide an email address before getting the download link. Tetgen is also distributed by CalculiX authors, this time with no email constraint. This is why I picked CalculiX website as the tetgen source.
What do you mean by "subpackage"? Should I call the tetgen package 'CalculiX-tetgen' ?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (6 preceding siblings ...)
  2022-10-16 11:46 ` Phicem
@ 2022-10-16 18:27 ` Phicem
  2022-10-16 18:30 ` [PR REVIEW] CalculiX-2.20 Phicem
                   ` (95 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 18:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to i686: **OK**
- Cross-compiling to *-musl: **FAILED** (package building has been disabled for musl architectures in the template file of this PR, until someone is able to test building on native musl architecture)
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so it's probably not a big issue)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 8384 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/5] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/5] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 6392ceff2b45f271a42a9e8ebd6181e4eac092a0 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/5] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..8d2789763d28
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+make_check="no"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From 5e442beefad380ffad449c1d141e9b643e329a3a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/5] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From de77e2ea98b447466cfa554a14c7c6de4c939f74 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/5] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (7 preceding siblings ...)
  2022-10-16 18:27 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
@ 2022-10-16 18:30 ` Phicem
  2022-10-16 18:33 ` CalculiX-2.20 Phicem
                   ` (94 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 18:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r996477164

Comment:
PR updated, I removed the "archs" line.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (8 preceding siblings ...)
  2022-10-16 18:30 ` [PR REVIEW] CalculiX-2.20 Phicem
@ 2022-10-16 18:33 ` Phicem
  2022-10-16 19:38 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
                   ` (93 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 18:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1280027210

Comment:
Changes:
- Removed the musl restriction
- Fixed xlint warnings
- Disabled tests for tetgen (because no tests are provided)

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (9 preceding siblings ...)
  2022-10-16 18:33 ` CalculiX-2.20 Phicem
@ 2022-10-16 19:38 ` Phicem
  2022-10-16 19:40 ` CalculiX-2.20 Phicem
                   ` (92 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 19:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so it's probably not a big issue)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 8404 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/5] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/5] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/5] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/5] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/5] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (10 preceding siblings ...)
  2022-10-16 19:38 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
@ 2022-10-16 19:40 ` Phicem
  2022-10-16 20:41 ` CalculiX-2.20 Phicem
                   ` (91 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 19:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1280040388

Comment:
Changes:
- Fixed residual xlint warnings on tetgen

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (11 preceding siblings ...)
  2022-10-16 19:40 ` CalculiX-2.20 Phicem
@ 2022-10-16 20:41 ` Phicem
  2022-10-17 23:56 ` [PR REVIEW] CalculiX-2.20 classabbyamp
                   ` (90 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-16 20:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1280040388

Comment:
Changes:
- Fixed residual xlint warnings on tetgen

Cross-compiling to armv7l from x86_64 still doesn't work. The error is:
```
/usr/include/math.h:462:21: error: '_Float128' is not supported on this target
 462 | # define _Mdouble_  _Float128
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (23 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (78 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997532520

Comment:
```suggestion
build_style=cmake
```
the cmake files provided are a bit better than the makefile

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (27 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (74 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997576559

Comment:
```suggestion
short_desc="3D Structural Finite Element Program - Solver"
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (25 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (76 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997577925

Comment:
```suggestion
hostmakedepends="gcc-fortran"
```
perl script is unnecessary, we'll do it manually in a better way

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (31 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (70 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997525714

Comment:
```suggestion
```
we can use bsdtar instead, which is already installed in the masterdir

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (22 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (79 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997532698

Comment:
```suggestion
revision=1
wrksrc="${pkgname}${version}"
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (15 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (86 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997577536

Comment:
```suggestion
```

out of order and unnecessary

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (13 preceding siblings ...)
  2022-10-17 23:56 ` [PR REVIEW] CalculiX-2.20 classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (88 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997526786

Comment:
does this require `ccx` to function? if so, it should just depend on it instead of the metapackage

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (16 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (85 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997535270

Comment:
```suggestion
	vbin build/tetgen
	vinstall build/libtet.a 644 usr/lib
	vlicense LICENSE
```
unfortunately, the cmake files don't define an install phase, so we have to override `do_install`

most build phases run in `$wrksrc` so we can simplify

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (14 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (87 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997533534

Comment:
```suggestion
post_extract() {
	cd $XBPS_BUILDDIR
	bsdtar -xvf ${pkgname}${version}.tar
	rm -rf CalculiX
	rm ${pkgname}${version}.tar
```
overriding `do_extract` should be a last resort, and this is a bit cleaner anyways

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (33 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (68 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997577392

Comment:
```suggestion
build_wrksrc="ccx_${version}/src"
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (26 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (75 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997532188

Comment:
```suggestion
distfiles="http://www.dhondt.de/cgx_${_cgx_ver}.all.tar.bz2"
```
and add `_cgx_ver=2.20` after `revision`

you may also want to note in a comment at the top that this needs to be synchronised with `cgx` (because same distfile)

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (18 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (83 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997548710

Comment:
```suggestion
	vinstall spooles.a 644 usr/lib
	for file in *.h; do
		vinstall ${file} 644 usr/include/$pkgname
	done
	for file in */*.h; do
		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
	done
```
I guess they both work, but I think this feels better idk

also the lib should be installed

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (12 preceding siblings ...)
  2022-10-16 20:41 ` CalculiX-2.20 Phicem
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (89 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997578347

Comment:
```suggestion
```
partially unnecessary and it should be put later


^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (30 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (71 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997579349

Comment:
```suggestion

FFLAGS="-fallow-argument-mismatch"
CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
```
`xbps-src` integrates the CFLAGS/FFLAGS specified at the top level of the template into its own, and then exposes that to the packaging phases, so we can trim this down

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (24 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (77 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997580544

Comment:
```suggestion
	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
```
no need for all the special handling you were doing, `xbps-src` provides those proper values for you

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (21 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (80 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997580278

Comment:
```suggestion

post_patch() {
	vsed -e 's,./date.pl; ,,' -i Makefile
	# taken from date.pl, changed for reproducibility
	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
		-i ccx_$version.c -i CalculiXstep.c
	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
		-i frd.c
}

```
instead of `date.pl` (which is broken, there's an incorrect filename), we can do the same thing manually, and at the time use a more reproducible method of getting the date.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (28 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (73 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997578559

Comment:
```suggestion
```
this should not need to be specified, [i686 is built natively](https://github.com/void-linux/void-packages#building-32bit), not on cross. it's also out of order

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (19 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (82 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997597595

Comment:
```suggestion
```
I ended up overriding all the useful parts of the build style so I don't think it's needed

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (32 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (69 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997597992

Comment:
```suggestion
```
not needed

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (29 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (72 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997594041

Comment:
I don't think this file is necessary. having the licences installed should be enough

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (17 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (84 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997596042

Comment:
```suggestion
create_wrksrc=yes
build_wrksrc="CalculiX/cgx_${version}/src"
```
this ensures there's nothing left in the builddir on clean

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (20 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (81 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997580608

Comment:
```suggestion
	vbin ccx_${version} ccx
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (39 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-18  2:34 ` ahesford
                   ` (62 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997596426

Comment:
```suggestion
--- a/CalculiX/cgx_2.20/src/Makefile
+++ b/CalculiX/cgx_2.20/src/Makefile
@@ -67,7 +67,7 @@
 OUTIL = $(SUTIL:.c=.o)
 
 cgx: $(OLIB) $(OUTIL) $(OULIB)
-	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
+	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
 
 
 

```
only this much of the patch should be needed

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (37 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (64 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997598298

Comment:
the glut licence's status as free software is dubious. maybe this should be `repository=nonfree`, not sure

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (34 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (67 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997599203

Comment:
```suggestion

do_build() {
	make CC=$CC CXX=$CXX CFLAGS="$CFLAGS"
}

```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (36 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (65 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997524668

Comment:
in that case it's probably better to keep it separate

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (38 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (63 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997598708

Comment:
```suggestion
CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
```
only need to include the special cflags

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (35 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-17 23:56 ` classabbyamp
  2022-10-17 23:56 ` classabbyamp
                   ` (66 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-17 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997599403

Comment:
```suggestion
	vbin cgx
	vlicense ../README CGX_LICENSE
	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
```

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (41 preceding siblings ...)
  2022-10-18  2:34 ` ahesford
@ 2022-10-18  2:34 ` ahesford
  2022-10-18  6:38 ` 0x5c
                   ` (60 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: ahesford @ 2022-10-18  2:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997658455

Comment:
This package should be called `spooles`.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (40 preceding siblings ...)
  2022-10-17 23:56 ` classabbyamp
@ 2022-10-18  2:34 ` ahesford
  2022-10-18  2:34 ` ahesford
                   ` (61 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: ahesford @ 2022-10-18  2:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997661074

Comment:
Yeah, we don't play this game with Void packages.

You get the tarball from the proper upstream source, unless it is explicitly vendored into the rest of CalculiX, in which case it wouldn't be a separate package at all.

If this is difficult or impossible, it militates strongly against packaging, not grabbing upstream distfiles from some other distributor.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (42 preceding siblings ...)
  2022-10-18  2:34 ` ahesford
@ 2022-10-18  6:38 ` 0x5c
  2022-10-18  6:42 ` classabbyamp
                   ` (59 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: 0x5c @ 2022-10-18  6:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997774428

Comment:
Reading the GLUT licence, it seems to me that it's essentially a MIT-like permissive licence

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (43 preceding siblings ...)
  2022-10-18  6:38 ` 0x5c
@ 2022-10-18  6:42 ` classabbyamp
  2022-10-22  7:49 ` CalculiX-2.20 Phicem
                   ` (58 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-18  6:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r997777627

Comment:
ok that seems right to me

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (44 preceding siblings ...)
  2022-10-18  6:42 ` classabbyamp
@ 2022-10-22  7:49 ` Phicem
  2022-10-22  8:07 ` [PR REVIEW] [WIP] CalculiX-2.20 Phicem
                   ` (57 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  7:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1287667976

Comment:
Thank you for all your comments! I marked the PR as draft until I test all these modifications.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (45 preceding siblings ...)
  2022-10-22  7:49 ` CalculiX-2.20 Phicem
@ 2022-10-22  8:07 ` Phicem
  2022-10-22  8:10 ` Phicem
                   ` (56 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  8:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002404973

Comment:
Tetgen is indeed officially vendored along with CalculiX (more precisely with the cgx part). It is explicitely written in the documentation.

Initially I wanted to put tetgen a separate package in case someone wants to use tetgen without installing CalculiX-cgx. But it is probably a rare use-case, and Calculix-cgx package is not that huge (15 MB).

If that sounds good to you, I will include tetgen binary directly into CalculiX-cgx package.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (46 preceding siblings ...)
  2022-10-22  8:07 ` [PR REVIEW] [WIP] CalculiX-2.20 Phicem
@ 2022-10-22  8:10 ` Phicem
  2022-10-22  8:48 ` Phicem
                   ` (55 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  8:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002405222

Comment:
No, cgx can be used without ccx (and ccx can be used without cgx as well).

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (47 preceding siblings ...)
  2022-10-22  8:10 ` Phicem
@ 2022-10-22  8:48 ` Phicem
  2022-10-22  8:50 ` [PR PATCH] [Updated] " Phicem
                   ` (54 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  8:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002414642

Comment:
However if I do that (including tetgen binary directly into CalculiX-cgx package), I'm afraid I will have to define a custom do_build() function, since there are two independant makefile/cmake files. I could patch cgx makefile so that it calls tetgen makefile, but I don't find this very elegant.

An alternative is to keep tetgen in a separate sub-package called CalculiX-tetgen, using the tetgen version vendored by CalculiX.

In short, the solutions I see are:
1. single package with a custom do_build() function
2. single package with a patch on the makefile
3. keeping a separate subpackage called Calculix-tetgen

I don't know which one is the cleanest option. What do you think?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (48 preceding siblings ...)
  2022-10-22  8:48 ` Phicem
@ 2022-10-22  8:50 ` Phicem
  2022-10-22  9:03 ` [PR REVIEW] " Phicem
                   ` (53 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  8:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 9370 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/6] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/6] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/6] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/6] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/6] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 6/6] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (49 preceding siblings ...)
  2022-10-22  8:50 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-22  9:03 ` Phicem
  2022-10-22 11:55 ` 0x5c
                   ` (52 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22  9:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002420106

Comment:
I too find the uppercase name ugly, but the vendor uses uppercase letters when they speak about their software. The folder name after tgz extraction is also uppercase. So I followed the xbps-src manual recommandation ("As a rule of thumb, if the tar.gz of a package contains uppercase letter, then the package name should contain them too").

I think the reason why the name is uppercase is that the library name is an acronym (for "SParse Object Oriented Linear Equations Solver").

So in my opinion the package name should be kept uppercase. Do you agree?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (50 preceding siblings ...)
  2022-10-22  9:03 ` [PR REVIEW] " Phicem
@ 2022-10-22 11:55 ` 0x5c
  2022-10-22 11:55 ` 0x5c
                   ` (51 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: 0x5c @ 2022-10-22 11:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002453138

Comment:
If you need to give your email to access the download, it sounds likely to me that the licence might also be a problem in itself 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (51 preceding siblings ...)
  2022-10-22 11:55 ` 0x5c
@ 2022-10-22 11:55 ` 0x5c
  2022-10-22 19:17 ` Phicem
                   ` (50 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: 0x5c @ 2022-10-22 11:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002453138

Comment:
If you need to give your email to access the download, it sounds likely to me that the licence might also be a problem in itself
What is that licence? 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (52 preceding siblings ...)
  2022-10-22 11:55 ` 0x5c
@ 2022-10-22 19:17 ` Phicem
  2022-10-23  7:11 ` 0x5c
                   ` (49 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-22 19:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002562369

Comment:
The authors say that tetgen is distributed "as Free Software under the [GNU Affero Public License v. 3.0](http://www.gnu.org/licenses/agpl-3.0.html)". But they also sell a commercial license for those who need it.

The GNU Affero Public License v. 3.0 says that "You are not required to accept this License in order to receive or run a copy of the Program", which is contradictory with the fact that they ask the user to give an email address and accept the license before getting the download link. So my understanding is that they don't really respect the license themselves (but I guess this is not a problem since they are the authors).

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (53 preceding siblings ...)
  2022-10-22 19:17 ` Phicem
@ 2022-10-23  7:11 ` 0x5c
  2022-10-23  9:35 ` Phicem
                   ` (48 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: 0x5c @ 2022-10-23  7:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002653255

Comment:
Yeah it's not a problem for them if they are the copyright holders of 100% of the code (and I assume they are, in order to dual-licence).

Anyway it's some form of GPL so my potential concerns about the licence are addressed 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (54 preceding siblings ...)
  2022-10-23  7:11 ` 0x5c
@ 2022-10-23  9:35 ` Phicem
  2022-10-23  9:35 ` [PR PATCH] [Updated] " Phicem
                   ` (47 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23  9:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002676787

Comment:
I added these lines during my attempts to cross-compile to armv7l (from an x86_64 machine). Without them, I get a compiler error about a missing header:
`fatal error: gnu/stubs-32.h: No such file or directory`

Adding glibc-devel-32bit fixes this issue, but is not enough to make compilation work, because then there is another error:
`/usr/include/math.h:462:21: error: '_Float128' is not supported on this target`

Since cross-compilation does not work, I guess you're right and these lines are not needed.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (55 preceding siblings ...)
  2022-10-23  9:35 ` Phicem
@ 2022-10-23  9:35 ` Phicem
  2022-10-23  9:59 ` [PR REVIEW] " Phicem
                   ` (46 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23  9:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 10422 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/7] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/7] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/7] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/7] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/7] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 6/7] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 7/7] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (56 preceding siblings ...)
  2022-10-23  9:35 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-23  9:59 ` Phicem
  2022-10-23 10:00 ` [PR PATCH] [Updated] " Phicem
                   ` (45 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23  9:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002680326

Comment:
Yes it's much better.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (57 preceding siblings ...)
  2022-10-23  9:59 ` [PR REVIEW] " Phicem
@ 2022-10-23 10:00 ` Phicem
  2022-10-23 10:00 ` Phicem
                   ` (44 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 10:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 11485 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/8] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/8] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/8] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/8] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/8] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 6/8] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 7/8] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 8/8] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (58 preceding siblings ...)
  2022-10-23 10:00 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-23 10:00 ` Phicem
  2022-10-23 11:20 ` Phicem
                   ` (43 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 10:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 12297 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/9] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 2/9] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 3/9] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 4/9] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 5/9] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 6/9] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 7/9] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 8/9] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 9/9] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (59 preceding siblings ...)
  2022-10-23 10:00 ` Phicem
@ 2022-10-23 11:20 ` Phicem
  2022-10-23 11:39 ` Phicem
                   ` (42 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 11:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 13430 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/10] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/10] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/10] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/10] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/10] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/10] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/10] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/10] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/10] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/10] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (60 preceding siblings ...)
  2022-10-23 11:20 ` Phicem
@ 2022-10-23 11:39 ` Phicem
  2022-10-23 11:42 ` Phicem
                   ` (41 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 11:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 14655 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/11] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/11] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/11] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/11] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/11] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/11] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/11] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/11] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/11] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/11] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/11] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (61 preceding siblings ...)
  2022-10-23 11:39 ` Phicem
@ 2022-10-23 11:42 ` Phicem
  2022-10-23 13:14 ` [PR REVIEW] " ahesford
                   ` (40 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 11:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 15682 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/12] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/12] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/12] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/12] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/12] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/12] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/12] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/12] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/12] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/12] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/12] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/12] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (62 preceding siblings ...)
  2022-10-23 11:42 ` Phicem
@ 2022-10-23 13:14 ` ahesford
  2022-10-23 13:15 ` ahesford
                   ` (39 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: ahesford @ 2022-10-23 13:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002708827

Comment:
 No. We use the repository name (or, in this case, the tarball name) to determine the package name, not the marketing name and capitalization. It should be `spooles` here.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (63 preceding siblings ...)
  2022-10-23 13:14 ` [PR REVIEW] " ahesford
@ 2022-10-23 13:15 ` ahesford
  2022-10-23 13:25 ` ahesford
                   ` (38 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: ahesford @ 2022-10-23 13:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002708827

Comment:
 No. We use the repository name (or, in this case, the tarball name) to determine the package name, not the marketing name and capitalization. It should be `spooles` here. (The tarball referenced in your template is `spooles.$version.tgz` in a Netlib director called `spooles`.)

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (64 preceding siblings ...)
  2022-10-23 13:15 ` ahesford
@ 2022-10-23 13:25 ` ahesford
  2022-10-23 16:50 ` [PR PATCH] [Updated] " Phicem
                   ` (37 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: ahesford @ 2022-10-23 13:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002710275

Comment:
"Vendored" in this context means that the second project is integrated into the source tree and built alongside it. It seems what CalculiX is doing is just co-distributing tetgen, not vendoring it---the tarball is included but the CalculiX build process has no knowledge of this.

If you can resolve the licensing issue and get the original tarball from the original tetgen source, a separate package is OK. Otherwise, build it into the CalculiX package. You can override `do_build` or define `pre_build` or `post_build` as appropriate.

I don't see much point in making tetgen a subpackage, and that doesn't resolve the build override problem anyway---subpackage installation steps are not meant to add additional build steps, just to split installed contents.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (65 preceding siblings ...)
  2022-10-23 13:25 ` ahesford
@ 2022-10-23 16:50 ` Phicem
  2022-10-23 16:52 ` [PR REVIEW] " Phicem
                   ` (36 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 16:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 16448 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/13] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/13] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/13] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/13] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/13] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/13] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/13] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/13] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/13] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/13] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/13] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/13] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/13] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (66 preceding siblings ...)
  2022-10-23 16:50 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-23 16:52 ` Phicem
  2022-10-23 18:25 ` [PR PATCH] [Updated] " Phicem
                   ` (35 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 16:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002738745

Comment:
Subtle. Let's go with `spooles` then.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (67 preceding siblings ...)
  2022-10-23 16:52 ` [PR REVIEW] " Phicem
@ 2022-10-23 18:25 ` Phicem
  2022-10-23 18:29 ` [PR REVIEW] " Phicem
                   ` (34 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 18:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 18459 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/15] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/15] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/15] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/15] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/15] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/15] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/15] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/15] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/15] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/15] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/15] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/15] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/15] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/15] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/15] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (68 preceding siblings ...)
  2022-10-23 18:25 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-23 18:29 ` Phicem
  2022-10-23 18:49 ` Phicem
                   ` (33 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002750380

Comment:
Yes your version is better. Commited.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (69 preceding siblings ...)
  2022-10-23 18:29 ` [PR REVIEW] " Phicem
@ 2022-10-23 18:49 ` Phicem
  2022-10-23 18:51 ` [PR PATCH] [Updated] " Phicem
                   ` (32 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 18:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002752739

Comment:
I admit this file has limited interest. I wanted to make explicit the fact that libSN is released under GNU GPL v2 (or later), which I did not find that obvious given the multiple licenses of the package. But since the package license is GPL v2 + custom  and there is no license file for libSN, I guess it implicitely means that libSN is released under GPL v2.

Thus I will remove this file as you suggest.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (70 preceding siblings ...)
  2022-10-23 18:49 ` Phicem
@ 2022-10-23 18:51 ` Phicem
  2022-10-23 19:56 ` [PR REVIEW] " Phicem
                   ` (31 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 18:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 19776 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/16] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/16] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/16] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/16] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/16] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/16] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/16] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/16] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/16] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/16] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/16] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/16] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/16] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/16] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/16] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/16] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (71 preceding siblings ...)
  2022-10-23 18:51 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-23 19:56 ` Phicem
  2022-10-23 20:02 ` classabbyamp
                   ` (30 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-23 19:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002762706

Comment:
Hmm, I think I understand most of the suggested change here, but not all of it.

I understand that the `-02` flag is useless because it is already defined in `$XBPS_CFLAGS` and thus implicitely used.

I guess removing `-Wall` only suppresses warnings (which are not very useful in an automated build process), and can be safely removed, so I think I undestand this one as well. (I am correct?)

However I don't understand the removal of the `-Wno-narrowing` flag. I'm not very familiar with this flag but I thought it could remove errors (and not only warnings), and thus could change the build result. Why did you suggest removing this flag? Is it because it is considered that software should not be built when there are narrowing errors? Or is there another reason?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (72 preceding siblings ...)
  2022-10-23 19:56 ` [PR REVIEW] " Phicem
@ 2022-10-23 20:02 ` classabbyamp
  2022-10-26  6:37 ` Phicem
                   ` (29 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-10-23 20:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1002763883

Comment:
I didn't notice any errors with it removed so I didn't think it was necessary to specify

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (73 preceding siblings ...)
  2022-10-23 20:02 ` classabbyamp
@ 2022-10-26  6:37 ` Phicem
  2022-10-26  7:45 ` [PR PATCH] [Updated] " Phicem
                   ` (28 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  6:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1005275676

Comment:
I will merge tetgen binary into cgx package (see conversation above), so version synchronization will not be needed anymore 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (74 preceding siblings ...)
  2022-10-26  6:37 ` Phicem
@ 2022-10-26  7:45 ` Phicem
  2022-10-26  7:47 ` Phicem
                   ` (27 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  7:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 21111 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/17] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/17] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/17] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/17] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/17] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/17] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/17] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/17] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/17] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/17] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/17] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/17] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/17] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/17] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/17] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/17] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/17] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (75 preceding siblings ...)
  2022-10-26  7:45 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-26  7:47 ` Phicem
  2022-10-26  7:55 ` Phicem
                   ` (26 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  7:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 22233 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/18] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/18] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/18] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/18] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/18] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/18] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/18] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/18] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/18] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/18] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/18] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/18] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/18] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/18] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/18] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/18] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/18] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/18] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (76 preceding siblings ...)
  2022-10-26  7:47 ` Phicem
@ 2022-10-26  7:55 ` Phicem
  2022-10-26  7:56 ` Phicem
                   ` (25 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  7:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 23584 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/19] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/19] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/19] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/19] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/19] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/19] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/19] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/19] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/19] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/19] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/19] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/19] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/19] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/19] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/19] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/19] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/19] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/19] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/19] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (77 preceding siblings ...)
  2022-10-26  7:55 ` Phicem
@ 2022-10-26  7:56 ` Phicem
  2022-10-26  8:02 ` Phicem
                   ` (24 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  7:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 24618 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/20] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/20] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/20] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/20] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/20] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/20] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/20] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/20] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/20] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/20] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/20] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/20] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/20] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/20] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/20] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/20] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/20] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/20] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/20] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/20] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (78 preceding siblings ...)
  2022-10-26  7:56 ` Phicem
@ 2022-10-26  8:02 ` Phicem
  2022-10-26  8:03 ` Phicem
                   ` (23 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  8:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 25732 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/21] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/21] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/21] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/21] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/21] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/21] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/21] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/21] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/21] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/21] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/21] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/21] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/21] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/21] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/21] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/21] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/21] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/21] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/21] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/21] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/21] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (79 preceding siblings ...)
  2022-10-26  8:02 ` Phicem
@ 2022-10-26  8:03 ` Phicem
  2022-10-26  8:13 ` Phicem
                   ` (22 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  8:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 26696 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/22] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/22] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/22] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/22] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/22] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/22] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/22] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/22] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/22] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/22] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/22] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/22] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/22] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/22] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/22] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/22] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/22] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/22] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/22] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/22] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/22] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/22] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (80 preceding siblings ...)
  2022-10-26  8:03 ` Phicem
@ 2022-10-26  8:13 ` Phicem
  2022-10-26  8:13 ` Phicem
                   ` (21 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  8:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 27561 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/23] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/23] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/23] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/23] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/23] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/23] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/23] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/23] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/23] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/23] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/23] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/23] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/23] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/23] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/23] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/23] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/23] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/23] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/23] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/23] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/23] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/23] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/23] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (81 preceding siblings ...)
  2022-10-26  8:13 ` Phicem
@ 2022-10-26  8:13 ` Phicem
  2022-10-26  9:35 ` [PR REVIEW] " Phicem
                   ` (20 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  8:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 28250 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/24] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/24] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/24] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/24] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/24] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/24] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/24] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/24] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/24] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/24] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/24] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/24] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/24] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/24] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/24] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/24] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/24] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/24] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/24] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/24] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/24] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/24] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/24] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/24] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (82 preceding siblings ...)
  2022-10-26  8:13 ` Phicem
@ 2022-10-26  9:35 ` Phicem
  2022-10-26  9:37 ` [PR PATCH] [Updated] " Phicem
                   ` (19 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  9:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1005449289

Comment:
I tried to keep the build-style to "gnu-makefile" instead of overriding do_build(), and it seems to work. Is there a particular reason why you used a custom do_build() function?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (83 preceding siblings ...)
  2022-10-26  9:35 ` [PR REVIEW] " Phicem
@ 2022-10-26  9:37 ` Phicem
  2022-10-26  9:41 ` Phicem
                   ` (18 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  9:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 29191 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/25] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/25] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/25] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/25] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/25] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/25] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/25] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/25] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/25] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/25] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/25] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/25] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/25] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/25] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/25] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/25] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/25] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/25] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/25] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/25] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/25] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/25] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/25] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/25] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From 378c19e24222fb2da48a926683a4d18a084620d9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/25] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (84 preceding siblings ...)
  2022-10-26  9:37 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-26  9:41 ` Phicem
  2022-10-26 10:01 ` Phicem
                   ` (17 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26  9:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 30451 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/26] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/26] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/26] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/26] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/26] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/26] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/26] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/26] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/26] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/26] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/26] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/26] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/26] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/26] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/26] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/26] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/26] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/26] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/26] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/26] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/26] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/26] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/26] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/26] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From 378c19e24222fb2da48a926683a4d18a084620d9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/26] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

From fe2d486208d3bf4151bfea09510c86735fbbb265 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 11:40:53 +0200
Subject: [PATCH 26/26] cgx: changed paths because of the new build_wrksrc

---
 srcpkgs/CalculiX-cgx/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 251c8c168839..07f93c058572 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -5,7 +5,6 @@ revision=1
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
-make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
 depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
@@ -17,7 +16,7 @@ checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
-	vbin ${_cgx_dir}/src/cgx
-	vlicense ${_cgx_dir}/README CGX_LICENSE
-	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
 }

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (85 preceding siblings ...)
  2022-10-26  9:41 ` Phicem
@ 2022-10-26 10:01 ` Phicem
  2022-10-26 10:46 ` Phicem
                   ` (16 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26 10:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 31220 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/27] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/27] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/27] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/27] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/27] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/27] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/27] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/27] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/27] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/27] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/27] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/27] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/27] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/27] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/27] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/27] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/27] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/27] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/27] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/27] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/27] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/27] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/27] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/27] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From 378c19e24222fb2da48a926683a4d18a084620d9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/27] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

From fe2d486208d3bf4151bfea09510c86735fbbb265 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 11:40:53 +0200
Subject: [PATCH 26/27] cgx: changed paths because of the new build_wrksrc

---
 srcpkgs/CalculiX-cgx/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 251c8c168839..07f93c058572 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -5,7 +5,6 @@ revision=1
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
-make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
 depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
@@ -17,7 +16,7 @@ checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
-	vbin ${_cgx_dir}/src/cgx
-	vlicense ${_cgx_dir}/README CGX_LICENSE
-	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
 }

From 7ce3c20ec6e18914869b875403cb2a322e886ca2 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 12:01:04 +0200
Subject: [PATCH 27/27] tetgen: define wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index 91549466fda9..d69f2a49550d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -2,6 +2,7 @@
 pkgname=tetgen
 version=1.5.1
 revision=1
+wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (86 preceding siblings ...)
  2022-10-26 10:01 ` Phicem
@ 2022-10-26 10:46 ` Phicem
  2022-10-26 16:42 ` Phicem
                   ` (15 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26 10:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 32938 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/29] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/29] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/29] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/29] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/29] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/29] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/29] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/29] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/29] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/29] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/29] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/29] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/29] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/29] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/29] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/29] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/29] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/29] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/29] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/29] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/29] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/29] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/29] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/29] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From 378c19e24222fb2da48a926683a4d18a084620d9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/29] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

From fe2d486208d3bf4151bfea09510c86735fbbb265 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 11:40:53 +0200
Subject: [PATCH 26/29] cgx: changed paths because of the new build_wrksrc

---
 srcpkgs/CalculiX-cgx/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 251c8c168839..07f93c058572 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -5,7 +5,6 @@ revision=1
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
-make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
 depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
@@ -17,7 +16,7 @@ checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
-	vbin ${_cgx_dir}/src/cgx
-	vlicense ${_cgx_dir}/README CGX_LICENSE
-	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
 }

From 7ce3c20ec6e18914869b875403cb2a322e886ca2 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 12:01:04 +0200
Subject: [PATCH 27/29] tetgen: define wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index 91549466fda9..d69f2a49550d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -2,6 +2,7 @@
 pkgname=tetgen
 version=1.5.1
 revision=1
+wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"

From 2553e36326f470ce5eded98938c9728ef4dbc084 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:16 +0200
Subject: [PATCH 28/29] tetgen: update paths

---
 srcpkgs/tetgen/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d69f2a49550d..d6cfaea0819f 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
-make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,6 +20,6 @@ post_extract() {
 }
 
 do_install() {
-	vbin ${pkgname}${version}/tetgen
-	vlicense ${pkgname}${version}/LICENSE
+	vbin tetgen
+	vlicense LICENSE
 }

From 426c95a59b9dda14325fea32e2a37fee39553cb8 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:38 +0200
Subject: [PATCH 29/29] tetgen: add lib

---
 srcpkgs/tetgen/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d6cfaea0819f..17a83383d9ea 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,6 +4,7 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
+make_build_target="tetgen tetlib"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,5 +22,6 @@ post_extract() {
 
 do_install() {
 	vbin tetgen
+	vinstall libtet.a 644 usr/lib
 	vlicense LICENSE
 }

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (87 preceding siblings ...)
  2022-10-26 10:46 ` Phicem
@ 2022-10-26 16:42 ` Phicem
  2022-10-26 19:18 ` Phicem
                   ` (14 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26 16:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 39548 bytes --]

From eeca225752381043c596d91cdbc9aa13f150583b Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/32] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From b8056551ead6bd5c181a014b91ef745a1adb678a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/32] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 0bba3acc3b82eb93124065e4b53ac77a74a85803 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/32] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From e8fc686e26f2b8ecf33b896b50648136505c4e3d Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/32] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From d4fb2376653ab809c44208e70d05096c5fa9a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/32] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 200c4ede685606972d177b58a311feafc0078f5f Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/32] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 16e2e045dad00492aa68e4e3adee055d51502b7e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/32] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From e0ca24c70fb19407f81695383b1d2ad13342a070 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/32] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From e199a33b259317c195d3874614d45f3bcfc58a86 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/32] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a45a0cf4bffe6ae840b544991536bb37e54f08fc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/32] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 2213c52e60eac627ba0ad0a949bc2a9ae8cffbf8 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/32] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 086d092f46f731a7ebe045d48a4e6c4fc541ca40 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/32] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 94edbc118cd4b970e506d08d659b9fdc238a1f84 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/32] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 6aa25cdb334a3a448d43d4f8e0d05f9c2c3667aa Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/32] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From e926aef0dd32680e6dd02333a2bac0475c0c07fd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/32] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 13e434161ad46ab61b0437058f5eac29e7ceadb6 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/32] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 2935e96c1576d8ec188f24544f31e7208aad53cc Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/32] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 95ebabc4325ac9ce7040ab8000cae467add86d01 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/32] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From c1db053cbf0a72a70dfbc6b65181515710050fee Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/32] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 6b189b12991a86ec459baa3b2ce5fc58f861c35e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/32] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From e17d3715d2b31362b74813f140c74ef11a77db2d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/32] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From 6d65c9297584380475b3c7f56ee4f7c20335eab3 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/32] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From c24c0fa27d0b22c2fadf795073d00d371ba067fd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/32] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 590f4868fc4be05f4770f2f28e59b23ac5e55cfb Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/32] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From 378c19e24222fb2da48a926683a4d18a084620d9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/32] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

From fe2d486208d3bf4151bfea09510c86735fbbb265 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 11:40:53 +0200
Subject: [PATCH 26/32] cgx: changed paths because of the new build_wrksrc

---
 srcpkgs/CalculiX-cgx/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 251c8c168839..07f93c058572 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -5,7 +5,6 @@ revision=1
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
-make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
 depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
@@ -17,7 +16,7 @@ checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
-	vbin ${_cgx_dir}/src/cgx
-	vlicense ${_cgx_dir}/README CGX_LICENSE
-	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
 }

From 7ce3c20ec6e18914869b875403cb2a322e886ca2 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 12:01:04 +0200
Subject: [PATCH 27/32] tetgen: define wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index 91549466fda9..d69f2a49550d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -2,6 +2,7 @@
 pkgname=tetgen
 version=1.5.1
 revision=1
+wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"

From 2553e36326f470ce5eded98938c9728ef4dbc084 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:16 +0200
Subject: [PATCH 28/32] tetgen: update paths

---
 srcpkgs/tetgen/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d69f2a49550d..d6cfaea0819f 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
-make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,6 +20,6 @@ post_extract() {
 }
 
 do_install() {
-	vbin ${pkgname}${version}/tetgen
-	vlicense ${pkgname}${version}/LICENSE
+	vbin tetgen
+	vlicense LICENSE
 }

From 426c95a59b9dda14325fea32e2a37fee39553cb8 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:38 +0200
Subject: [PATCH 29/32] tetgen: add lib

---
 srcpkgs/tetgen/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d6cfaea0819f..17a83383d9ea 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,6 +4,7 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
+make_build_target="tetgen tetlib"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,5 +22,6 @@ post_extract() {
 
 do_install() {
 	vbin tetgen
+	vinstall libtet.a 644 usr/lib
 	vlicense LICENSE
 }

From f8deb02ca266029897e16548b269b8170b907b66 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:30:13 +0200
Subject: [PATCH 30/32] Include tetgen inside CalculiX-cgx package

---
 srcpkgs/CalculiX-cgx/template | 17 ++++++++++++++++-
 srcpkgs/tetgen/template       | 27 ---------------------------
 2 files changed, 16 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 07f93c058572..4fdef025263e 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -3,10 +3,10 @@ pkgname=CalculiX-cgx
 version=2.20
 revision=1
 create_wrksrc=yes
+wrksrc="${pkgname}-${version}"
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
-depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later, custom:GLUT"
@@ -14,9 +14,24 @@ homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${wrksrc}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
 
 do_install() {
 	vbin cgx
 	vlicense ../README CGX_LICENSE
 	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
 }
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}
+
diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
deleted file mode 100644
index 17a83383d9ea..000000000000
--- a/srcpkgs/tetgen/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'tetgen'
-pkgname=tetgen
-version=1.5.1
-revision=1
-wrksrc="${pkgname}${version}"
-build_style="gnu-makefile"
-make_build_target="tetgen tetlib"
-short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
-maintainer="Phicem <phicem@gmx.com>"
-license="AGPL-3.0-or-later"
-homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
-distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
-checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-make_check="no" # No tests provided
-
-post_extract() {
-	cd $XBPS_BUILDDIR
-	bsdtar -xvf ${pkgname}${version}.tar
-	rm -rf CalculiX
-	rm ${pkgname}${version}.tar
-}
-
-do_install() {
-	vbin tetgen
-	vinstall libtet.a 644 usr/lib
-	vlicense LICENSE
-}

From 6d923acc3b6e877fde2a9b7740a084467eb2d3b8 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:34:33 +0200
Subject: [PATCH 31/32] Remove xlint warnings

---
 srcpkgs/CalculiX-ccx/template | 4 ++--
 srcpkgs/CalculiX-cgx/template | 3 +--
 srcpkgs/spooles/template      | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 3fa32f8f7b65..c0d650c7739b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 
-FFLAGS="-fallow-argument-mismatch"
+_FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 post_patch() {
@@ -26,7 +26,7 @@ post_patch() {
 }
 
 do_build() {
-	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
 		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 4fdef025263e..6ae05ff5241e 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-create_wrksrc=yes
 wrksrc="${pkgname}-${version}"
+create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
@@ -34,4 +34,3 @@ post_extract() {
 	bsdtar -xvf tetgen${_tetgen_version}.tar
 	rm tetgen${_tetgen_version}.tar
 }
-
diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9b9fcfadbe1d..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 3b2a562dee360b28439b75135a6a53d19b958300 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:41:03 +0200
Subject: [PATCH 32/32] ccx: fixed 'spooles' package name and paths

---
 srcpkgs/CalculiX-ccx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index c0d650c7739b..e1befe6f3285 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
-makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
@@ -14,7 +14,7 @@ distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 
 _FFLAGS="-fallow-argument-mismatch"
-CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 post_patch() {
 	vsed -e 's,./date.pl; ,,' -i Makefile

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (88 preceding siblings ...)
  2022-10-26 16:42 ` Phicem
@ 2022-10-26 19:18 ` Phicem
  2022-10-26 19:25 ` [PR REVIEW] " Phicem
                   ` (13 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26 19:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 5 packages, each in a separate commit:
- SPOOLES (build dependency for CalculiX-ccx)
- CalculiX-ccx
- tetgen (runtime dependency for CalculiX-cgx)
- CalculiX-cgx
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc): **OK**
- Native armv7l (glibc): **OK**
- Native *-musl: **NOT TESTED**

#### Cross build testing (from x86_64 machine)
- Compiling to i686: **OK**
- Compiling to x86_64-musl: **OK**
- Cross-compiling to armv7l / armv6l: **FAILED** (building works when compiling natively so is it a big issue?)

#### Runtime testing
- On x86_64: **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 39548 bytes --]

From 0b1717bebf52344105e1c8a45fb22b1975a29398 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 01/32] New package: SPOOLES-2.2

---
 srcpkgs/SPOOLES/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/SPOOLES/template

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/SPOOLES/template
new file mode 100644
index 000000000000..a533d24a89a8
--- /dev/null
+++ b/srcpkgs/SPOOLES/template
@@ -0,0 +1,25 @@
+# Template file for 'SPOOLES'
+pkgname=SPOOLES
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 755 usr/lib
+	HEADERS_DIR=usr/include/SPOOLES-2.2
+	for file in $(find -name '*.h') ; do
+		dir=$(dirname ${file})
+		vmkdir ${HEADERS_DIR}/${dir}
+		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	done
+
+}

From 0be610db905dc324c52707f4397a8cb940b8d852 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:21 +0200
Subject: [PATCH 02/32] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..b8728aacc1ff
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_ccx_dir=ccx_${version}
+_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
+hostmakedepends="perl gcc-fortran"
+makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
+
+if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
+	makedepends+=" libquadmath"
+	hostmakedepends+=" libgomp-devel-32bit"
+fi
+short_desc="3D Structural Finite Element Program - Solver part"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+do_build() {
+	if [ "$CROSS_BUILD" ]; then
+		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
+	fi
+	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+}
+
+do_install() {
+	vbin ${_ccx_dir}/src/ccx_${version} ccx
+}

From 607e9468356aba792c3dd4ba7276c0785dada8c4 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:28 +0200
Subject: [PATCH 03/32] New package: tetgen-1.5.1

---
 srcpkgs/tetgen/template | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
new file mode 100644
index 000000000000..c7e68d4cd672
--- /dev/null
+++ b/srcpkgs/tetgen/template
@@ -0,0 +1,26 @@
+# Template file for 'tetgen'
+pkgname=tetgen
+version=1.5.1
+revision=1
+build_style="gnu-makefile"
+make_cmd="make -C ${pkgname}${version} -f makefile"
+hostmakedepends="tar"
+short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
+maintainer="Phicem <phicem@gmx.com>"
+license="AGPL-3.0-or-later"
+homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
+distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+make_check="no" # No tests provided
+
+do_extract() {
+	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
+	tar -xvjf $srcdir/"$(basename ${distfiles})"
+	pwd
+	tar -xvf ${pkgname}${version}.tar
+}
+
+do_install() {
+	vbin ${pkgname}${version}/tetgen
+	vlicense ${pkgname}${version}/LICENSE
+}

From 2184ca17bbae7134234b1dc1c204e9f0a21c7819 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:43 +0200
Subject: [PATCH 04/32] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES  |  5 ++++
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 16 ++++++++++++
 srcpkgs/CalculiX-cgx/template               | 27 +++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
new file mode 100644
index 000000000000..7b4d6ea22898
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/files/README_LICENSES
@@ -0,0 +1,5 @@
+cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
+
+To be compiled, this program makes use of other programs released under different licenses:
+* glut is released under a custom license (see GLUT_LICENSE)
+* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..2b9bd1b60462
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,16 @@
+--- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
++++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
+@@ -1,3 +1,4 @@
++CXX=g++
+ # on MacOS it might be necessary to remove -DSEMINIT
+ CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
+   -I./ \
+@@ -67,7 +68,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..8f5d5d48cd5a
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,27 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc=CalculiX
+_cgx_dir=cgx_${version}
+build_style="gnu-makefile"
+make_build_args="-C ${_cgx_dir}/src"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+depends="tetgen"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+if [ "$XBPS_MACHINE" == "x86_64" ] ; then
+	hostmakedepends+="glibc-devel-32bit"
+fi
+CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+
+do_install() {
+	vbin ${_cgx_dir}/src/cgx
+	vlicense ${_cgx_dir}/README CGX_LICENSE
+	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vlicense ${FILESDIR}/README_LICENSES
+}

From eda1e5549c9d4d35e77e793aed4c604afbb378b8 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:56:56 +0200
Subject: [PATCH 05/32] New package: CalculiX-2.20

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 4116c5a21d5dd5a3b9b258e8276431fead339d80 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:50:09 +0200
Subject: [PATCH 06/32] Changed ccx description

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b8728aacc1ff..dc58a9aec3d8 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; the
 	makedepends+=" libquadmath"
 	hostmakedepends+=" libgomp-devel-32bit"
 fi
-short_desc="3D Structural Finite Element Program - Solver part"
+short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"

From 4f4ffd98a622da55ff27cb230e6468ff56612cc9 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 11:35:51 +0200
Subject: [PATCH 07/32] Remove lines added during cross-compilation attemps

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 8f5d5d48cd5a..b5534017a9d5 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,9 +14,6 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-if [ "$XBPS_MACHINE" == "x86_64" ] ; then
-	hostmakedepends+="glibc-devel-32bit"
-fi
 CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
 
 do_install() {

From 0bca200da563fb652fb22716596cf3f20eee4de4 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:27 +0200
Subject: [PATCH 08/32] Define custom post_extract instead of do_extract

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c7e68d4cd672..c2f603ab440d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -13,11 +13,11 @@ distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 make_check="no" # No tests provided
 
-do_extract() {
-	local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
-	tar -xvjf $srcdir/"$(basename ${distfiles})"
-	pwd
-	tar -xvf ${pkgname}${version}.tar
+post_extract() {
+	cd $XBPS_BUILDDIR
+	bsdtar -xvf ${pkgname}${version}.tar
+	rm -rf CalculiX
+	rm ${pkgname}${version}.tar
 }
 
 do_install() {

From 67e67213699cee57e4e1a140cb3713717c5cb554 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:00:56 +0200
Subject: [PATCH 09/32] Use bsdtar instead of tar

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index c2f603ab440d..91549466fda9 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
-hostmakedepends="tar"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"

From a0b32c9987c263f4c1b03a5a61bfaadb3fc9345a Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:20:45 +0200
Subject: [PATCH 10/32] Removed unneeded lines with native i686 built

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index dc58a9aec3d8..eba376e3aa81 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -8,11 +8,6 @@ _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpac
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 _FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
-
-if [ "$XBPS_MACHINE" == "x86_64" ]  && [ "$XBPS_TARGET_MACHINE" == "i686" ]; then
-	makedepends+=" libquadmath"
-	hostmakedepends+=" libgomp-devel-32bit"
-fi
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 06e15b9283e9ad3eb966716d30cd05457b39b10d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:39:54 +0200
Subject: [PATCH 11/32] Remove xbps-src default CFLAGS repetition + removed
 '-Wall' flag

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index eba376e3aa81..6f73fd319020 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -14,9 +14,9 @@ license="GPL-2.0-or-later"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
-CFLAGS=" -Wall -O2  -I ${XBPS_CROSS_BASE}/usr/include/SPOOLES-2.2 -DARCH='Linux' -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
-CFLAGS+=" ${XBPS_CROSS_CFLAGS}"
-_FFLAGS+=" ${XBPS_CROSS_CFLAGS}"
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 do_build() {
 	if [ "$CROSS_BUILD" ]; then

From 91c5b647340979154e8463d2f1665288e3bf8dcf Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:42:49 +0200
Subject: [PATCH 12/32] Variable unused since previous commit

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 6f73fd319020..2361bce81441 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -7,7 +7,6 @@ _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="perl gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
-_FFLAGS=" -Wall -O2 -fallow-argument-mismatch"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"

From 3cf25d8baa70380e1bcb18e571532cfcacc1f87c Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 18:50:12 +0200
Subject: [PATCH 13/32] Lowercased spooles package name

---
 srcpkgs/{SPOOLES => spooles}/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename srcpkgs/{SPOOLES => spooles}/template (93%)

diff --git a/srcpkgs/SPOOLES/template b/srcpkgs/spooles/template
similarity index 93%
rename from srcpkgs/SPOOLES/template
rename to srcpkgs/spooles/template
index a533d24a89a8..9204e32ecaf9 100644
--- a/srcpkgs/SPOOLES/template
+++ b/srcpkgs/spooles/template
@@ -1,5 +1,5 @@
-# Template file for 'SPOOLES'
-pkgname=SPOOLES
+# Template file for 'spooles'
+pkgname=spooles
 version=2.2
 revision=1
 create_wrksrc=yes

From 423bcfc271b3045f20a3bca65e4df126ea87a4c5 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:24:24 +0200
Subject: [PATCH 14/32] Improved do_install for spooles (classabbyamp's
 suggestion)

---
 srcpkgs/spooles/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9204e32ecaf9..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -14,12 +14,11 @@ distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 
 do_install() {
-	vinstall spooles.a 755 usr/lib
-	HEADERS_DIR=usr/include/SPOOLES-2.2
-	for file in $(find -name '*.h') ; do
-		dir=$(dirname ${file})
-		vmkdir ${HEADERS_DIR}/${dir}
-		vinstall ${file} 644 ${HEADERS_DIR}/${dir}
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
 	done
-
 }

From 96b1c81586db812fec74922da3c42c79bdf9804c Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:25:08 +0200
Subject: [PATCH 15/32] spooles: replaced hardcoded version number by a
 variable

---
 srcpkgs/spooles/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 65ea946085e5..9b9fcfadbe1d 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 919a0e82f58847c34bc9663d769f4fd90bec6cdd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 23 Oct 2022 20:51:22 +0200
Subject: [PATCH 16/32] cgx: removed unnecessary license file

---
 srcpkgs/CalculiX-cgx/files/README_LICENSES | 5 -----
 srcpkgs/CalculiX-cgx/template              | 1 -
 2 files changed, 6 deletions(-)
 delete mode 100644 srcpkgs/CalculiX-cgx/files/README_LICENSES

diff --git a/srcpkgs/CalculiX-cgx/files/README_LICENSES b/srcpkgs/CalculiX-cgx/files/README_LICENSES
deleted file mode 100644
index 7b4d6ea22898..000000000000
--- a/srcpkgs/CalculiX-cgx/files/README_LICENSES
+++ /dev/null
@@ -1,5 +0,0 @@
-cgx program is released under GNU GPL v2 or later (except for a few functions, see CGX_LICENSE)
-
-To be compiled, this program makes use of other programs released under different licenses:
-* glut is released under a custom license (see GLUT_LICENSE)
-* libSN is released under GNU GPL v2 or later
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index b5534017a9d5..23a52dcc9ef2 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -20,5 +20,4 @@ do_install() {
 	vbin ${_cgx_dir}/src/cgx
 	vlicense ${_cgx_dir}/README CGX_LICENSE
 	vlicense glut-3.5/NOTICE GLUT_LICENSE
-	vlicense ${FILESDIR}/README_LICENSES
 }

From 298230a4ed666e745c6c832ad719fea7f0918cdd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:45:43 +0200
Subject: [PATCH 17/32] cgx: clean patch

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
index 2b9bd1b60462..dd2975a78dea 100644
--- a/srcpkgs/CalculiX-cgx/patches/Makefile.patch
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -1,16 +1,12 @@
---- CalculiX/cgx_2.20/src/Makefile.orig	2022-07-29 11:41:00.438531485 +0200
-+++ CalculiX/cgx_2.20/src/Makefile	2022-10-15 13:34:33.978116884 +0200
-@@ -1,3 +1,4 @@
-+CXX=g++
- # on MacOS it might be necessary to remove -DSEMINIT
- CFLAGS = -O2 -Wall -Wno-narrowing -DSEMINIT \
-   -I./ \
-@@ -67,7 +68,7 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
  OUTIL = $(SUTIL:.c=.o)
  
  cgx: $(OLIB) $(OUTIL) $(OULIB)
 -	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
-+	${CXX}  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
++	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
  
  
  
+

From 4451836a22845b4750895768622bb6cd341df1a2 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:47:41 +0200
Subject: [PATCH 18/32] cgx: removed unneeded flags

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 23a52dcc9ef2..91b011e856d9 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:GLUT"
 homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-CFLAGS=" -O2 -Wall -Wno-narrowing  -I./  -I/usr/include/  -I/usr/include/GL  -I../../libSNL/src  -I../../glut-3.5/src  -I/usr/X11/include"
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
 	vbin ${_cgx_dir}/src/cgx

From 03e14608ae426c8e0c463cb17ed110fc9d6e0d5e Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:55:53 +0200
Subject: [PATCH 19/32] ccx: replace (broken) perl script with sed calls

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2361bce81441..f7c4fa053797 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -17,6 +17,15 @@ checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
 do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"

From 8d0a40a3622685b976ee81086d7d069faad2234d Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 09:56:32 +0200
Subject: [PATCH 20/32] Remove perl dependency (not needed anymore)

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index f7c4fa053797..2f411354c203 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
 _LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
-hostmakedepends="perl gcc-fortran"
+hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"

From d7af5d291063d2c7b73bd3ce84b062a23eb508bd Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:02:20 +0200
Subject: [PATCH 21/32] Use xbps-src variables instead of manually recreating
 them

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 2f411354c203..7736fa8bd4aa 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -27,10 +27,8 @@ post_patch() {
 }
 
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_xbps_cross_prefix="${XBPS_CROSS_TRIPLET}-"
-	fi
-	make -C ${_ccx_dir}/src CC="${_xbps_cross_prefix}gcc" FC="${_xbps_cross_prefix}gfortran" LIBS="$_LIBS" FFLAGS="$_FFLAGS" CFLAGS="$CFLAGS"
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
 do_install() {

From e27083ddf509dac0b6b2ed9a4ac34a4eba86f602 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:03:28 +0200
Subject: [PATCH 22/32] ccx: LIBS directly defined in the command line now

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 7736fa8bd4aa..b3ca1bfd2db4 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -4,7 +4,6 @@ version=2.20
 revision=1
 wrksrc=CalculiX
 _ccx_dir=ccx_${version}
-_LIBS=" ${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/lib/libopenblas.so  -lpthread -lm -lc"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 2b59c519ad8723bb25453eeeb83eea2d88b1c903 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:03 +0200
Subject: [PATCH 23/32] ccx: add build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index b3ca1bfd2db4..e9d798d5801b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -3,7 +3,7 @@ pkgname=CalculiX-ccx
 version=2.20
 revision=1
 wrksrc=CalculiX
-_ccx_dir=ccx_${version}
+build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
 makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"

From 116f7e8c0a091c4fee7270e39cea553df213b057 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 10:13:52 +0200
Subject: [PATCH 24/32] ccx: Use build_wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-ccx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index e9d798d5801b..3fa32f8f7b65 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -31,5 +31,5 @@ do_build() {
 }
 
 do_install() {
-	vbin ${_ccx_dir}/src/ccx_${version} ccx
+	vbin ccx_${version} ccx
 }

From f11429054724bd83969304033ee9b541d6879047 Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 11:37:02 +0200
Subject: [PATCH 25/32] cgx: Changed wrksrc and build_wrksrc so that there is
 nothing left in the builddir on clean

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/CalculiX-cgx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 91b011e856d9..251c8c168839 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc=CalculiX
-_cgx_dir=cgx_${version}
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"

From 1c5d86f1c60b52662cefd4dd01435602e7b15555 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 11:40:53 +0200
Subject: [PATCH 26/32] cgx: changed paths because of the new build_wrksrc

---
 srcpkgs/CalculiX-cgx/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 251c8c168839..07f93c058572 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -5,7 +5,6 @@ revision=1
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
-make_build_args="-C ${_cgx_dir}/src"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
 depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
@@ -17,7 +16,7 @@ checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 
 do_install() {
-	vbin ${_cgx_dir}/src/cgx
-	vlicense ${_cgx_dir}/README CGX_LICENSE
-	vlicense glut-3.5/NOTICE GLUT_LICENSE
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
 }

From 5a7cb835bfd3a259a71d4ecb3b6a7aaca346c3aa Mon Sep 17 00:00:00 2001
From: Phicem <82261758+Phicem@users.noreply.github.com>
Date: Wed, 26 Oct 2022 12:01:04 +0200
Subject: [PATCH 27/32] tetgen: define wrksrc

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/tetgen/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index 91549466fda9..d69f2a49550d 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -2,6 +2,7 @@
 pkgname=tetgen
 version=1.5.1
 revision=1
+wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
 make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"

From e0aa63f40122c973c070335eb8e8eabe0e2c5901 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:16 +0200
Subject: [PATCH 28/32] tetgen: update paths

---
 srcpkgs/tetgen/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d69f2a49550d..d6cfaea0819f 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,7 +4,6 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
-make_cmd="make -C ${pkgname}${version} -f makefile"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,6 +20,6 @@ post_extract() {
 }
 
 do_install() {
-	vbin ${pkgname}${version}/tetgen
-	vlicense ${pkgname}${version}/LICENSE
+	vbin tetgen
+	vlicense LICENSE
 }

From ab2a229ba98642172f65977a454ac6e297c52dce Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 12:42:38 +0200
Subject: [PATCH 29/32] tetgen: add lib

---
 srcpkgs/tetgen/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
index d6cfaea0819f..17a83383d9ea 100644
--- a/srcpkgs/tetgen/template
+++ b/srcpkgs/tetgen/template
@@ -4,6 +4,7 @@ version=1.5.1
 revision=1
 wrksrc="${pkgname}${version}"
 build_style="gnu-makefile"
+make_build_target="tetgen tetlib"
 short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
 maintainer="Phicem <phicem@gmx.com>"
 license="AGPL-3.0-or-later"
@@ -21,5 +22,6 @@ post_extract() {
 
 do_install() {
 	vbin tetgen
+	vinstall libtet.a 644 usr/lib
 	vlicense LICENSE
 }

From b6eb051e9d80632597022fcb964b126a3bddac03 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:30:13 +0200
Subject: [PATCH 30/32] Include tetgen inside CalculiX-cgx package

---
 srcpkgs/CalculiX-cgx/template | 17 ++++++++++++++++-
 srcpkgs/tetgen/template       | 27 ---------------------------
 2 files changed, 16 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/tetgen/template

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 07f93c058572..4fdef025263e 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -3,10 +3,10 @@ pkgname=CalculiX-cgx
 version=2.20
 revision=1
 create_wrksrc=yes
+wrksrc="${pkgname}-${version}"
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
-depends="tetgen"
 short_desc="3D Structural Finite Element Program - Graphical interface"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later, custom:GLUT"
@@ -14,9 +14,24 @@ homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${wrksrc}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
 
 do_install() {
 	vbin cgx
 	vlicense ../README CGX_LICENSE
 	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
 }
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}
+
diff --git a/srcpkgs/tetgen/template b/srcpkgs/tetgen/template
deleted file mode 100644
index 17a83383d9ea..000000000000
--- a/srcpkgs/tetgen/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'tetgen'
-pkgname=tetgen
-version=1.5.1
-revision=1
-wrksrc="${pkgname}${version}"
-build_style="gnu-makefile"
-make_build_target="tetgen tetlib"
-short_desc="Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator"
-maintainer="Phicem <phicem@gmx.com>"
-license="AGPL-3.0-or-later"
-homepage="https://www.wias-berlin.de/software/index.jsp?id=TetGen"
-distfiles="http://www.dhondt.de/cgx_2.20.all.tar.bz2"
-checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
-make_check="no" # No tests provided
-
-post_extract() {
-	cd $XBPS_BUILDDIR
-	bsdtar -xvf ${pkgname}${version}.tar
-	rm -rf CalculiX
-	rm ${pkgname}${version}.tar
-}
-
-do_install() {
-	vbin tetgen
-	vinstall libtet.a 644 usr/lib
-	vlicense LICENSE
-}

From 8287f642beef3033042b2cead5195f0f450b693a Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:34:33 +0200
Subject: [PATCH 31/32] Remove xlint warnings

---
 srcpkgs/CalculiX-ccx/template | 4 ++--
 srcpkgs/CalculiX-cgx/template | 3 +--
 srcpkgs/spooles/template      | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 3fa32f8f7b65..c0d650c7739b 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 
-FFLAGS="-fallow-argument-mismatch"
+_FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 post_patch() {
@@ -26,7 +26,7 @@ post_patch() {
 }
 
 do_build() {
-	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
 		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 
diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 4fdef025263e..6ae05ff5241e 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,8 +2,8 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-create_wrksrc=yes
 wrksrc="${pkgname}-${version}"
+create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
 makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
@@ -34,4 +34,3 @@ post_extract() {
 	bsdtar -xvf tetgen${_tetgen_version}.tar
 	rm tetgen${_tetgen_version}.tar
 }
-
diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
index 9b9fcfadbe1d..65ea946085e5 100644
--- a/srcpkgs/spooles/template
+++ b/srcpkgs/spooles/template
@@ -9,7 +9,7 @@ hostmakedepends="perl"
 short_desc="SParse Object Oriented Linear Equations Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="Public Domain"
-homepage="https://netlib.org/linalg/spooles/spooles.${version}.html"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
 distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
 checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
 

From 57840da0187fe6df1bddb3699211f24146cd001c Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Wed, 26 Oct 2022 16:41:03 +0200
Subject: [PATCH 32/32] ccx: fixed 'spooles' package name and paths

---
 srcpkgs/CalculiX-ccx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index c0d650c7739b..e1befe6f3285 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc=CalculiX
 build_wrksrc="ccx_${version}/src"
 hostmakedepends="gcc-fortran"
-makedepends="SPOOLES arpack-ng-devel libgomp-devel openblas-devel"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
 short_desc="3D Structural Finite Element Program - Solver"
 maintainer="Phicem <phicem@gmx.com>"
 license="GPL-2.0-or-later"
@@ -14,7 +14,7 @@ distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 
 _FFLAGS="-fallow-argument-mismatch"
-CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SPOOLES -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 post_patch() {
 	vsed -e 's,./date.pl; ,,' -i Makefile

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR REVIEW] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (89 preceding siblings ...)
  2022-10-26 19:18 ` Phicem
@ 2022-10-26 19:25 ` Phicem
  2022-10-30 20:31 ` [PR PATCH] [Updated] " Phicem
                   ` (12 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-26 19:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New review comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#discussion_r1006103735

Comment:
Okay, thank you for the detail. Tetgen is now built directly in CalculiX-cgx package.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (90 preceding siblings ...)
  2022-10-26 19:25 ` [PR REVIEW] " Phicem
@ 2022-10-30 20:31 ` Phicem
  2022-10-31 14:17 ` Phicem
                   ` (11 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-30 20:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK TBC**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- - Cross-compiling to aarch64: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)

#### Runtime testing
- On x86_64 (glib): **NOT OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files. _Edit: with 2.20 version, a segfault occurs (with `acou2` test file) when using the binary from the package, but not when using manually compiled binary... Investigating..._)
- On armv7l: **OK** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 6470 bytes --]

From 0394931310004016b7275480b50765f416fbdcc7 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/4] New package: spooles-2.2

---
 srcpkgs/spooles/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/spooles/template

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
new file mode 100644
index 000000000000..65ea946085e5
--- /dev/null
+++ b/srcpkgs/spooles/template
@@ -0,0 +1,24 @@
+# Template file for 'spooles'
+pkgname=spooles
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
+	done
+}

From 58afeb43d1ac13bbe38801e64eafb3e89b389c67 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:43:44 +0100
Subject: [PATCH 2/4] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..93f90b9fd7a0
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+build_wrksrc="ccx_${version}/src"
+hostmakedepends="gcc-fortran"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
+short_desc="3D Structural Finite Element Program - Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+
+_FFLAGS=" -O2 -fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
+do_build() {
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
+}
+
+do_install() {
+	vbin ccx_${version} ccx
+}

From bbc86306ed8fe56ffef15728ef1e7466d41d11ac Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:13 +0100
Subject: [PATCH 3/4] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 12 +++++++
 srcpkgs/CalculiX-cgx/template               | 36 +++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..dd2975a78dea
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,12 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..6ae05ff5241e
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,36 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc="${pkgname}-${version}"
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
+build_style="gnu-makefile"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${wrksrc}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
+
+do_install() {
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
+}
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}

From bd86adddf74a4238d6e83b74af530a93c9aa57a2 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:36 +0100
Subject: [PATCH 4/4] New package: CalculiX-2.20 (meta-package)

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (91 preceding siblings ...)
  2022-10-30 20:31 ` [PR PATCH] [Updated] " Phicem
@ 2022-10-31 14:17 ` Phicem
  2022-10-31 14:25 ` Phicem
                   ` (10 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-31 14:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK TBC**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- Cross-compiling to aarch64: **OK**

#### Runtime testing
- On x86_64 (glibc): **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK TBC** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 7673 bytes --]

From 0394931310004016b7275480b50765f416fbdcc7 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/5] New package: spooles-2.2

---
 srcpkgs/spooles/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/spooles/template

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
new file mode 100644
index 000000000000..65ea946085e5
--- /dev/null
+++ b/srcpkgs/spooles/template
@@ -0,0 +1,24 @@
+# Template file for 'spooles'
+pkgname=spooles
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
+	done
+}

From 58afeb43d1ac13bbe38801e64eafb3e89b389c67 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:43:44 +0100
Subject: [PATCH 2/5] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..93f90b9fd7a0
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+build_wrksrc="ccx_${version}/src"
+hostmakedepends="gcc-fortran"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
+short_desc="3D Structural Finite Element Program - Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+
+_FFLAGS=" -O2 -fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
+do_build() {
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
+}
+
+do_install() {
+	vbin ccx_${version} ccx
+}

From bbc86306ed8fe56ffef15728ef1e7466d41d11ac Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:13 +0100
Subject: [PATCH 3/5] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 12 +++++++
 srcpkgs/CalculiX-cgx/template               | 36 +++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..dd2975a78dea
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,12 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..6ae05ff5241e
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,36 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+wrksrc="${pkgname}-${version}"
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
+build_style="gnu-makefile"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${wrksrc}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
+
+do_install() {
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
+}
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}

From bd86adddf74a4238d6e83b74af530a93c9aa57a2 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:36 +0100
Subject: [PATCH 4/5] New package: CalculiX-2.20 (meta-package)

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 6a3009d923292dc435f40b39cfda55145a633d71 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Mon, 31 Oct 2022 14:33:18 +0100
Subject: [PATCH 5/5] Removed online xlint warning

---
 srcpkgs/CalculiX-cgx/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
index 6ae05ff5241e..2806520f6914 100644
--- a/srcpkgs/CalculiX-cgx/template
+++ b/srcpkgs/CalculiX-cgx/template
@@ -2,7 +2,6 @@
 pkgname=CalculiX-cgx
 version=2.20
 revision=1
-wrksrc="${pkgname}-${version}"
 create_wrksrc=yes
 build_wrksrc="CalculiX/cgx_${version}/src"
 build_style="gnu-makefile"
@@ -15,7 +14,7 @@ distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
 checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
 CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
 _tetgen_version=1.5.1
-_tetgen_dir=${XBPS_BUILDDIR}/${wrksrc}/tetgen${_tetgen_version}
+_tetgen_dir=${XBPS_BUILDDIR}/${pkgname}-${version}/tetgen${_tetgen_version}
 
 post_build() {
 	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (92 preceding siblings ...)
  2022-10-31 14:17 ` Phicem
@ 2022-10-31 14:25 ` Phicem
  2022-10-31 16:45 ` Phicem
                   ` (9 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-31 14:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

[WIP] CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK TBC**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- Cross-compiling to aarch64: **OK**

#### Runtime testing
- On x86_64 (glibc): **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK TBC** (for CalculiX-ccx: only basic tests have been run)
- On i686: **NOT TESTED** 



A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 6450 bytes --]

From 0394931310004016b7275480b50765f416fbdcc7 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/4] New package: spooles-2.2

---
 srcpkgs/spooles/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/spooles/template

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
new file mode 100644
index 000000000000..65ea946085e5
--- /dev/null
+++ b/srcpkgs/spooles/template
@@ -0,0 +1,24 @@
+# Template file for 'spooles'
+pkgname=spooles
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
+	done
+}

From 58afeb43d1ac13bbe38801e64eafb3e89b389c67 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:43:44 +0100
Subject: [PATCH 2/4] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..93f90b9fd7a0
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+build_wrksrc="ccx_${version}/src"
+hostmakedepends="gcc-fortran"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
+short_desc="3D Structural Finite Element Program - Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+
+_FFLAGS=" -O2 -fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
+do_build() {
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
+}
+
+do_install() {
+	vbin ccx_${version} ccx
+}

From 081d431f287211745b7dd2fda122ca572ae32f31 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:13 +0100
Subject: [PATCH 3/4] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 12 +++++++
 srcpkgs/CalculiX-cgx/template               | 35 +++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..dd2975a78dea
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,12 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..2806520f6914
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
+build_style="gnu-makefile"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${pkgname}-${version}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
+
+do_install() {
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
+}
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}

From 4f2f0a3a9176eef4e67e4fd620b73e00f42bedfd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:36 +0100
Subject: [PATCH 4/4] New package: CalculiX-2.20 (meta-package)

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [WIP] CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (93 preceding siblings ...)
  2022-10-31 14:25 ` Phicem
@ 2022-10-31 16:45 ` Phicem
  2022-11-04 21:44 ` New package: CalculiX-2.20 classabbyamp
                   ` (8 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-10-31 16:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1297374988

Comment:
I think the packages are ready for review!

`tetgen` binary is now built directly in CalculiX-cgx package.

I took all your comments into account (with one exception: I still use `make` instead of `cmake` for `tetgen` binary, because it's more practical since I can't use the `cmake` build method of `xbps-src`).

I also added a `-O2` flag in FFLAGS of CalculiX-ccx.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (94 preceding siblings ...)
  2022-10-31 16:45 ` Phicem
@ 2022-11-04 21:44 ` classabbyamp
  2022-11-04 21:44 ` classabbyamp
                   ` (7 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-11-04 21:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1304284769

Comment:
> I also added a `-O2` flag in FFLAGS of CalculiX-ccx.

it's already in there:


^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (95 preceding siblings ...)
  2022-11-04 21:44 ` New package: CalculiX-2.20 classabbyamp
@ 2022-11-04 21:44 ` classabbyamp
  2022-11-05 15:38 ` Phicem
                   ` (6 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: classabbyamp @ 2022-11-04 21:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1304284769

Comment:
> I also added a `-O2` flag in FFLAGS of CalculiX-ccx.

it's already in there:

https://github.com/void-linux/void-packages/blob/fedd1108fc54179047118be01acf0f057bc60647/etc/defaults.conf#L36-L38


^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (96 preceding siblings ...)
  2022-11-04 21:44 ` classabbyamp
@ 2022-11-05 15:38 ` Phicem
  2022-11-05 15:38 ` [PR PATCH] [Updated] " Phicem
                   ` (5 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-11-05 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1304569495

Comment:
Actually I used a variable named `_FFLAGS` instead of `FFLAGS`, because an xlint warning told me to prefix custom variables with`_`. I did not realize that this change of name would make me lose the benefit of getting default FFLAGS.

I will fix this and use `FFLAGS` directly, but I'm expecting that xlint test will fail. By the way, shouln't we add `FFLAGS` to the list of official variables recognized by xlint?

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (97 preceding siblings ...)
  2022-11-05 15:38 ` Phicem
@ 2022-11-05 15:38 ` Phicem
  2022-11-05 17:48 ` Phicem
                   ` (4 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-11-05 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

New package: CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- Cross-compiling to aarch64: **OK**

#### Runtime testing
- On x86_64 (glibc): **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: some calculation differences too)
- On i686: **NOT TESTED** 




A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 7682 bytes --]

From 0394931310004016b7275480b50765f416fbdcc7 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/5] New package: spooles-2.2

---
 srcpkgs/spooles/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/spooles/template

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
new file mode 100644
index 000000000000..65ea946085e5
--- /dev/null
+++ b/srcpkgs/spooles/template
@@ -0,0 +1,24 @@
+# Template file for 'spooles'
+pkgname=spooles
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
+	done
+}

From 58afeb43d1ac13bbe38801e64eafb3e89b389c67 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:43:44 +0100
Subject: [PATCH 2/5] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..93f90b9fd7a0
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+build_wrksrc="ccx_${version}/src"
+hostmakedepends="gcc-fortran"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
+short_desc="3D Structural Finite Element Program - Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+
+_FFLAGS=" -O2 -fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
+do_build() {
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
+}
+
+do_install() {
+	vbin ccx_${version} ccx
+}

From 081d431f287211745b7dd2fda122ca572ae32f31 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:13 +0100
Subject: [PATCH 3/5] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 12 +++++++
 srcpkgs/CalculiX-cgx/template               | 35 +++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..dd2975a78dea
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,12 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..2806520f6914
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
+build_style="gnu-makefile"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${pkgname}-${version}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
+
+do_install() {
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
+}
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}

From 4f2f0a3a9176eef4e67e4fd620b73e00f42bedfd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:36 +0100
Subject: [PATCH 4/5] New package: CalculiX-2.20 (meta-package)

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

From 153db3f6d1edee9ca0ba8b643f9f5132fc70a2df Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sat, 5 Nov 2022 16:26:04 +0100
Subject: [PATCH 5/5] ccx: Use FFLAGS instead of _FFLAGS to inherit from
 default flags

---
 srcpkgs/CalculiX-ccx/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
index 93f90b9fd7a0..26082bf93135 100644
--- a/srcpkgs/CalculiX-ccx/template
+++ b/srcpkgs/CalculiX-ccx/template
@@ -13,7 +13,7 @@ homepage="http://www.dhondt.de/"
 distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
 checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
 
-_FFLAGS=" -O2 -fallow-argument-mismatch"
+FFLAGS="-fallow-argument-mismatch"
 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
 
 post_patch() {
@@ -26,7 +26,7 @@ post_patch() {
 }
 
 do_build() {
-	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$_FFLAGS" \
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
 		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
 }
 

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (98 preceding siblings ...)
  2022-11-05 15:38 ` [PR PATCH] [Updated] " Phicem
@ 2022-11-05 17:48 ` Phicem
  2023-02-04  1:58 ` github-actions
                   ` (3 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2022-11-05 17:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

New comment by Phicem on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1304569495

Comment:
Actually I used a variable named `_FFLAGS` instead of `FFLAGS`, because an xlint warning told me to prefix custom variables with`_`. I did not realize that this change of name would make me lose the benefit of getting default FFLAGS.

I will fix this and use `FFLAGS` directly, but I'm expecting that xlint test will fail. By the way, shouln't we add `FFLAGS` to the list of official variables recognized by xlint?

(I keep this last change as a separate commit, I'll rebase if the change is okay.)

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (99 preceding siblings ...)
  2022-11-05 17:48 ` Phicem
@ 2023-02-04  1:58 ` github-actions
  2023-02-05 18:21 ` [PR PATCH] [Updated] " Phicem
                   ` (2 subsequent siblings)
  103 siblings, 0 replies; 105+ messages in thread
From: github-actions @ 2023-02-04  1:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1416600208

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Updated] New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (100 preceding siblings ...)
  2023-02-04  1:58 ` github-actions
@ 2023-02-05 18:21 ` Phicem
  2023-05-08  1:52 ` github-actions
  2023-05-22  1:57 ` [PR PATCH] [Closed]: " github-actions
  103 siblings, 0 replies; 105+ messages in thread
From: Phicem @ 2023-02-05 18:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

There is an updated pull request by Phicem against master on the void-packages repository

https://github.com/Phicem/void-packages CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

New package: CalculiX-2.20
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- Cross-compiling to aarch64: **OK**

#### Runtime testing
- On x86_64 (glibc): **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: some calculation differences too)
- On i686: **NOT TESTED** 




A patch file from https://github.com/void-linux/void-packages/pull/39984.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-CalculiX-2.20-39984.patch --]
[-- Type: text/x-diff, Size: 6443 bytes --]

From a0b5865c342a7e66f46d05baf9e6913381253778 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 16 Oct 2022 13:55:37 +0200
Subject: [PATCH 1/4] New package: spooles-2.2

---
 srcpkgs/spooles/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/spooles/template

diff --git a/srcpkgs/spooles/template b/srcpkgs/spooles/template
new file mode 100644
index 000000000000..65ea946085e5
--- /dev/null
+++ b/srcpkgs/spooles/template
@@ -0,0 +1,24 @@
+# Template file for 'spooles'
+pkgname=spooles
+version=2.2
+revision=1
+create_wrksrc=yes
+build_style="gnu-makefile"
+make_build_target="lib"
+hostmakedepends="perl"
+short_desc="SParse Object Oriented Linear Equations Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="Public Domain"
+homepage="https://netlib.org/linalg/spooles/spooles.2.2.html"
+distfiles="https://netlib.org/linalg/spooles/spooles.${version}.tgz"
+checksum=a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
+
+do_install() {
+	vinstall spooles.a 644 usr/lib
+	for file in *.h; do
+		vinstall ${file} 644 usr/include/$pkgname
+	done
+	for file in */*.h; do
+		vinstall ${file} 644 "usr/include/$pkgname/$(dirname $file)"
+	done
+}

From db46afa19f9702711eca18cdc24ca7c6bd4590cd Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:43:44 +0100
Subject: [PATCH 2/4] New package: CalculiX-ccx-2.20

---
 srcpkgs/CalculiX-ccx/template | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 srcpkgs/CalculiX-ccx/template

diff --git a/srcpkgs/CalculiX-ccx/template b/srcpkgs/CalculiX-ccx/template
new file mode 100644
index 000000000000..26082bf93135
--- /dev/null
+++ b/srcpkgs/CalculiX-ccx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-ccx'
+pkgname=CalculiX-ccx
+version=2.20
+revision=1
+wrksrc=CalculiX
+build_wrksrc="ccx_${version}/src"
+hostmakedepends="gcc-fortran"
+makedepends="spooles arpack-ng-devel libgomp-devel openblas-devel"
+short_desc="3D Structural Finite Element Program - Solver"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/ccx_${version}.src.tar.bz2"
+checksum=63bf6ea09e7edcae93e0145b1bb0579ea7ae82e046f6075a27c8145b72761bcf
+
+FFLAGS="-fallow-argument-mismatch"
+CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/spooles -DARCH=Linux -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT"
+
+post_patch() {
+	vsed -e 's,./date.pl; ,,' -i Makefile
+	# taken from date.pl, changed for reproducibility
+	vsed -e 's/You are using an executable made on.*/You are using an executable made on '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n");/g' \
+		-i ccx_$version.c -i CalculiXstep.c
+	vsed -e 's/COMPILETIME.*/COMPILETIME       '"$(date --utc --date @$SOURCE_DATE_EPOCH +%Y-%m-%d)"'\\n",p1);/g' \
+		-i frd.c
+}
+
+do_build() {
+	make CC="$CC" FC="$FC" CFLAGS="$CFLAGS" FFLAGS="$FFLAGS" \
+		LIBS="${XBPS_CROSS_BASE}/usr/lib/spooles.a ${XBPS_CROSS_BASE}/usr/lib/libarpack.so ${XBPS_CROSS_BASE}/usr/lib/libopenblas.so -lpthread -lm -lc"
+}
+
+do_install() {
+	vbin ccx_${version} ccx
+}

From bb9dec9ccc40d002eb1591a57edfdac3c8b9d429 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:13 +0100
Subject: [PATCH 3/4] New package: CalculiX-cgx-2.20

---
 srcpkgs/CalculiX-cgx/patches/Makefile.patch | 12 +++++++
 srcpkgs/CalculiX-cgx/template               | 35 +++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 srcpkgs/CalculiX-cgx/patches/Makefile.patch
 create mode 100644 srcpkgs/CalculiX-cgx/template

diff --git a/srcpkgs/CalculiX-cgx/patches/Makefile.patch b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
new file mode 100644
index 000000000000..dd2975a78dea
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/patches/Makefile.patch
@@ -0,0 +1,12 @@
+--- a/CalculiX/cgx_2.20/src/Makefile
++++ b/CalculiX/cgx_2.20/src/Makefile
+@@ -67,7 +67,7 @@
+ 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/srcpkgs/CalculiX-cgx/template b/srcpkgs/CalculiX-cgx/template
new file mode 100644
index 000000000000..2806520f6914
--- /dev/null
+++ b/srcpkgs/CalculiX-cgx/template
@@ -0,0 +1,35 @@
+# Template file for 'CalculiX-cgx'
+pkgname=CalculiX-cgx
+version=2.20
+revision=1
+create_wrksrc=yes
+build_wrksrc="CalculiX/cgx_${version}/src"
+build_style="gnu-makefile"
+makedepends="glu-devel libglvnd-devel libXmu-devel libXi-devel"
+short_desc="3D Structural Finite Element Program - Graphical interface"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-or-later, custom:GLUT"
+homepage="http://www.dhondt.de/"
+distfiles="http://www.dhondt.de/cgx_${version}.all.tar.bz2"
+checksum=f4c840c3633718547e33f86b2d7bc6b35608dd8d6cbf9fa192cecef34f2dc908
+CFLAGS="-DSEMINIT -I. -I${XBPS_CROSS_BASE}/usr/include/GL -I${XBPS_CROSS_BASE}/usr/X11/include -I../../libSNL/src -I../../glut-3.5/src"
+_tetgen_version=1.5.1
+_tetgen_dir=${XBPS_BUILDDIR}/${pkgname}-${version}/tetgen${_tetgen_version}
+
+post_build() {
+	make -C ${_tetgen_dir}  CC=$CC CXX=$CXX CFLAGS="$CFLAGS" tetgen tetlib
+}
+
+do_install() {
+	vbin cgx
+	vlicense ../README CGX_LICENSE
+	vlicense ../../glut-3.5/NOTICE GLUT_LICENSE
+	vbin ${_tetgen_dir}/tetgen
+	vinstall ${_tetgen_dir}/libtet.a 644 usr/lib
+	vlicense ${_tetgen_dir}/LICENSE TETGEN_LICENSE
+}
+
+post_extract() {
+	bsdtar -xvf tetgen${_tetgen_version}.tar
+	rm tetgen${_tetgen_version}.tar
+}

From f680f21f1a1547b8194e922a4db341c287eb5744 Mon Sep 17 00:00:00 2001
From: Phicem <phicem@gmx.com>
Date: Sun, 30 Oct 2022 09:44:36 +0100
Subject: [PATCH 4/4] New package: CalculiX-2.20 (meta-package)

---
 srcpkgs/CalculiX/template | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 srcpkgs/CalculiX/template

diff --git a/srcpkgs/CalculiX/template b/srcpkgs/CalculiX/template
new file mode 100644
index 000000000000..b807d972e945
--- /dev/null
+++ b/srcpkgs/CalculiX/template
@@ -0,0 +1,10 @@
+# Template file for 'CalculiX'
+pkgname=CalculiX
+version=2.20
+revision=1
+build_style=meta
+depends="CalculiX-cgx-${version}_${revision} CalculiX-ccx-${version}_${revision}"
+short_desc="3D Structural Finite Element Program"
+maintainer="Phicem <phicem@gmx.com>"
+license="GPL-2.0-only"
+homepage="http://www.dhondt.de/"

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (101 preceding siblings ...)
  2023-02-05 18:21 ` [PR PATCH] [Updated] " Phicem
@ 2023-05-08  1:52 ` github-actions
  2023-05-22  1:57 ` [PR PATCH] [Closed]: " github-actions
  103 siblings, 0 replies; 105+ messages in thread
From: github-actions @ 2023-05-08  1:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/39984#issuecomment-1537627408

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 105+ messages in thread

* Re: [PR PATCH] [Closed]: New package: CalculiX-2.20
  2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
                   ` (102 preceding siblings ...)
  2023-05-08  1:52 ` github-actions
@ 2023-05-22  1:57 ` github-actions
  103 siblings, 0 replies; 105+ messages in thread
From: github-actions @ 2023-05-22  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]

There's a closed pull request on the void-packages repository

New package: CalculiX-2.20
https://github.com/void-linux/void-packages/pull/39984

Description:
### NEW PACKAGE - CalculiX

This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

CalculiX is a 3D finite element program. It is an optional but important dependency of FreeCAD (for mechanical and thermal calculations). This PR is related to issue https://github.com/void-linux/void-packages/issues/5603.

CalculiX is split in two parts: the solver (CalculiX-ccx) and the graphical interface and pre/post-processing (CalculiX-cgx).

This PR includes 4 packages, each in a separate commit:
- spooles (build dependency for CalculiX-ccx)
- CalculiX-ccx
- CalculiX-cgx (including tetgen binary)
- CalculiX meta-package (which brings CalculiX-ccx and CalculiX-cgx)


### Tests
#### Local build testing
- Native x86_64 (glibc and musl): **OK**
- Native i686 (glibc) (from an x86_64 machine) : **OK**
- Native armv7l (glibc): **OK**

#### Cross build testing (from x86_64 machine)
- Cross-compiling to armv7l: **OK** (requires using `./xbps-src binary-boostrap i686` on an x86_64 system, otherwise it fails)
- Cross-compiling to aarch64: **OK**

#### Runtime testing
- On x86_64 (glibc): **OK** (for CalculiX-ccx: some calculation tests differ from the official reference results files)
- On armv7l: **OK** (for CalculiX-ccx: some calculation differences too)
- On i686: **NOT TESTED** 




^ permalink raw reply	[flat|nested] 105+ messages in thread

end of thread, other threads:[~2023-05-22  1:57 UTC | newest]

Thread overview: 105+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 10:05 [PR PATCH] CalculiX-2.20 Phicem
2022-10-16 10:21 ` [PR REVIEW] CalculiX-2.20 classabbyamp
2022-10-16 10:21 ` classabbyamp
2022-10-16 11:22 ` Phicem
2022-10-16 11:23 ` paper42
2022-10-16 11:23 ` paper42
2022-10-16 11:37 ` Phicem
2022-10-16 11:46 ` Phicem
2022-10-16 18:27 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
2022-10-16 18:30 ` [PR REVIEW] CalculiX-2.20 Phicem
2022-10-16 18:33 ` CalculiX-2.20 Phicem
2022-10-16 19:38 ` [PR PATCH] [Updated] CalculiX-2.20 Phicem
2022-10-16 19:40 ` CalculiX-2.20 Phicem
2022-10-16 20:41 ` CalculiX-2.20 Phicem
2022-10-17 23:56 ` [PR REVIEW] CalculiX-2.20 classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-17 23:56 ` classabbyamp
2022-10-18  2:34 ` ahesford
2022-10-18  2:34 ` ahesford
2022-10-18  6:38 ` 0x5c
2022-10-18  6:42 ` classabbyamp
2022-10-22  7:49 ` CalculiX-2.20 Phicem
2022-10-22  8:07 ` [PR REVIEW] [WIP] CalculiX-2.20 Phicem
2022-10-22  8:10 ` Phicem
2022-10-22  8:48 ` Phicem
2022-10-22  8:50 ` [PR PATCH] [Updated] " Phicem
2022-10-22  9:03 ` [PR REVIEW] " Phicem
2022-10-22 11:55 ` 0x5c
2022-10-22 11:55 ` 0x5c
2022-10-22 19:17 ` Phicem
2022-10-23  7:11 ` 0x5c
2022-10-23  9:35 ` Phicem
2022-10-23  9:35 ` [PR PATCH] [Updated] " Phicem
2022-10-23  9:59 ` [PR REVIEW] " Phicem
2022-10-23 10:00 ` [PR PATCH] [Updated] " Phicem
2022-10-23 10:00 ` Phicem
2022-10-23 11:20 ` Phicem
2022-10-23 11:39 ` Phicem
2022-10-23 11:42 ` Phicem
2022-10-23 13:14 ` [PR REVIEW] " ahesford
2022-10-23 13:15 ` ahesford
2022-10-23 13:25 ` ahesford
2022-10-23 16:50 ` [PR PATCH] [Updated] " Phicem
2022-10-23 16:52 ` [PR REVIEW] " Phicem
2022-10-23 18:25 ` [PR PATCH] [Updated] " Phicem
2022-10-23 18:29 ` [PR REVIEW] " Phicem
2022-10-23 18:49 ` Phicem
2022-10-23 18:51 ` [PR PATCH] [Updated] " Phicem
2022-10-23 19:56 ` [PR REVIEW] " Phicem
2022-10-23 20:02 ` classabbyamp
2022-10-26  6:37 ` Phicem
2022-10-26  7:45 ` [PR PATCH] [Updated] " Phicem
2022-10-26  7:47 ` Phicem
2022-10-26  7:55 ` Phicem
2022-10-26  7:56 ` Phicem
2022-10-26  8:02 ` Phicem
2022-10-26  8:03 ` Phicem
2022-10-26  8:13 ` Phicem
2022-10-26  8:13 ` Phicem
2022-10-26  9:35 ` [PR REVIEW] " Phicem
2022-10-26  9:37 ` [PR PATCH] [Updated] " Phicem
2022-10-26  9:41 ` Phicem
2022-10-26 10:01 ` Phicem
2022-10-26 10:46 ` Phicem
2022-10-26 16:42 ` Phicem
2022-10-26 19:18 ` Phicem
2022-10-26 19:25 ` [PR REVIEW] " Phicem
2022-10-30 20:31 ` [PR PATCH] [Updated] " Phicem
2022-10-31 14:17 ` Phicem
2022-10-31 14:25 ` Phicem
2022-10-31 16:45 ` Phicem
2022-11-04 21:44 ` New package: CalculiX-2.20 classabbyamp
2022-11-04 21:44 ` classabbyamp
2022-11-05 15:38 ` Phicem
2022-11-05 15:38 ` [PR PATCH] [Updated] " Phicem
2022-11-05 17:48 ` Phicem
2023-02-04  1:58 ` github-actions
2023-02-05 18:21 ` [PR PATCH] [Updated] " Phicem
2023-05-08  1:52 ` github-actions
2023-05-22  1:57 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).