Skip to content
Snippets Groups Projects
Commit 7ec12c59 authored by clellsolomon's avatar clellsolomon Committed by Peter Scheibel
Browse files

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.
parent f1bdaa11
No related branches found
No related tags found
No related merge requests found
--- 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)" \
......@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import inspect
from spack import *
......@@ -25,8 +29,24 @@ class Fzf(MakefilePackage):
depends_on('go@1.11:')
def edit(self, spec, prefix):
variant('vim', default=False, description='Install vim plugins for fzf')
patch("github_mirrors.patch")
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)
makefile = FileFilter('Makefile')
makefile.filter('bin/fzf', prefix.bin + "/fzf")
if '+vim' in spec:
mkdir(prefix.plugin)
install('plugin/fzf.vim', prefix.plugin)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment