gh: convert to GoPackage (#45351)
* gh: convert to GoPackage * gh: fix style
This commit is contained in:
parent
0d326f83b6
commit
66ed8ebbd9
@ -6,7 +6,7 @@
|
|||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class Gh(Package):
|
class Gh(GoPackage):
|
||||||
"""GitHub's official command line tool."""
|
"""GitHub's official command line tool."""
|
||||||
|
|
||||||
homepage = "https://github.com/cli/cli"
|
homepage = "https://github.com/cli/cli"
|
||||||
@ -43,14 +43,10 @@ class Gh(Package):
|
|||||||
depends_on("go@1.21:", type="build", when="@2.33.0:")
|
depends_on("go@1.21:", type="build", when="@2.33.0:")
|
||||||
depends_on("go@1.22:", type="build", when="@2.47.0:")
|
depends_on("go@1.22:", type="build", when="@2.47.0:")
|
||||||
|
|
||||||
phases = ["build", "install"]
|
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
class GoBuilder(spack.build_systems.go.GoBuilder):
|
||||||
# Point GOPATH at the top of the staging dir for the build step.
|
@property
|
||||||
env.prepend_path("GOPATH", self.stage.path)
|
def build_args(self):
|
||||||
|
args = super().build_args
|
||||||
def build(self, spec, prefix):
|
args.extend(["-trimpath", "./cmd/gh"])
|
||||||
make()
|
return args
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
|
||||||
make("install", "prefix=" + prefix)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user