From 85248595e3c70e26f4606838ba75e270a6c41e29 Mon Sep 17 00:00:00 2001 From: spacewander Date: Thu, 27 Jun 2019 12:33:18 +0800 Subject: [PATCH 1/2] Installation.md: add dependencies section. --- Installation.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Installation.md b/Installation.md index 4b060d9b4..d05b89e40 100644 --- a/Installation.md +++ b/Installation.md @@ -1,5 +1,14 @@ # Installing git-extras +## Dependencies + +Some commands require extra dependencies which are unavailable in some platforms. +You may need to install them manually. + +Those dependencies are listed below: + +* column + ## Installing with a package manager ### Debian @@ -84,6 +93,8 @@ Use the instructions to build from source below. Make sure you are using `gmake` ## Building from source +Read [Dependencies](#dependencies) and ensure they are installed. + Obtain the git-extras source by cloning [its GitHub repo](https://github.com/tj/git-extras.git) or downloading a tarball of a [release](https://github.com/tj/git-extras/releases). Then install it by doing `make install` from the source tree. ```bash From 58d13f88d449e1613fc5d263b1cabfcd87a0bc83 Mon Sep 17 00:00:00 2001 From: spacewander Date: Thu, 27 Jun 2019 15:12:30 +0800 Subject: [PATCH 2/2] Makefile: check dependencies before installation. So that the packager will know what are dependencied when they are making a new package. --- .travis.yml | 4 ++++ Makefile | 9 +++++++-- check_dependencies.sh | 10 ++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 check_dependencies.sh diff --git a/.travis.yml b/.travis.yml index 2c1a51998..d88b18635 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ os: - linux - osx +addons: + apt: + packages: + - bsdmainutils script: - ./check_integrity.sh $(find bin | cut -b 5- | xargs) # Test for the brew release diff --git a/Makefile b/Makefile index 4017cdb0b..9eae55f64 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,12 @@ default: install docs: $(MAN_HTML) $(MAN_PAGES) -install: +check: + @echo "Check dependencies before installation" + @./check_dependencies.sh + @echo + +install: check @if [ "$(INSTALL_VIA)" = brew ]; then \ git apply brew-release.patch || { echo "Can't apply brew release patch"; exit 1; } \ fi @@ -120,4 +125,4 @@ docclean: rm -f man/*.1 rm -f man/*.html -.PHONY: default docs clean docclean install uninstall +.PHONY: default docs clean docclean check install uninstall diff --git a/check_dependencies.sh b/check_dependencies.sh new file mode 100755 index 000000000..c1aa52544 --- /dev/null +++ b/check_dependencies.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +err() { + echo >&2 "$1" + exit 1 +} + +if ! test "$(which column)"; then + err "Need to install dependency 'column' before installation" +fi