-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure
executable file
·51 lines (35 loc) · 1.17 KB
/
configure
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
#!/usr/bin/env bash
#
# Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
#
set -e
#set -x
# source this script for a basic setup and configuration for local development
CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ "$1" == "--clean" ]]; then
rm -rf "$CONFIGURE_ROOT_DIR/tmp"
find "$CONFIGURE_ROOT_DIR" -type d -name dist | xargs rm -rf
find "$CONFIGURE_ROOT_DIR" -type d -name build | xargs rm -rf
exit
fi
if [[ "$PYTHON_EXE" == "" ]]; then
PYTHON_EXE=python3
fi
function setup {
# create a virtualenv on Python
mkdir -p $CONFIGURE_ROOT_DIR/tmp
wget -O $CONFIGURE_ROOT_DIR/tmp/virtualenv.pyz https://bootstrap.pypa.io/virtualenv.pyz
$PYTHON_EXE $CONFIGURE_ROOT_DIR/tmp/virtualenv.pyz $CONFIGURE_ROOT_DIR/tmp
source $CONFIGURE_ROOT_DIR/tmp/bin/activate
$CONFIGURE_ROOT_DIR/tmp/bin/pip install --upgrade -r requirements.txt
}
function build_patchelf {
$CONFIGURE_ROOT_DIR/src/build.sh
}
setup
build_patchelf
$CONFIGURE_ROOT_DIR/tmp/bin/pip install -r requirements.txt
if [ -f "$CONFIGURE_ROOT_DIR/tmp/bin/activate" ]; then
source "$CONFIGURE_ROOT_DIR/tmp/bin/activate"
fi
set +e