diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-10-13 18:15:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 09:15:48 -0700 |
commit | b84812256dae57d4bccbe46d7f7956585f57c0d6 (patch) | |
tree | 280568c1c2bbeef9c996c841539baf09513774f7 /var | |
parent | c40de7c895aca85075dae7b18391928fd46ff5e8 (diff) | |
download | spack-b84812256dae57d4bccbe46d7f7956585f57c0d6.tar.gz spack-b84812256dae57d4bccbe46d7f7956585f57c0d6.tar.bz2 spack-b84812256dae57d4bccbe46d7f7956585f57c0d6.tar.xz spack-b84812256dae57d4bccbe46d7f7956585f57c0d6.zip |
autotools: add attribute to delete libtool archives .la files (#18850)
* autotools: add attribute to delete libtool archives .la files
According to Autotools Mythbuster (https://autotools.io/libtool/lafiles.html)
libtool archive files are mostly vestigial, but they might create issues
when relocating binary packages as shown in #18694.
For GCC specifically, most distributions remove these files with
explicit commands:
https://git.stg.centos.org/rpms/gcc/blob/master/f/gcc.spec#_1303
Considered all of that, this commit adds an easy way for each
AutotoolsPackage to remove every .la file that has been installed.
The default, for the time being, is to maintain them - to be consistent
with what Spack was doing previously.
* autotools: delete libtool archive files by default
Following review this commit changes the default for
libtool archive files deletion and adds test to verify
the behavior.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/libtool-deletion/package.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py b/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py new file mode 100644 index 0000000000..6ca8ce03d8 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py @@ -0,0 +1,35 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os.path + + +class LibtoolDeletion(AutotoolsPackage): + """Mock AutotoolsPackage to check proper deletion + of libtool archives. + """ + homepage = "https://www.gnu.org/software/make/" + url = "http://www.example.com/libtool-deletion-1.0.tar.gz" + version('4.2.1', sha256='e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7') + + def do_stage(self): + mkdirp(self.stage.source_path) + + def autoreconf(self, spec, prefix): + mkdirp(os.path.dirname(self.configure_abs_path)) + touch(self.configure_abs_path) + + def configure(self, spec, prefix): + pass + + def build(self, spec, prefix): + pass + + def install(self, spec, prefix): + mkdirp(os.path.dirname(self.libtool_archive_file)) + touch(self.libtool_archive_file) + + @property + def libtool_archive_file(self): + return os.path.join(str(self.prefix.lib), 'libfoo.la') |