<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/715f204431cf6a64fb6f17b48a28ede531543968">https://github.com/macports/macports-ports/commit/715f204431cf6a64fb6f17b48a28ede531543968</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 715f204431cf6a64fb6f17b48a28ede531543968
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sat Mar 11 01:26:39 2023 -0700
<span style='display:block; white-space:pre;color:#404040;'> lua-1.0: new PortGroup
</span>---
_resources/port1.0/group/lua-1.0.tcl | 137 +++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/lua-1.0.tcl b/_resources/port1.0/group/lua-1.0.tcl
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..3ae86172cdf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/lua-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,137 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- 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
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Group code to manage use of Lua subports
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Usage:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PortGroup lua 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# see below for a list of options
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# global is used on several of the options since Lua is often used inside a variant
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup conflicts_build 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Lua version to use
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.version {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# location of Lua installation
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.dir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.dir {[expr {${lua.version} eq "" ? ${prefix} : "${prefix}/libexec/lua[join [split ${lua.version} .] {}]"}]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.dir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Lua binary
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.bin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.bin {${prefix}/bin/lua${lua.version}}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.bin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Lua include directory in ${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.include {[expr {${lua.version} eq "" ? "${prefix}/include" : "${prefix}/include/lua${lua.version}"}]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Lua library
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.lib {${prefix}/lib/liblua${lua.version}.dylib}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.lib {${prefix}/lib/liblua${lua.version}.dylib}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Lua modules required
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.modules
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.modules {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# port finds unversioned Lua installation even if not desired
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.finds_default
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.finds_default {no}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# port finds versioned Lua installation even if not desired
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.finds_versioned
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.finds_versioned {no}
</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;'>+# internal procedures
</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;'>+# default Lua version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.default_version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.default_version {5.3}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+global lua.default_version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# all Lua versions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options lua.branches
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default lua.branches {5.4 5.3 5.2 5.1}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+namespace eval lua {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc lua::callback {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global prefix \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lua.version \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lua.dir \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ env
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-delete port:lua[join [split ${lua.version} .] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:lua[join [split ${lua.version} .] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${lua.version} ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set module_branch_no_dot [join [split ${lua.version} .] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set module_branch_no_dot [join [split [option lua.default_version] .] ""]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach m [option lua.modules] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-delete port:lua${module_branch_no_dot}-${m}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:lua${module_branch_no_dot}-${m}
</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;'>+ # CMake modules FindLua.cmake and FindLua51.cmake use LUA_DIR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.env-delete LUA_DIR=${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.env-append LUA_DIR=${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # attempt to have port find correct Lua version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${lua.version} ne "" && ${lua.dir} ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cppflags-delete -I${lua.dir}/include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cppflags-prepend -I${lua.dir}/include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.ldflags-delete -L${lua.dir}/lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.ldflags-prepend -L${lua.dir}/lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.cpath-delete ${lua.dir}/include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.cpath-prepend ${lua.dir}/include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.library_path-delete ${lua.dir}/lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.library_path-prepend ${lua.dir}/lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.pkg_config_path-delete ${lua.dir}/lib/pkgconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.pkg_config_path-prepend ${lua.dir}/lib/pkgconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach stage {configure build destroot test} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set path_save ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[exists ${stage}.env]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach e [option ${stage}.env] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string range ${e} 0 4] eq "PATH="} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set path_save [string range ${e} 5 end]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break
</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;'>+ if {${path_save} ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${stage}.env-replace PATH=${path_save} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PATH=${lua.dir}/bin:${path_save}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${stage}.env-append PATH=${lua.dir}/bin:$env(PATH)
</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><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # if it is too much effort ensure correct Lua is used, just add build conflict
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${lua.version} ne "" && [option lua.finds_default]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ conflicts_build-append lua
</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 {${lua.version} eq "" && [option lua.finds_versioned]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach v [option lua.branches] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ conflicts_build-append lua[join [split $v .] ""]
</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;'>+port::register_callback lua::callback
</span></pre><pre style='margin:0'>
</pre>