fzf package: change mirror and add vim plugin (#10920)

This commit edits the Makefile to use github.com mirrors rather than the
default mirrors of the dependency packages installed by GO.
This commit is contained in:
clellsolomon 2019-04-10 17:23:37 -06:00 committed by Peter Scheibel
parent f1bdaa11d4
commit 7ec12c59ab
2 changed files with 40 additions and 4 deletions

View File

@ -0,0 +1,16 @@
--- a/Makefile 2019-03-29 08:58:38.934257084 -0600
+++ b/Makefile 2019-03-29 08:58:38.934257084 -0600
@@ -99,7 +99,12 @@
ln -sf $(ROOT_DIR)/vendor $(VENDOR_LINK)
vendor: $(GLIDE_YAML)
- go get -u github.com/Masterminds/glide && $(GOPATH)/bin/glide install && touch $@
+ go get -u github.com/Masterminds/glide
+ $(GOPATH)/bin/glide $(if ${GLIDE_HOME}, --home ${GLIDE_HOME},) mirror set https://golang.org/x/crypto https://github.com/golang/crypto --vcs git
+ $(GOPATH)/bin/glide $(if ${GLIDE_HOME}, --home ${GLIDE_HOME},) mirror set https://golang.org/x/text https://github.com/golang/text --vcs git
+ $(GOPATH)/bin/glide $(if ${GLIDE_HOME}, --home ${GLIDE_HOME},) mirror set https://golang.org/x/sys https://github.com/golang/sys --vcs git
+ $(GOPATH)/bin/glide $(if ${GLIDE_HOME}, --home ${GLIDE_HOME},) mirror set https://gopkg.in/yaml.v2 https://github.com/go-yaml/yaml.git --vcs git
+ $(GOPATH)/bin/glide $(if ${GLIDE_HOME}, --home ${GLIDE_HOME},) install && touch $@
test: $(SOURCES) vendor
SHELL=/bin/sh GOOS= go test -v -tags "$(TAGS)" \

View File

@ -3,6 +3,10 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import inspect
from spack import * from spack import *
@ -25,8 +29,24 @@ class Fzf(MakefilePackage):
depends_on('go@1.11:') depends_on('go@1.11:')
def edit(self, spec, prefix): variant('vim', default=False, description='Install vim plugins for fzf')
mkdir(prefix.bin)
makefile = FileFilter('Makefile') patch("github_mirrors.patch")
makefile.filter('bin/fzf', prefix.bin + "/fzf")
def build(self, spec, prefix):
glide_home = os.path.join(self.build_directory, 'glide_home')
os.environ['GLIDE_HOME'] = glide_home
shutil.rmtree(glide_home, ignore_errors=True)
os.mkdir(glide_home)
super(Fzf, self).build(spec, prefix)
def install(self, spec, prefix):
with working_dir(self.build_directory):
inspect.getmodule(self).make(*self.install_targets)
mkdir(prefix.bin)
install('bin/fzf', prefix.bin)
if '+vim' in spec:
mkdir(prefix.plugin)
install('plugin/fzf.vim', prefix.plugin)