Friday, January 17, 2025

Re: [new] cad/netgen-mesher and devel/py-test-check

2025-01-16T15:07:37+0000 Stuart Henderson <stu@spacehopper.org>:
> On 2025/01/15 21:49, Johannes Thyssen Tishman wrote:
> > 2025-01-15T19:10:23Z Ian Darwin <ian@darwinsys.com>:
> >
> > > On 1/7/25 12:46 PM, Johannes Thyssen Tishman wrote:
> > > > Please find attached a port for cad/netgen-mesher and one of its test
> > > > dependencies devel/py-test-check. This port is required by
> > > > cad/freecad,
> > > > a port I intend to submit once it's dependencies have been comitted.
>
> $ head -1 pkg/PLIST
> @conflict netgen-*
>
> This is likely to be a problem. As it provides a library I guess freecad
> will need it at build time, not just install time. We can't have two
> ports which are in-conflict as BUILD or LIB_DEPENDS of other ports (the
> existing netgen is a BDEP of qflow) because it will cause bulk builds
> to fail sometimes.
>
> Currently only the file /usr/local/bin/netgen conflicts. It would be
> preferable to rename in one or other port to avoid the conflict.
> cad/netgen got there first, so I think it would be preferable to
> rename this one.

I see, thank you for the explanation Stuart. I have renamed the binary.

