From 981551b47f2f1c702645992e1293e618c6d3ae66 Mon Sep 17 00:00:00 2001 From: bernhardkaindl <43588962+bernhardkaindl@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:18:29 +0200 Subject: libtool: fix running the unit-tests with spack install --test root (#25707) Besides adding autoconf and automake as needed for tests of 2.4.6, skip Fortran test cases when Fortran compilers are not provided. --- .../repos/builtin/packages/libtool/package.py | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index a85d09e633..02c5e02304 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -10,7 +10,7 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage): """libtool -- library building part of autotools.""" homepage = 'https://www.gnu.org/software/libtool/' - gnu_mirror_path = "libtool/libtool-2.4.2.tar.gz" + gnu_mirror_path = "libtool/libtool-2.4.6.tar.gz" version('develop', git='https://git.savannah.gnu.org/git/libtool.git', branch='master', submodules=True) @@ -25,6 +25,10 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage): depends_on('automake', type='build') depends_on('help2man', type='build') + with when('@2.4.6'): + depends_on('autoconf@2.62:', type='test') + depends_on('automake', type='test') + with when('@develop'): depends_on('autoconf', type='build') depends_on('automake', type='build') @@ -92,3 +96,20 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage): join_path(self.prefix.bin, 'glibtool')) symlink(join_path(self.prefix.bin, 'libtoolize'), join_path(self.prefix.bin, 'glibtoolize')) + + def setup_build_environment(self, env): + """Wrapper until spack has a real implementation of setup_test_environment()""" + if self.run_tests: + self.setup_test_environment(env) + + def setup_test_environment(self, env): + """When Fortran is not provided, a few tests need to be skipped""" + if (self.compiler.f77 is None): + env.set('F77', 'no') + if (self.compiler.fc is None): + env.set('FC', 'no') + + @when('@2.4.6') + def check(self): + """installcheck of libtool-2.4.6 runs the full testsuite, skip 'make check'""" + pass -- cgit v1.2.3-70-g09d2