<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/b1459abd5c392d99a26150fb47ee4be55a40ec33">https://github.com/macports/macports-ports/commit/b1459abd5c392d99a26150fb47ee4be55a40ec33</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b1459abd5c392d99a26150fb47ee4be55a40ec33
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sat Mar 7 06:26:27 2020 -0700
<span style='display:block; white-space:pre;color:#404040;'> netgen: add variants for different Python versions
</span>---
math/netgen/Portfile | 62 ++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 46 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/netgen/Portfile b/math/netgen/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index c1b8545..aaefe26 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/netgen/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/netgen/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,6 +7,7 @@ PortGroup cmake 1.1
</span> PortGroup active_variants 1.1
github.setup NGSolve netgen 6.2.1910 v
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span> platforms darwin
categories math
license LGPL-2
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -40,31 +41,66 @@ patchfiles-append patch-CMakeLists.txt.diff
</span> # see https://wiki.tcl-lang.org/page/console+hide
patchfiles-append patch-no-console.diff
<span style='display:block; white-space:pre;background:#ffe0e0;'>-set python_branch 3.7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set python_version [string map {. ""} ${python_branch}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> depends_lib-append port:zlib \
port:tcl \
port:tk \
port:tkdnd \
port:Togl \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- port:python${python_version} \
</span> path:lib/libavcodec.dylib:ffmpeg \
port:jpeg
<span style='display:block; white-space:pre;background:#ffe0e0;'>-depends_build-append port:pybind11
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-depends_run-append port:py${python_version}-tkinter
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> configure.args-append -DUSE_NATIVE_ARCH=OFF \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- -DPYBIND_INCLUDE_DIR=${prefix}/include \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/${python_branch}/bin/python${python_branch} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_PYTHON=OFF \
</span> -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
-DTK_INCLUDE_PATH:PATH=${prefix}/include \
-DOPENGL_glu_LIBRARY="" \
-DUSE_JPEG=ON \
-DUSE_MPEG=ON
<span style='display:block; white-space:pre;background:#e0ffe0;'>+set pythonversions {3.7 3.8}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set any_python no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach pdv ${pythonversions} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set pv [join [lrange [split ${pdv} .] 0 1] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set conflist ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach v ${pythonversions} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${v} ne ${pdv}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set vv [join [lrange [split ${v} .] 0 1] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set conflist "${conflist} python${vv}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ variant python${pv} conflicts {*}${conflist} description "Add bindings for Python ${pdv}" {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[variant_isset python${pv}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set any_python yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {!${any_python}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default_variants +python38
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach pdv ${pythonversions} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set pv [join [lrange [split ${pdv} .] 0 1] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # settings that depend on loop variables must be set in an appropriate if, not in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # variant declaration scope.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[variant_isset python${pv}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:python${pv} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:pybind11
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_run-append port:py${pv}-tkinter
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-replace -DUSE_PYTHON=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_PYTHON=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-append -DPYBIND_INCLUDE_DIR=${prefix}/include \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/${pdv}/bin/python${pdv}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib/python${pdv}/site-packages
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${prefix}/lib/python${pdv}/site-packages/netgen \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib/python${pdv}/site-packages/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> variant quartz conflicts x11 {
require_active_variants tk quartz
require_active_variants tkdnd quartz
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -128,10 +164,4 @@ post-destroot {
</span> move \
${destroot}${prefix}/Netgen.icns \
${destroot}${applications_dir}/Netgen.app/Contents/Resources
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -d -m 0755 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${frameworks_dir}/Python.framework/Versions/${python_branch}/lib/python${python_branch}/site-packages
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -s \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${prefix}/lib/python${python_branch}/site-packages/netgen \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${frameworks_dir}/Python.framework/Versions/${python_branch}/lib/python${python_branch}/site-packages/
</span> }
</pre><pre style='margin:0'>
</pre>