diff options
author | iarspider <iarspider@gmail.com> | 2020-10-16 23:30:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 16:30:57 -0500 |
commit | 7296f8c6288ca3ee35d99b192a1821dbf7c4cda3 (patch) | |
tree | e9ea74024c96d352e3be6c898102a56bfeaa43fb | |
parent | e9da8d16336ea01aa78548d70cf4f6691f2e9947 (diff) | |
download | spack-7296f8c6288ca3ee35d99b192a1821dbf7c4cda3.tar.gz spack-7296f8c6288ca3ee35d99b192a1821dbf7c4cda3.tar.bz2 spack-7296f8c6288ca3ee35d99b192a1821dbf7c4cda3.tar.xz spack-7296f8c6288ca3ee35d99b192a1821dbf7c4cda3.zip |
Add external package support to xz (#19339)
* Add external package support to xz
* Flake-8
Co-authored-by: iarspider <iarpsider@gmail.com>
-rw-r--r-- | var/spack/repos/builtin/packages/xz/package.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 5cb1548a2a..6f8a24848c 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re + from spack import * @@ -16,6 +18,8 @@ class Xz(AutotoolsPackage, SourceforgePackage): sourceforge_mirror_path = "lzmautils/files/xz-5.2.5.tar.bz2" list_url = "http://tukaani.org/xz/old.html" + executables = [r'^xz$'] + version('5.2.5', sha256='5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df') version('5.2.4', sha256='3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf') version('5.2.3', sha256='fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1') @@ -33,3 +37,9 @@ class Xz(AutotoolsPackage, SourceforgePackage): @property def libs(self): return find_libraries(['liblzma'], root=self.prefix, recursive=True) + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'xz \(XZ Utils\) (\S+)', output) + return match.group(1) if match else None |