forked from openwpm/OpenWPM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-mac-dev.sh
executable file
·56 lines (43 loc) · 2.04 KB
/
install-mac-dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -e
# Note: This install script assumes that node and python is already setup
# and is meant for setting up local development rather than CI environments
if [[ $# -gt 0 ]]; then
echo "Usage: install-mac.sh" >&2
exit 1
fi
# Create and activate a local Python 3 venv
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
# Install all requirements except plyvel
cat requirements.txt | grep -v plyvel > requirements.mac.txt
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install -r requirements.mac.txt
rm requirements.mac.txt
# A recent version of leveldb is required
brew install leveldb || brew upgrade leveldb
# Make sure we build plyvel properly to work with the installed leveldb on recent OSX versions
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++ -std=c++11' pip install --force-reinstall --ignore-installed --no-binary :all: plyvel
# Make npm available (used by build-extension.sh)
brew install node || true
# Use the Unbranded build that corresponds to Firefox 68 release (source: https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds)
brew install wget || true
wget https://queue.taskcluster.net/v1/task/EPaShNEQTYaBrJYpULyxwg/runs/0/artifacts/public/build/target.dmg
# Install Firefox Nightly
rm -rf Nightly.app || true
hdiutil attach -nobrowse -mountpoint /Volumes/firefox-tmp target.dmg
cp -r /Volumes/firefox-tmp/Nightly.app .
hdiutil detach /Volumes/firefox-tmp
rm target.dmg
# Selenium 3.3+ requires a 'geckodriver' helper executable, which is not yet
# packaged.
GECKODRIVER_VERSION=0.24.0
GECKODRIVER_ARCH=macos
wget https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
tar zxf geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
rm geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
mv geckodriver Nightly.app/Contents/MacOS/
# Download and build client extension
./build-extension.sh
# Install requirements related to OpenWPM development
pip install -U -r requirements-dev.txt