summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Cessenat <cessenat@gmail.com>2022-08-08 19:41:41 +0200
committerGitHub <noreply@github.com>2022-08-08 11:41:41 -0600
commit1d4925387e0ff92a9219b2a659c8574d9376c7a1 (patch)
tree9750bcb78732121754d7c6a73693780c8e9c2b78
parentb24a068f3dc562be7f6df9e407185b0a5484bc24 (diff)
downloadspack-1d4925387e0ff92a9219b2a659c8574d9376c7a1.tar.gz
spack-1d4925387e0ff92a9219b2a659c8574d9376c7a1.tar.bz2
spack-1d4925387e0ff92a9219b2a659c8574d9376c7a1.tar.xz
spack-1d4925387e0ff92a9219b2a659c8574d9376c7a1.zip
swig: support external find (#31990)
-rw-r--r--var/spack/repos/builtin/packages/swig/package.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/swig/package.py b/var/spack/repos/builtin/packages/swig/package.py
index 92334e342b..70fefc51b9 100644
--- a/var/spack/repos/builtin/packages/swig/package.py
+++ b/var/spack/repos/builtin/packages/swig/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
+import re
from spack.package import *
@@ -22,7 +23,9 @@ class Swig(AutotoolsPackage, SourceforgePackage):
sourceforge_mirror_path = "swig/swig-3.0.12.tar.gz"
maintainers = ["sethrj"]
- tags = ["e4s"]
+ tags = ["e4s", "build-tools"]
+
+ executables = ["^swig$"]
version("master", git="https://github.com/swig/swig.git")
version(
@@ -66,6 +69,12 @@ class Swig(AutotoolsPackage, SourceforgePackage):
conflicts("%nvhpc", when="@:4.0.2")
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)("-version", output=str, error=str)
+ match = re.search(r"SWIG\s+Version\s+(\S+)", output)
+ return match.group(1) if match else None
+
@run_after("install")
def create_symlink(self):
# CMake compatibility: see https://github.com/spack/spack/pull/6240