Lua: Add versions and minor clean up (#33037)

* add new lua releases

* split install phase and move it into a build phase, remove hardcoded standard flag

* revert back to the original hardcoded std flag, guard patch against versions above 5.4
This commit is contained in:
Chris White 2022-10-13 10:51:07 -07:00 committed by GitHub
parent 3014caa586
commit 5167eed558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,6 +209,12 @@ class Lua(LuaImplPackage):
homepage = "https://www.lua.org"
url = "https://www.lua.org/ftp/lua-5.3.4.tar.gz"
version("5.4.4", sha256="164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61")
version("5.4.3", sha256="f8612276169e3bfcbcfb8f226195bfc6e466fe13042f1076cbde92b7ec96bbfb")
version("5.4.2", sha256="11570d97e9d7303c0a59567ed1ac7c648340cd0db10d5fd594c09223ef2f524f")
version("5.4.1", sha256="4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d")
version("5.4.0", sha256="eac0836eb7219e421a96b7ee3692b93f0629e4cdb0c788432e3d10ce9ed47e28")
version("5.3.6", sha256="fc5fd69bb8736323f026672b1b7235da613d7177e72558893a0bdcd320466d60")
version("5.3.5", sha256="0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac")
version("5.3.4", sha256="f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c")
version("5.3.2", sha256="c740c7bb23a936944e1cc63b7c3c5351a8976d7867c5252c8854f7b2af9da68f")
@ -229,6 +235,7 @@ class Lua(LuaImplPackage):
provides("lua-lang@5.1", when="@5.1:5.1.99")
provides("lua-lang@5.2", when="@5.2:5.2.99")
provides("lua-lang@5.3", when="@5.3:5.3.99")
provides("lua-lang@5.4", when="@5.4:5.4.99")
depends_on("ncurses+termlib")
depends_on("readline")
@ -236,22 +243,23 @@ class Lua(LuaImplPackage):
patch(
"http://lua.2524044.n2.nabble.com/attachment/7666421/0/pkg-config.patch",
sha256="208316c2564bdd5343fa522f3b230d84bd164058957059838df7df56876cb4ae",
when="+pcfile",
when="+pcfile @:5.3.9999",
)
def install(self, spec, prefix):
def build(self, spec, prefix):
if spec.satisfies("platform=darwin"):
target = "macosx"
else:
target = "linux"
make(
"INSTALL_TOP=%s" % prefix,
"MYLDFLAGS="
+ " ".join((spec["readline"].libs.search_flags, spec["ncurses"].libs.search_flags)),
"MYLIBS=%s" % spec["ncurses"].libs.link_flags,
"CC=%s -std=gnu99 %s" % (spack_cc, self.compiler.cc_pic_flag),
"CC={0} -std=gnu99 {1}".format(spack_cc, self.compiler.cc_pic_flag),
target,
)
def install(self, spec, prefix):
make("INSTALL_TOP=%s" % prefix, "install")
if "+shared" in spec:
@ -286,7 +294,8 @@ def install(self, spec, prefix):
@run_after("install")
def link_pkg_config(self):
if "+pcfile" in self.spec:
versioned_pc_file_name = "lua{0}.pc".format(self.version.up_to(2))
symlink(
join_path(self.prefix.lib, "pkgconfig", "lua5.3.pc"),
join_path(self.prefix.lib, "pkgconfig", versioned_pc_file_name),
join_path(self.prefix.lib, "pkgconfig", "lua.pc"),
)