summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorNils Leif Fischer <nils.fischer@aei.mpg.de>2022-02-01 12:25:02 +0100
committerGitHub <noreply@github.com>2022-02-01 12:25:02 +0100
commitc3bad2a93566b433149856933acdb9040e3c7129 (patch)
tree017bad021ab12587b95a47354db453a01682c208 /var
parentdedf4a14703d171c9a8dc4d37008bf87e2dfe715 (diff)
downloadspack-c3bad2a93566b433149856933acdb9040e3c7129.tar.gz
spack-c3bad2a93566b433149856933acdb9040e3c7129.tar.bz2
spack-c3bad2a93566b433149856933acdb9040e3c7129.tar.xz
spack-c3bad2a93566b433149856933acdb9040e3c7129.zip
gettext: find external (#28610)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gettext/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gettext/package.py b/var/spack/repos/builtin/packages/gettext/package.py
index ab4e2e74ec..9f3025d1bc 100644
--- a/var/spack/repos/builtin/packages/gettext/package.py
+++ b/var/spack/repos/builtin/packages/gettext/package.py
@@ -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