]> arthur.barton.de Git - bup.git/blobdiff - dev/prep-for-macos-build
drecurse: replace OsFile (and __del__) with finalized fd
[bup.git] / dev / prep-for-macos-build
index 78ae3a50dc5af52ca5fe6e128cd4f8c81b126f1b..e5594417cf63aa24e71bc70dd85775e8c7aa88c4 100755 (executable)
@@ -1,13 +1,36 @@
-#!/bin/sh
+#!/usr/bin/env bash
 
-set -ex
+set -exu
 
-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
+usage()
+{
+    echo "Usage: prep-for-macos-build [python2|python3]"
+}
 
-brew update
-brew install par2 readline rsync pkg-config
+pyver="${1:-python2}"
+
+if ! command -v brew; then
+    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+fi
+
+brew install par2 readline rsync pkg-config md5sha1sum
 
 # This avoid's macos interference, i.e. without this it looks like we
 # won't actually be able to use the readline we just installed above.
 brew link --force readline
 # "brew unlink readline" will undo this hack
+
+case "$pyver" in
+    python2)
+        easy_install-2.7 --user pip
+        /Users/anka/Library/Python/2.7/bin/pip install --user pytest pytest-xdist
+        ;;
+    python3)
+        brew install python
+        pip3 install --user pytest pytest-xdist
+        ;;
+    *)
+        usage 1>&2
+        exit 2
+        ;;
+esac