Libtool: add spack external find support (#16691)

* Libtool: add spack external find support

* Less specific regex

* match -> search

* Clarify that min returns first alphabetically, not shortest

* Simplify version determination
This commit is contained in:
Adam J. Stewart 2020-08-11 10:16:15 -05:00 committed by GitHub
parent 313511bf1d
commit 2f0fd44b97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import * import os
import re
class Libtool(AutotoolsPackage, GNUMirrorPackage): class Libtool(AutotoolsPackage, GNUMirrorPackage):
@ -30,6 +31,14 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage):
build_directory = 'spack-build' build_directory = 'spack-build'
executables = ['^g?libtool(ize)?$']
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str, error=os.devnull)
match = re.search(r'\(GNU libtool\)\s+(\S+)', output)
return match.group(1) if match else None
@when('@2.4.2,develop') @when('@2.4.2,develop')
def autoreconf(self, spec, prefix): def autoreconf(self, spec, prefix):
Executable('./bootstrap')() Executable('./bootstrap')()