]> arthur.barton.de Git - bup.git/blob - dev/prep-for-macos-build
prep-for-macos-build: only install brew when not found
[bup.git] / dev / prep-for-macos-build
1 #!/usr/bin/env bash
2
3 set -exu
4
5 usage()
6 {
7     echo "Usage: prep-for-macos-build [python2|python3]"
8 }
9
10 pyver="${1:-python2}"
11
12 if ! command -v brew; then
13     /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
14 fi
15
16 brew update
17 brew install par2 readline rsync pkg-config md5sha1sum
18
19 # This avoid's macos interference, i.e. without this it looks like we
20 # won't actually be able to use the readline we just installed above.
21 brew link --force readline
22 # "brew unlink readline" will undo this hack
23
24 case "$pyver" in
25     python2)
26         easy_install-2.7 --user pip
27         /Users/anka/Library/Python/2.7/bin/pip install --user pytest pytest-xdist
28         ;;
29     python3)
30         brew install python
31         easy_install --user pip
32         pip3 install --user pytest pytest-xdist
33         ;;
34     *)
35         usage 1>&2
36         exit 2
37         ;;
38 esac