direnv: convert to GoPackage (#46724)

This commit is contained in:
Alec Scott 2024-10-02 14:18:20 -07:00 committed by GitHub
parent 31f0905f3f
commit dfb0f58254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@
from spack.package import *
class Direnv(Package):
class Direnv(GoPackage):
"""direnv is an environment switcher for the shell."""
homepage = "https://direnv.net/"
@ -26,18 +26,5 @@ class Direnv(Package):
version("2.20.0", sha256="cc72525b0a5b3c2ab9a52a3696e95562913cd431f923bcc967591e75b7541bff")
version("2.11.3", sha256="2d34103a7f9645059270763a0cfe82085f6d9fe61b2a85aca558689df0e7b006")
depends_on("go", type="build")
depends_on("go@1.16:", type="build", when="@2.28:")
depends_on("go@1.20:", type="build", when="@2.33:")
phases = ["build", "install"]
def setup_build_environment(self, env):
# Point GOPATH at the top of the staging dir for the build step.
env.prepend_path("GOPATH", self.stage.path)
def build(self, spec, prefix):
make()
def install(self, spec, prefix):
make("install", "PREFIX=%s" % prefix)