summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorclellsolomon <44933387+clellsolomon@users.noreply.github.com>2019-04-10 17:23:37 -0600
committerPeter Scheibel <scheibel1@llnl.gov>2019-04-10 16:23:37 -0700
commit7ec12c59ab7126b27cc0ae61fe52253b190faed9 (patch)
treee7a1611fe52cb3bbb8da9b9a672b38ed4e190a00 /var
parentf1bdaa11d46b7d7c7014509143fd68d895cbfe37 (diff)
downloadspack-7ec12c59ab7126b27cc0ae61fe52253b190faed9.tar.gz
spack-7ec12c59ab7126b27cc0ae61fe52253b190faed9.tar.bz2
spack-7ec12c59ab7126b27cc0ae61fe52253b190faed9.tar.xz
spack-7ec12c59ab7126b27cc0ae61fe52253b190faed9.zip
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.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/fzf/github_mirrors.patch16
-rw-r--r--var/spack/repos/builtin/packages/fzf/package.py26
2 files changed, 39 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/fzf/github_mirrors.patch b/var/spack/repos/builtin/packages/fzf/github_mirrors.patch
new file mode 100644
index 0000000000..d17663286a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fzf/github_mirrors.patch
@@ -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)" \
diff --git a/var/spack/repos/builtin/packages/fzf/package.py b/var/spack/repos/builtin/packages/fzf/package.py
index f9d3a92781..708b856cb0 100644
--- a/var/spack/repos/builtin/packages/fzf/package.py
+++ b/var/spack/repos/builtin/packages/fzf/package.py
@@ -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)