diff options
author | Paul <pbryant@newmexicoconsortium.org> | 2020-09-02 09:03:56 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 10:03:56 -0500 |
commit | 1b78a010d8d7ba37d7bf0d7b8ba95a7a88f49855 (patch) | |
tree | a48b76d8ad71a477dfd8ac87f1685741481e934d /var | |
parent | 1026ace6b699e0e4b5de51ebb8acbf2df272ecd3 (diff) | |
download | spack-1b78a010d8d7ba37d7bf0d7b8ba95a7a88f49855.tar.gz spack-1b78a010d8d7ba37d7bf0d7b8ba95a7a88f49855.tar.bz2 spack-1b78a010d8d7ba37d7bf0d7b8ba95a7a88f49855.tar.xz spack-1b78a010d8d7ba37d7bf0d7b8ba95a7a88f49855.zip |
Updated Hugo package. (#18443)
* Set GOPATH in build environment to avoid creating files in the user's
default GOPATH (e.g. ~/go).
* Support for external find.
* Added latest releease 0.74.3.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/hugo/package.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hugo/package.py b/var/spack/repos/builtin/packages/hugo/package.py index 079843524b..fe9df5c110 100644 --- a/var/spack/repos/builtin/packages/hugo/package.py +++ b/var/spack/repos/builtin/packages/hugo/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re from spack import * from spack.util.executable import which @@ -13,6 +14,9 @@ class Hugo(Package): homepage = "https://gohugo.io" url = "https://github.com/gohugoio/hugo/archive/v0.53.tar.gz" + executables = ['^hugo$'] + + version('0.74.3', sha256='9b296fa0396c20956fa6a1f7afadaa78739af62c277b6c0cfae79a91b0fe823f') version('0.68.3', sha256='38e743605e45e3aafd9563feb9e78477e72d79535ce83b56b243ff991d3a2b6e') version('0.53', sha256='48e65a33d3b10527101d13c354538379d9df698e5c38f60f4660386f4232e65c') @@ -22,6 +26,15 @@ class Hugo(Package): variant('extended', default=False, description="Enable extended features") + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('version', output=str, error=str) + match = re.search(r'Hugo Static Site Generator v(\S+)', output) + return match.group(1) if match else None + + def setup_build_environment(self, env): + env.prepend_path('GOPATH', self.stage.path) + def install(self, spec, prefix): go_args = ['build'] if self.spec.satisfies('+extended'): |