> > > > $ portcheck
> > > > Python module without compiled version, consider using
> > > > ${MODPY_COMPILEALL}: share/netgen/py_tutorials/exportNeutral.py
> > > >
> > > > Python module without compiled version, consider using
> > > > ${MODPY_COMPILEALL}: share/netgen/py_tutorials/mesh.py
> > > > cad/netgen-mesher
> > >
> > > Dunno if these matter, since it builds. Otherwise ok ian@
> >
> > I ignored these as they are tutorials/examples. I'm indifferent about their
> > installation, so we can also leave them out if it's preferred. Thanks Ian.
>
> portcheck is annoying. It whines about this non-problem (only modules
> that get imported by other Python code should be bytecode-compiled -
> despite missing #! these are just standalone example scripts), but
> not about hardcoding python3.12/tcl86/tk86 in WANTLIB.
>
> Here's an updated set of WANTLIB lines.
>
> WANTLIB += ${COMPILER_LIBCXX} ${MODPY_WANTLIB} ${MODTK_WANTLIB}
> WANTLIB += GL GLU TKBO TKBRep TKBool TKCAF TKCDF TKDE TKDEIGES
> WANTLIB += TKDESTEP TKDESTL TKFillet TKG2d TKG3d TKGeomAlgo TKGeomBase
> WANTLIB += TKHLR TKLCAF TKMath TKMesh TKOffset TKPrim TKService
> WANTLIB += TKShHealing TKTopAlgo TKV3d TKVCAF TKXCAF TKXSBase
> WANTLIB += TKernel X11 Xmu c execinfo fontconfig freetype jpeg
> WANTLIB += m z

It seems that after moving the tutorials/examples under
${LOCALBASE}/share/examples, portcheck does not complain anymore.

> Other small things, the doc should be renamed to the ports-standard
> location:
>
> share/netgen/doc/ng4.pdf -> share/doc/netgen-mesher/ng4.pdf
>
> and also perhaps share/netgen/py_tutorials -> share/examples/netgen-mesher?

For the sake of consistency, I opted for leaving out the '-mesher'
suffix for these directories and only renamed the binary. I tried
renaming all installed directories to include the '-mesher' suffix (this
can be done easily with NG_INSTALL_SUFFIX and NG_INSTALL_DIR_INCLUDE),
but then tests failed as python wouldn't find the netgen-mesher module.
I suppose this could be patched as well somehow, but I'm not sure this
is worth the trouble. Otherwise, please let me know and I'll revise the
port again.

Please find an updated tarball attached and, for convenience, a diff
with the changes.

diff /usr/ports/mystuff
path + /usr/ports/mystuff
commit - 2d26a6b1039aff6acec39167a2f00f817aaf43fc
blob - 9c49c80997992953f1e67bf8b8941f794dbd4621
file + cad/netgen-mesher/Makefile
--- cad/netgen-mesher/Makefile
+++ cad/netgen-mesher/Makefile
@@ -12,12 +12,13 @@ MAINTAINER = Johannes Thyssen Tishman <ports@thyssent
# LGPLv2.1
PERMIT_PACKAGE = Yes

-WANTLIB += ${COMPILER_LIBCXX} GL GLU TKBO TKBRep TKBool TKCAF
-WANTLIB += TKCDF TKDE TKDEIGES TKDESTEP TKDESTL TKFillet TKG2d
-WANTLIB += TKG3d TKGeomAlgo TKGeomBase TKHLR TKLCAF TKMath TKMesh
-WANTLIB += TKOffset TKPrim TKService TKShHealing TKTopAlgo TKV3d
-WANTLIB += TKVCAF TKXCAF TKXSBase TKernel X11 Xmu c execinfo fontconfig
-WANTLIB += freetype jpeg m python3.12 tcl86 tk86 z
+WANTLIB += ${COMPILER_LIBCXX} ${MODPY_WANTLIB} ${MODTK_WANTLIB}
+WANTLIB += GL GLU TKBO TKBRep TKBool TKCAF TKCDF TKDE TKDEIGES
+WANTLIB += TKDESTEP TKDESTL TKFillet TKG2d TKG3d TKGeomAlgo TKGeomBase
+WANTLIB += TKHLR TKLCAF TKMath TKMesh TKOffset TKPrim TKService
+WANTLIB += TKShHealing TKTopAlgo TKV3d TKVCAF TKXCAF TKXSBase
+WANTLIB += TKernel X11 Xmu c execinfo fontconfig freetype jpeg
+WANTLIB += m z

COMPILER = base-clang ports-gcc
MODULES = devel/cmake \
@@ -62,6 +63,7 @@ CONFIGURE_ARGS += -DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DTK_STUB_LIBRARY=${LOCALBASE}/lib/libtkstub${MODTK_VERSION:S/.//}.a

post-install:
+ mv ${PREFIX}/bin/netgen ${PREFIX}/bin/netgen-mesher
${MODPY_COMPILEALL} \
${WRKINST}${MODPY_SITEPKG}/netgen \
${WRKINST}${MODPY_SITEPKG}/pyngcore
commit - 779aeeae035e742ff7ebc02e27af1cfa156fac1e
blob - /dev/null
file + cad/netgen-mesher/patches/patch-doc_CMakeLists_txt (mode 644)
--- /dev/null
+++ cad/netgen-mesher/patches/patch-doc_CMakeLists_txt
@@ -0,0 +1,6 @@
+Index: doc/CMakeLists.txt
+--- doc/CMakeLists.txt.orig
++++ doc/CMakeLists.txt
+@@ -1 +1 @@
+-INSTALL(FILES ng4.pdf DESTINATION ${NG_INSTALL_DIR_RES}/${NG_INSTALL_SUFFIX}/doc COMPONENT netgen_doc)
++INSTALL(FILES ng4.pdf DESTINATION ${NG_INSTALL_DIR_RES}/doc/${NG_INSTALL_SUFFIX} COMPONENT netgen_doc)
commit - 779aeeae035e742ff7ebc02e27af1cfa156fac1e
blob - /dev/null
file + cad/netgen-mesher/patches/patch-py_tutorials_CMakeLists_txt (mode 644)
--- /dev/null
+++ cad/netgen-mesher/patches/patch-py_tutorials_CMakeLists_txt
@@ -0,0 +1,10 @@
+Index: py_tutorials/CMakeLists.txt
+--- py_tutorials/CMakeLists.txt.orig
++++ py_tutorials/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ install( FILES
+ shaft.geo mesh.py exportNeutral.py
+- DESTINATION ${NG_INSTALL_DIR_RES}/${NG_INSTALL_SUFFIX}/py_tutorials
++ DESTINATION ${NG_INSTALL_DIR_RES}/examples/${NG_INSTALL_SUFFIX}/py_tutorials
+ COMPONENT netgen_tutorial
+ )
commit - 779aeeae035e742ff7ebc02e27af1cfa156fac1e
blob - /dev/null
file + cad/netgen-mesher/patches/patch-tutorials_CMakeLists_txt (mode 644)
--- /dev/null
+++ cad/netgen-mesher/patches/patch-tutorials_CMakeLists_txt
@@ -0,0 +1,11 @@
+Index: tutorials/CMakeLists.txt
+--- tutorials/CMakeLists.txt.orig
++++ tutorials/CMakeLists.txt
+@@ -7,6 +7,6 @@ install( FILES
+ twobricks.geo twocubes.geo twocyl.geo boundarycondition.geo
+ hinge.stl part1.stl frame.step screw.step
+ squarehole.in2d squarecircle.in2d square.in2d
+- DESTINATION ${NG_INSTALL_DIR_RES}/${NG_INSTALL_SUFFIX}
++ DESTINATION ${NG_INSTALL_DIR_RES}/examples/${NG_INSTALL_SUFFIX}
+ COMPONENT netgen_tutorial
+ )
commit - 47b88306af46c79c7fe1239d3706e681c6bc2343
blob - 565424c1d57635c38899e6e1af18ba3ae7b25354
file + cad/netgen-mesher/pkg/PLIST
--- cad/netgen-mesher/pkg/PLIST
+++ cad/netgen-mesher/pkg/PLIST
@@ -1,5 +1,4 @@
-@conflict netgen-*
-@bin bin/netgen
+@bin bin/netgen-mesher
include/netgen/
include/netgen/core/
include/netgen/core/archive.hpp
@@ -275,49 +274,49 @@ ${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packag
lib/python${MODPY_VERSION}/site-packages/pyngcore/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
lib/python${MODPY_VERSION}/site-packages/pyngcore/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
@so lib/python${MODPY_VERSION}/site-packages/pyngcore/pyngcore.${MODPY_PYC_MAGIC_TAG}so
-share/netgen/
-share/netgen/boundarycondition.geo
-share/netgen/boxcyl.geo
-share/netgen/circle_on_cube.geo
-share/netgen/cone.geo
-share/netgen/cube.geo
-share/netgen/cubeandring.geo
-share/netgen/cubeandspheres.geo
-share/netgen/cubemcyl.geo
-share/netgen/cubemsphere.geo
-share/netgen/cylinder.geo
-share/netgen/cylsphere.geo
-share/netgen/doc/
-share/netgen/doc/ng4.pdf
-share/netgen/ellipsoid.geo
-share/netgen/ellipticcyl.geo
-share/netgen/extrusion.geo
-share/netgen/fichera.geo
-share/netgen/frame.step
-share/netgen/hinge.stl
-share/netgen/lshape3d.geo
-share/netgen/manyholes.geo
-share/netgen/manyholes2.geo
-share/netgen/matrix.geo
-share/netgen/ortho.geo
-share/netgen/part1.stl
-share/netgen/period.geo
-share/netgen/py_tutorials/
-share/netgen/py_tutorials/exportNeutral.py
-share/netgen/py_tutorials/mesh.py
-share/netgen/py_tutorials/shaft.geo
-share/netgen/revolution.geo
-share/netgen/screw.step
-share/netgen/sculpture.geo
-share/netgen/shaft.geo
-share/netgen/shell.geo
-share/netgen/sphere.geo
-share/netgen/sphereincube.geo
-share/netgen/square.in2d
-share/netgen/squarecircle.in2d
-share/netgen/squarehole.in2d
-share/netgen/torus.geo
-share/netgen/trafo.geo
-share/netgen/twobricks.geo
-share/netgen/twocubes.geo
-share/netgen/twocyl.geo
+share/doc/netgen/
+share/doc/netgen/ng4.pdf
+share/examples/netgen/
+share/examples/netgen/boundarycondition.geo
+share/examples/netgen/boxcyl.geo
+share/examples/netgen/circle_on_cube.geo
+share/examples/netgen/cone.geo
+share/examples/netgen/cube.geo
+share/examples/netgen/cubeandring.geo
+share/examples/netgen/cubeandspheres.geo
+share/examples/netgen/cubemcyl.geo
+share/examples/netgen/cubemsphere.geo
+share/examples/netgen/cylinder.geo
+share/examples/netgen/cylsphere.geo
+share/examples/netgen/ellipsoid.geo
+share/examples/netgen/ellipticcyl.geo
+share/examples/netgen/extrusion.geo
+share/examples/netgen/fichera.geo
+share/examples/netgen/frame.step
+share/examples/netgen/hinge.stl
+share/examples/netgen/lshape3d.geo
+share/examples/netgen/manyholes.geo
+share/examples/netgen/manyholes2.geo
+share/examples/netgen/matrix.geo
+share/examples/netgen/ortho.geo
+share/examples/netgen/part1.stl
+share/examples/netgen/period.geo
+share/examples/netgen/py_tutorials/
+share/examples/netgen/py_tutorials/exportNeutral.py
+share/examples/netgen/py_tutorials/mesh.py
+share/examples/netgen/py_tutorials/shaft.geo
+share/examples/netgen/revolution.geo
+share/examples/netgen/screw.step
+share/examples/netgen/sculpture.geo
+share/examples/netgen/shaft.geo
+share/examples/netgen/shell.geo
+share/examples/netgen/sphere.geo
+share/examples/netgen/sphereincube.geo
+share/examples/netgen/square.in2d
+share/examples/netgen/squarecircle.in2d
+share/examples/netgen/squarehole.in2d
+share/examples/netgen/torus.geo
+share/examples/netgen/trafo.geo
+share/examples/netgen/twobricks.geo
+share/examples/netgen/twocubes.geo
+share/examples/netgen/twocyl.geo

No comments:

Post a Comment