summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriarspider <iarspider@gmail.com>2020-10-16 20:13:39 +0200
committerGitHub <noreply@github.com>2020-10-16 20:13:39 +0200
commit78f349c635e477bb846b24e55912b0df80070f6c (patch)
treef4341b57f9b2112ea0f39e2745c0de8188709239
parentf0b1f93d12d63bd7edd8a0ddead6400314b5739a (diff)
downloadspack-78f349c635e477bb846b24e55912b0df80070f6c.tar.gz
spack-78f349c635e477bb846b24e55912b0df80070f6c.tar.bz2
spack-78f349c635e477bb846b24e55912b0df80070f6c.tar.xz
spack-78f349c635e477bb846b24e55912b0df80070f6c.zip
ghostscript: add external package detection (#19346)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/ghostscript/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/ghostscript/package.py b/var/spack/repos/builtin/packages/ghostscript/package.py
index ee14758dd1..d69a10e007 100644
--- a/var/spack/repos/builtin/packages/ghostscript/package.py
+++ b/var/spack/repos/builtin/packages/ghostscript/package.py
@@ -5,6 +5,7 @@
from spack import *
import shutil
+import re
class Ghostscript(AutotoolsPackage):
@@ -13,6 +14,8 @@ class Ghostscript(AutotoolsPackage):
homepage = "http://ghostscript.com/"
url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs926/ghostscript-9.26.tar.gz"
+ executables = [r'^gs$']
+
version('9.50', sha256='0f53e89fd647815828fc5171613e860e8535b68f7afbc91bf89aee886769ce89')
version('9.27', sha256='9760e8bdd07a08dbd445188a6557cb70e60ccb6a5601f7dbfba0d225e28ce285')
version('9.26', sha256='831fc019bd477f7cc2d481dc5395ebfa4a593a95eb2fe1eb231a97e450d7540d')
@@ -71,3 +74,9 @@ class Ghostscript(AutotoolsPackage):
def install(self, spec, prefix):
make('install')
make('soinstall')
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--help', output=str, error=str)
+ match = re.search(r'GPL Ghostscript (\S+)', output)
+ return match.group(1) if match else None