summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/bison/package.py
diff options
context:
space:
mode:
authorRobert Blake <blake14@llnl.gov>2020-08-28 14:22:28 -0700
committerGitHub <noreply@github.com>2020-08-28 16:22:28 -0500
commiteb8ff0bc81a2029ebeaa59ec582f549fee0a738d (patch)
tree8d252562a68029f7953ac9f9b0cb000aa2652191 /var/spack/repos/builtin/packages/bison/package.py
parentaca370a3a2dc35dc5ccc8410dab3f91743715d14 (diff)
downloadspack-eb8ff0bc81a2029ebeaa59ec582f549fee0a738d.tar.gz
spack-eb8ff0bc81a2029ebeaa59ec582f549fee0a738d.tar.bz2
spack-eb8ff0bc81a2029ebeaa59ec582f549fee0a738d.tar.xz
spack-eb8ff0bc81a2029ebeaa59ec582f549fee0a738d.zip
Adding externals for bison and flex (#18358)
* Adding externals for bison and flex Added because bison actually pulls in a ton of stuff. * Need to escape parentheses. * Need to add re package. * Adding re package.
Diffstat (limited to 'var/spack/repos/builtin/packages/bison/package.py')
-rw-r--r--var/spack/repos/builtin/packages/bison/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/bison/package.py b/var/spack/repos/builtin/packages/bison/package.py
index 6fe36efed9..003aff1290 100644
--- a/var/spack/repos/builtin/packages/bison/package.py
+++ b/var/spack/repos/builtin/packages/bison/package.py
@@ -6,6 +6,7 @@
from spack import *
from spack.operating_systems.mac_os import macos_version
import sys
+import re
class Bison(AutotoolsPackage, GNUMirrorPackage):
@@ -16,6 +17,8 @@ class Bison(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/bison/"
gnu_mirror_path = "bison/bison-3.6.4.tar.gz"
+ executables = ['^bison$']
+
version('3.6.4', sha256='8183de64b5383f3634942c7b151bf2577f74273b2731574cdda8a8f3a0ab13e9')
version('3.6.3', sha256='4b4c4943931e811f1073006ce3d8ee022a02b11b501e9cbf4def3613b24a3e63')
version('3.6.2', sha256='e28ed3aad934de2d1df68be209ac0b454f7b6d3c3d6d01126e5cd2cbadba089a')
@@ -49,3 +52,9 @@ class Bison(AutotoolsPackage, GNUMirrorPackage):
patch('secure_snprintf.patch', level=0, when='@3.0.4')
build_directory = 'spack-build'
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ match = re.search(r'bison \(GNU Bison\)\s+(\S+)', output)
+ return match.group(1) if match else None