Skip to content
Myr

Update install/build script from Homebrew

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent b8c4b35 · Browse files · 5 files+49 added−18 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+49 added−18 removed

  • other:+49 added−18 removed

5 files+49 added−18 removed

modified:src/Makefile+15 added-12 removed
19 unmodified lines
20BINARY64 := fzf-$(GOOS)_amd6421VERSION = $(shell fzf/$(BINARY64) --version)22RELEASE32 = fzf-$(VERSION)-$(GOOS)_38623RELEASE64 = fzf-$(VERSION)-$(GOOS)_amd6424ARCHIVE64 = fzf-$(VERSION)-$(GOOS)_amd64-archive24BREW = fzf-$(VERSION)-homebrew.tgz2526all: test release2728archive: ../$(ARCHIVE64).tar.gz28brew: ../$(BREW)2930../$(ARCHIVE64).tar.gz: release31 cd ../ && yes | ./install && \32 git archive HEAD --output=$(ARCHIVE64).tar --prefix fzf-$(VERSION)/ && \33 rm -rf fzf-$(VERSION)/bin && mkdir -p fzf-$(VERSION)/bin && \34 cp -a bin/* fzf-$(VERSION)/bin/ && \35 tar --append --file $(ARCHIVE64).tar fzf-$(VERSION)/bin/* && \36 gzip -f $(ARCHIVE64).tar && rm -rf fzf-$(VERSION) && \30../$(BREW): release31ifneq ($(UNAME_S),Darwin)32$(error brew package must be built on OS X)33endif34 mkdir -p ../bin && \35 cp fzf/$(RELEASE64) fzf/$(RELEASE32) ../bin && \36 cd .. && ln -sf . fzf-$(VERSION) && \37 tar -cvzf $(BREW) \38 fzf-$(VERSION)/{{,un}install,fzf-completion.{ba,z}sh,LICENSE} \39 fzf-$(VERSION)/{plugin/fzf.vim,bin/{$(RELEASE64),$(RELEASE32)}} && \40 rm fzf-$(VERSION) && \41 openssl sha1 $(notdir $@)4243release: build44 cd fzf && \45 cp $(BINARY32) $(RELEASE32) && tar -czf $(RELEASE32).tgz $(RELEASE32) && \42 cp $(BINARY64) $(RELEASE64) && tar -czf $(RELEASE64).tgz $(RELEASE64) && \43 rm $(RELEASE32) $(RELEASE64)46 cp $(BINARY64) $(RELEASE64) && tar -czf $(RELEASE64).tgz $(RELEASE64)4748build: fzf/$(BINARY32) fzf/$(BINARY64)4950test:
34 unmodified lines
85$(DISTRO): docker86 docker run -i -t -v $(GOPATH):/go junegunn/$(DISTRO)-sandbox \87 sh -c 'cd /go/src/github.com/junegunn/fzf/src; /bin/bash'8886.PHONY: all archive build release test install uninstall clean docker linux $(DISTRO)89.PHONY: all brew build release test install uninstall clean docker linux $(DISTRO)
modified:src/README.md+1 added-1 removed
modified:install+11 added-4 removed
11 unmodified lines
12}1314check_binary() {15 echo -n " - Checking fzf executable ... "16 if ! "$fzf_base"/bin/fzf --version; then16 local output=$("$fzf_base"/bin/fzf --version 2>&1)17 if [ "$version" = "$output" ]; then18 echo "$output"19 else20 echo "$output != $version"21 rm -f "$fzf_base"/bin/fzf18 binary_error="Error occurred"22 binary_error="Invalid binary"23 return 124 fi25}2627symlink() {
3 unmodified lines
31 ln -sf $1 fzf)32}3334download() {30 echo "Downloading bin/$1 ..."31 if [ -x "$fzf_base"/bin/$1 ]; then35 echo "Downloading bin/fzf ..."36 if [ -x "$fzf_base"/bin/fzf ]; then37 echo " - Already exists"38 check_binary && return39 elif [ -x "$fzf_base"/bin/$1 ]; then40 symlink $141 check_binary && return42 fi43 mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin
450 unmodified lines
added:LICENSE+21 added
1The MIT License (MIT)23Copyright (c) 2015 Junegunn Choi45Permission is hereby granted, free of charge, to any person obtaining a copy6of this software and associated documentation files (the "Software"), to deal7in the Software without restriction, including without limitation the rights8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell9copies of the Software, and to permit persons to whom the Software is10furnished to do so, subject to the following conditions:1112The above copyright notice and this permission notice shall be included in13all copies or substantial portions of the Software.1415THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN21THE SOFTWARE.
modified:README.md+1 added-1 removed
534 unmodified lines
535536License537-------538539MIT539[MIT](LICENSE)540541Author542------543
2 unmodified lines