mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 11:06:17 +00:00
[provisioning] update brew recipe
- Always ensure dependencies are installed - Add gawk as a dependency (needed to build glibc for most packages on older systems)
This commit is contained in:
parent
d1c9e12739
commit
ceb514c1e2
1 changed files with 19 additions and 21 deletions
36
recipes/brew
36
recipes/brew
|
@ -1,24 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
function __install_brew {
|
|
||||||
case "$(uname -s)" in
|
|
||||||
Darwin)
|
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
_recipe _apt
|
|
||||||
_recipe _path
|
|
||||||
|
|
||||||
for pkg in build-essential curl file git python-setuptools; do
|
|
||||||
_apt $pkg
|
|
||||||
done
|
|
||||||
[ -d ~/.linuxbrew ] || git clone -q https://github.com/Linuxbrew/brew.git ~/.linuxbrew
|
|
||||||
_path "$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
function _brew {
|
function _brew {
|
||||||
local pkg=$1
|
local pkg=$1
|
||||||
if ! brew ls $pkg >/dev/null 2>&1; then
|
if ! brew ls $pkg >/dev/null 2>&1; then
|
||||||
|
@ -28,6 +10,22 @@ function _brew {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Darwin)
|
||||||
if ! which brew >/dev/null; then
|
if ! which brew >/dev/null; then
|
||||||
_run "Install brew" __install_brew
|
_run "Install brew" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_recipe _apt
|
||||||
|
_recipe _path
|
||||||
|
|
||||||
|
for pkg in build-essential curl file gawk git python-setuptools; do
|
||||||
|
_apt $pkg
|
||||||
|
done
|
||||||
|
if ! [ -d ~/.linuxbrew ]; then
|
||||||
|
_run "Install brew" git clone -q https://github.com/Linuxbrew/brew.git ~/.linuxbrew
|
||||||
|
_path "$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in a new issue