swig: support external find (#31990)
This commit is contained in:
parent
b24a068f3d
commit
1d4925387e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user