summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Underwood <robertu94@users.noreply.github.com>2021-01-29 15:05:48 -0500
committerGitHub <noreply@github.com>2021-01-29 21:05:48 +0100
commit0611036abdb7196d6d91a2433a35394bc2bd4ca7 (patch)
tree00ca7cf1409e8f497714fb8c221d6bbda53e3269
parentf8124369f9fbf7018b540da9c3258b87b354831d (diff)
downloadspack-0611036abdb7196d6d91a2433a35394bc2bd4ca7.tar.gz
spack-0611036abdb7196d6d91a2433a35394bc2bd4ca7.tar.bz2
spack-0611036abdb7196d6d91a2433a35394bc2bd4ca7.tar.xz
spack-0611036abdb7196d6d91a2433a35394bc2bd4ca7.zip
doxygen: add support for external detection (#20642)
-rw-r--r--var/spack/repos/builtin/packages/doxygen/package.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/doxygen/package.py b/var/spack/repos/builtin/packages/doxygen/package.py
index 5df7ca37e4..bac517bbb2 100644
--- a/var/spack/repos/builtin/packages/doxygen/package.py
+++ b/var/spack/repos/builtin/packages/doxygen/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
+import re
class Doxygen(CMakePackage):
@@ -33,6 +34,29 @@ class Doxygen(CMakePackage):
variant('mscgen', default=False,
description='Build with support for code graphs from mscgen.')
+ executables = ['doxygen']
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('-v', output=str, error=str)
+ match = re.search(r"^([\d\.]+)$", output)
+ return match.group(1) if match else None
+
+ @classmethod
+ def determine_variants(cls, exes, version_str):
+ variants = ''
+ if which('dot'):
+ variants += "+graphviz"
+ else:
+ variants += "~graphviz"
+
+ if which('mscgen'):
+ variants += "+mscgen"
+ else:
+ variants += "~mscgen"
+
+ return variants
+
depends_on("cmake@2.8.12:", type='build')
depends_on("python", type='build') # 2 or 3 OK; used in CMake build
depends_on("iconv")