gettext: find external (#28610)

This commit is contained in:
Nils Leif Fischer 2022-02-01 12:25:02 +01:00 committed by GitHub
parent dedf4a1470
commit c3bad2a935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
from spack import *
@ -12,6 +14,8 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/gettext/"
gnu_mirror_path = "gettext/gettext-0.20.1.tar.xz"
executables = [r'^gettext$']
version('0.21', sha256='d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192')
version('0.20.2', sha256='b22b818e644c37f6e3d1643a1943c32c3a9bff726d601e53047d2682019ceaba')
version('0.20.1', sha256='53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800')
@ -51,6 +55,13 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage):
patch('nvhpc-export-symbols.patch', when='%nvhpc')
patch('nvhpc-long-width.patch', when='%nvhpc')
@classmethod
def determine_version(cls, exe):
gettext = Executable(exe)
output = gettext('--version', output=str, error=str)
match = re.match(r'gettext(?: \(.+\)) ([\d.]+)', output)
return match.group(1) if match else None
def configure_args(self):
spec = self.spec