# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup cmake 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup compilers 1.0 PortGroup github 1.0 PortGroup legacysupport 1.1 github.setup NGSolve netgen 6.2.2307 v revision 0 categories math license LGPL-2 maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer description NETGEN is an automatic 3d tetrahedral mesh generator long_description ${description}. It accepts input from constructive \ solid geometry (CSG) or boundary representation (BRep) \ from STL file format. The connection to a geometry kernel \ allows the handling of IGES and STEP files. NETGEN contains \ modules for mesh optimization and hierarchical mesh \ refinement. homepage https://ngsolve.org/ checksums rmd160 1a37d234b5081600b572f1e0a86c97c0e233ebf6 \ sha256 e62a9cca2e727797dddadf04de308594f46863f2cac47adb5f51bd8b8c7884aa \ size 3427060 github.tarball_from archive compiler.cxx_standard 2017 # https://trac.macports.org/ticket/60760 compiler.blacklist-append {clang < 1000} compilers.choose cc cxx compilers.setup # Enable use of 'macports-libcxx' for macOS 10.14 and earlier, as port uses # libcxx features normally only available on 10.15 and later. legacysupport.use_mp_libcxx \ yes legacysupport.newest_darwin_requires_legacy \ 18 # Netgen(55088) malloc: *** error for object 0x1587968: Non-aligned pointer being freed legacysupport.redirect_bins netgen patchfiles-append patch-no-external.diff \ patch-no-pybind.diff \ patch-CMakeLists.txt.diff \ patch-no-console.diff \ patch-link-against-ffmpeg.diff \ patch-cmake-version.diff \ patch-MacPorts-rpath.diff \ patch-MacPorts-togl.diff \ patch-ensure_gui_defines.diff \ patch-propagate_c_compiler.diff \ patch-utils.hpp.diff \ patch-encoding.diff \ patch-unbreak-netgen-targets.diff depends_lib-append port:zlib \ port:tcl \ port:tk \ port:tkdnd \ port:Togl \ path:lib/libavcodec.dylib:ffmpeg \ path:include/turbojpeg.h:libjpeg-turbo configure.args-append -DUSE_NATIVE_ARCH=OFF \ -DUSE_PYTHON=OFF \ -DPREFER_SYSTEM_PYBIND11=ON \ -DTCL_INCLUDE_PATH:PATH=${prefix}/include \ -DTK_INCLUDE_PATH:PATH=${prefix}/include \ -DOPENGL_glu_LIBRARY="" \ -DNETGEN_VERSION_GIT="v${version}" \ -DUSE_JPEG=ON \ -DUSE_MPEG=ON \ -DUSE_OCC=OFF \ -DUSE_SUPERBUILD=OFF set pythonversions {3.9 3.10 3.11} set any_python no foreach pdv ${pythonversions} { set pv [join [lrange [split ${pdv} .] 0 1] ""] set conflist "" foreach v ${pythonversions} { if {${v} ne ${pdv}} { set vv [join [lrange [split ${v} .] 0 1] ""] set conflist "${conflist} python${vv}" } } variant python${pv} conflicts {*}${conflist} description "Add bindings for Python ${pdv}" {} if {[variant_isset python${pv}]} { set any_python yes } } if {!${any_python}} { default_variants +python311 } foreach pdv ${pythonversions} { set pv [join [lrange [split ${pdv} .] 0 1] ""] if {[variant_isset python${pv}]} { depends_lib-append port:python${pv} \ port:pybind11 \ port:py${pv}-pybind11-stubgen depends_run-append port:py${pv}-tkinter configure.args-replace -DUSE_PYTHON=OFF \ -DUSE_PYTHON=ON # Choosing Python version does not work. # https://gitlab.kitware.com/cmake/cmake/-/issues/23139 # https://github.com/NGSolve/netgen/issues/174 patchfiles-append patch-use-right-python.diff post-patch { reinplace "s|@PV@|${pdv}|g" ${worksrcpath}/CMakeLists.txt } configure.args-append -DPYBIND_INCLUDE_DIR=${prefix}/include \ -DPYTHON3_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/${pdv}/bin/python${pdv} destroot.args-append DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \ PYTHONPATH=${destroot}${prefix}/lib/python${pdv}/site-packages post-destroot { xinstall -d -m 0755 \ ${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib move ${destroot}${prefix}/lib/python${pdv} \ ${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib } break } } variant quartz conflicts x11 { require_active_variants tk quartz require_active_variants tkdnd quartz require_active_variants Togl quartz # OpenGL/gl3.h does not exist prior to 10.7. # https://github.com/NGSolve/netgen/issues/173 patchfiles-append patch-opengl.diff post-patch { reinplace "s|MACPORTS_NO_X11|TRUE|g" \ ${worksrcpath}/CMakeLists.txt } } variant x11 conflicts quartz { require_active_variants tk x11 require_active_variants tkdnd x11 require_active_variants Togl x11 depends_lib-append port:xorg-libX11 \ port:xorg-libXmu \ port:mesa depends_build-append port:libGLU # Use appropriate headers: patchfiles-append patch-x11-gl.diff configure.args-append -DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib } if {![variant_isset quartz] && ![variant_isset x11]} { default_variants +x11 } pre-configure { if {![variant_isset quartz] && ![variant_isset x11]} { error "Either +x11 or +quartz is required" } } post-destroot { delete ${destroot}${prefix}/bin/Netgen1 delete ${destroot}${prefix}/bin/startup.sh xinstall -d -m 0755 ${destroot}${applications_dir}/Netgen.app/Contents/Resources xinstall -d -m 0755 ${destroot}${applications_dir}/Netgen.app/Contents/MacOS ln -s \ ${prefix}/bin/netgen \ ${destroot}${applications_dir}/Netgen.app/Contents/MacOS/Netgen move \ ${destroot}${prefix}/Info.plist \ ${destroot}${applications_dir}/Netgen.app/Contents move \ ${destroot}${prefix}/Netgen.icns \ ${destroot}${applications_dir}/Netgen.app/Contents/Resources } variant tests description {Enable tests} { test.run yes configure.args-append -DENABLE_UNIT_TESTS=ON test.args-append DYLD_LIBRARY_PATH=${cmake.build_dir}:${cmake.build_dir}/libsrc/core if {${any_python}} { depends_test-append port:py${pv}-pytest \ port:py${pv}-numpy \ port:py${pv}-pytest-check # this is not good, but it is unclear what PYTHONPATH should be if destroot has not run target_requires ${org.macports.test} main fetch checksum extract patch configure build destroot test.args-append PYTHONPATH=${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib/python${pdv}/site-packages } }