Debian Codegraph @

dev/prep-for-macos-build

raw
1 #!/usr/bin/env bash
2
3 set -exu
4
5 usage()
6 {
7 echo "Usage: prep-for-macos-build [python3]"
8 }
9
10 pyver="${1:-python3}"
11
12 if ! command -v brew; then
13 /usr/bin/env \
14 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
15 fi
16
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 python3)
26 brew install python
27 python3 -m pip install --break-system-packages --user pytest pytest-xdist
28 ;;
29 *)
30 usage 1>&2
31 exit 2
32 ;;
33 esac