diff options
author | Giuncan <38205328+Giuncan@users.noreply.github.com> | 2024-11-11 03:12:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-10 20:12:15 -0600 |
commit | 30db7644495c8a52f8bbf81af564a33f1373fb31 (patch) | |
tree | 39d238d9e1b1e92026c9f9d7a8dc829351af8274 /var | |
parent | f5b8b0ac5dfab0fa5e9baa3b2a32fc500d9a93a6 (diff) | |
download | spack-30db7644495c8a52f8bbf81af564a33f1373fb31.tar.gz spack-30db7644495c8a52f8bbf81af564a33f1373fb31.tar.bz2 spack-30db7644495c8a52f8bbf81af564a33f1373fb31.tar.xz spack-30db7644495c8a52f8bbf81af564a33f1373fb31.zip |
lua: always generate pcfile without patch and remove +pcfile variant (#47353)
* lua: add +pcfile support for @5.4: versions, without using a version-dependent patch
* lua: always generate pcfile, remove +pcfile variant from all packages
* lua: minor fixes
* rpm: minor fix
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/lua/package.py | 38 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/rpm/package.py | 4 |
2 files changed, 26 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/lua/package.py b/var/spack/repos/builtin/packages/lua/package.py index 6836578823..8f791b5cd8 100644 --- a/var/spack/repos/builtin/packages/lua/package.py +++ b/var/spack/repos/builtin/packages/lua/package.py @@ -12,6 +12,23 @@ import spack.build_environment from spack.package import * from spack.util.executable import Executable +# This is the template for a pkgconfig file for rpm +# https://github.com/guix-mirror/guix/raw/dcaf70897a0bad38a4638a2905aaa3c46b1f1402/gnu/packages/patches/lua-pkgconfig.patch +_LUA_PC_TEMPLATE = """prefix={0} +libdir={0}/lib +includedir={0}/include +bindir={0}/bin +INSTALL_LMOD={0}/share/lua/{1} +INSTALL_CMOD={0}/lib/lua/{1} +INTERPRETER=${{bindir}}/lua +COMPILER=${{bindir}}/luac +Name: Lua +Description: A powerful, fast, lightweight, embeddable scripting language +Version: {2} +Libs: -L${{libdir}} -llua -lm +Cflags: -I${{includedir}} +""" + class LuaImplPackage(MakefilePackage): """Specialized class for lua *implementations* @@ -226,7 +243,6 @@ class Lua(LuaImplPackage): depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated - variant("pcfile", default=False, description="Add patch for lua.pc generation") variant("shared", default=True, description="Builds a shared version of the library") provides("lua-lang@5.1", when="@5.1:5.1.99") @@ -237,12 +253,6 @@ class Lua(LuaImplPackage): depends_on("ncurses+termlib") depends_on("readline") - patch( - "http://lua.2524044.n2.nabble.com/attachment/7666421/0/pkg-config.patch", - sha256="208316c2564bdd5343fa522f3b230d84bd164058957059838df7df56876cb4ae", - when="+pcfile @:5.3.9999", - ) - def build(self, spec, prefix): if spec.satisfies("platform=darwin"): target = "macosx" @@ -289,10 +299,10 @@ class Lua(LuaImplPackage): os.symlink(src_path, dest_path) @run_after("install") - def link_pkg_config(self): - if self.spec.satisfies("+pcfile"): - versioned_pc_file_name = "lua{0}.pc".format(self.version.up_to(2)) - symlink( - join_path(self.prefix.lib, "pkgconfig", versioned_pc_file_name), - join_path(self.prefix.lib, "pkgconfig", "lua.pc"), - ) + def generate_pkg_config(self): + mkdirp(self.prefix.lib.pkgconfig) + versioned_pc_file_name = "lua{0}.pc".format(self.version.up_to(2)) + versioned_pc_file_path = join_path(self.prefix.lib.pkgconfig, versioned_pc_file_name) + with open(versioned_pc_file_path, "w") as pcfile: + pcfile.write(_LUA_PC_TEMPLATE.format(self.prefix, self.version.up_to(2), self.version)) + symlink(versioned_pc_file_path, join_path(self.prefix.lib.pkgconfig, "lua.pc")) diff --git a/var/spack/repos/builtin/packages/rpm/package.py b/var/spack/repos/builtin/packages/rpm/package.py index 18d373f299..39d2d44af4 100644 --- a/var/spack/repos/builtin/packages/rpm/package.py +++ b/var/spack/repos/builtin/packages/rpm/package.py @@ -60,8 +60,8 @@ class Rpm(AutotoolsPackage): # Always required depends_on("popt") - # Without this file patch, we don't detect lua - depends_on("lua+pcfile@5.3.5:", when="+lua") + # support for embedded Lua interpreter + depends_on("lua@5.3.5:", when="+lua") # Enable POSIX.1e draft 15 file capabilities support depends_on("libcap", when="+posix") |