-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall-deps
executable file
·46 lines (42 loc) · 1.43 KB
/
install-deps
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
#!/bin/bash
# Installs required dependencies for building SecureDrop Worsktation packages.
# Assumes a Debian 10 machine, ideally a Qubes AppVM.
sudo apt-get update
sudo apt-get install \
build-essential \
curl \
devscripts \
dh-make \
dh-python \
dh-virtualenv \
git-lfs \
libffi-dev \
libssl-dev \
libyaml-dev \
python3-all \
python3-pip \
python3-venv \
python3-setuptools \
reprotest \
desktop-file-utils -y
# Inspect the wheel files present locally. If repo was cloned
# without git-lfs, they'll be "text/plain", rather than "application/zip".
wheel_mime_types="$(find localwheels/ -type f -iname '*.whl' -exec file --mime-type {} + | perl -F':\s+' -lanE 'say $F[-1]' | sort -u)"
if [[ "$wheel_mime_types" != "application/zip" ]]; then
echo "Re-fetching git-lfs assets..."
git lfs install
# Re-fetch assets to resolve pointers to actual files
rm -r bootstrap/ localwheels/
git checkout bootstrap/ localwheels/
git lfs fetch
fi
# Support existing activated virtualenv, e.g. via virtualenvwrapper.
if [[ -z "$VIRTUAL_ENV" ]]; then
echo "Creating local virtualenv..."
python3 -m venv .venv
. .venv/bin/activate
else
echo "Virtualenv already activated, skipping creation..."
fi
# Install the 'build' tool from previously prepared localwheels
pip install --require-hashes --no-index --no-deps --no-cache-dir -r build-requirements.txt --find-links ./bootstrap/