diff options
Diffstat (limited to 'meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch')
-rw-r--r-- | meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch b/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch index c03bccd3da..43994e0cac 100644 --- a/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch +++ b/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 6272f36080bd440a5825b526f4c06223c5bb9fbb Mon Sep 17 00:00:00 2001 | 1 | From 07fce2101d83b5334de78e661ba0361c2874ebdf Mon Sep 17 00:00:00 2001 |
2 | From: Alistair Francis <alistair.francis@wdc.com> | 2 | From: Alistair Francis <alistair.francis@wdc.com> |
3 | Date: Mon, 18 Mar 2019 16:30:45 -0700 | 3 | Date: Mon, 18 Mar 2019 16:30:45 -0700 |
4 | Subject: [PATCH 1/5] Remove python venv | 4 | Subject: [PATCH 1/5] Remove python venv |
@@ -9,75 +9,77 @@ python and pip pacakges. | |||
9 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | 9 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> |
10 | Upstream-Status: Inappropriate [embedded specific] | 10 | Upstream-Status: Inappropriate [embedded specific] |
11 | --- | 11 | --- |
12 | dev_setup.sh | 36 ------------------------------------ | 12 | dev_setup.sh | 39 --------------------------------------- |
13 | start-mycroft.sh | 13 ------------- | 13 | start-mycroft.sh | 13 ------------- |
14 | venv-activate.sh | 44 +------------------------------------------- | 14 | venv-activate.sh | 44 +------------------------------------------- |
15 | 3 files changed, 1 insertion(+), 92 deletions(-) | 15 | 3 files changed, 1 insertion(+), 95 deletions(-) |
16 | 16 | ||
17 | diff --git a/dev_setup.sh b/dev_setup.sh | 17 | diff --git a/dev_setup.sh b/dev_setup.sh |
18 | index e0b07bf25cf..aed54b2167a 100755 | 18 | index cf81ed25f0f..99a44bfd8a7 100755 |
19 | --- a/dev_setup.sh | 19 | --- a/dev_setup.sh |
20 | +++ b/dev_setup.sh | 20 | +++ b/dev_setup.sh |
21 | @@ -310,18 +310,6 @@ function install_deps() { | 21 | @@ -338,18 +338,6 @@ ${YELLOW}Make sure to manually install:$BLUE git python3 python-setuptools pytho |
22 | fi | 22 | fi |
23 | } | 23 | } |
24 | 24 | ||
25 | -VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${TOP}/.venv"} | 25 | -VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${TOP}/.venv"} |
26 | - | 26 | - |
27 | -function install_venv() { | 27 | -function install_venv() { |
28 | - ${opt_python} -m venv "${VIRTUALENV_ROOT}/" --without-pip | 28 | - $opt_python -m venv "${VIRTUALENV_ROOT}/" --without-pip |
29 | - # Force version of pip for reproducability, but there is nothing special | 29 | - # Force version of pip for reproducability, but there is nothing special |
30 | - # about this version. Update whenever a new version is released and | 30 | - # about this version. Update whenever a new version is released and |
31 | - # verified functional. | 31 | - # verified functional. |
32 | - curl https://bootstrap.pypa.io/3.3/get-pip.py | "${VIRTUALENV_ROOT}/bin/python" - 'pip==18.0.0' | 32 | - curl https://bootstrap.pypa.io/3.3/get-pip.py | "${VIRTUALENV_ROOT}/bin/python" - 'pip==18.0.0' |
33 | - # Function status depending on if pip exists | 33 | - # Function status depending on if pip exists |
34 | - [ -x "${VIRTUALENV_ROOT}/bin/pip" ] | 34 | - [[ -x ${VIRTUALENV_ROOT}/bin/pip ]] |
35 | -} | 35 | -} |
36 | - | 36 | - |
37 | install_deps | 37 | install_deps |
38 | 38 | ||
39 | # Configure to use the standard commit template for | 39 | # Configure to use the standard commit template for |
40 | @@ -355,15 +343,7 @@ else | 40 | @@ -383,17 +371,6 @@ else |
41 | fi | 41 | fi |
42 | fi | 42 | fi |
43 | 43 | ||
44 | -if [ ! -x "${VIRTUALENV_ROOT}/bin/activate" ] ; then | 44 | -if [[ ! -x ${VIRTUALENV_ROOT}/bin/activate ]] ; then |
45 | - if ! install_venv ; then | 45 | - if ! install_venv ; then |
46 | - echo "Failed to set up virtualenv for mycroft, exiting setup." | 46 | - echo 'Failed to set up virtualenv for mycroft, exiting setup.' |
47 | - exit 1 | 47 | - exit 1 |
48 | - fi | 48 | - fi |
49 | -fi | 49 | -fi |
50 | - | 50 | - |
51 | # Start the virtual environment | 51 | -# Start the virtual environment |
52 | -source "${VIRTUALENV_ROOT}/bin/activate" | 52 | -source "${VIRTUALENV_ROOT}/bin/activate" |
53 | cd "${TOP}" | 53 | -cd "$TOP" |
54 | 54 | - | |
55 | # Install pep8 pre-commit hook | 55 | # Install pep8 pre-commit hook |
56 | @@ -380,22 +360,6 @@ fi | 56 | HOOK_FILE='./.git/hooks/pre-commit' |
57 | if [[ -n $INSTALL_PRECOMMIT_HOOK ]] || grep -q 'MYCROFT DEV SETUP' $HOOK_FILE; then | ||
58 | @@ -408,22 +385,6 @@ fi | ||
57 | 59 | ||
58 | PYTHON=$( python -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))" ) | 60 | PYTHON=$(python -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))") |
59 | 61 | ||
60 | -# Add mycroft-core to the virtualenv path | 62 | -# Add mycroft-core to the virtualenv path |
61 | -# (This is equivalent to typing 'add2virtualenv $TOP', except | 63 | -# (This is equivalent to typing 'add2virtualenv $TOP', except |
62 | -# you can't invoke that shell function from inside a script) | 64 | -# you can't invoke that shell function from inside a script) |
63 | -VENV_PATH_FILE="${VIRTUALENV_ROOT}/lib/$PYTHON/site-packages/_virtualenv_path_extensions.pth" | 65 | -VENV_PATH_FILE="${VIRTUALENV_ROOT}/lib/$PYTHON/site-packages/_virtualenv_path_extensions.pth" |
64 | -if [ ! -f "$VENV_PATH_FILE" ] ; then | 66 | -if [[ ! -f $VENV_PATH_FILE ]] ; then |
65 | - echo "import sys; sys.__plen = len(sys.path)" > "$VENV_PATH_FILE" || return 1 | 67 | - echo 'import sys; sys.__plen = len(sys.path)' > "$VENV_PATH_FILE" || return 1 |
66 | - echo "import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)" >> "$VENV_PATH_FILE" || return 1 | 68 | - echo "import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)" >> "$VENV_PATH_FILE" || return 1 |
67 | -fi | 69 | -fi |
68 | - | 70 | - |
69 | -if ! grep -q "$TOP" $VENV_PATH_FILE ; then | 71 | -if ! grep -q "$TOP" $VENV_PATH_FILE ; then |
70 | - echo "Adding mycroft-core to virtualenv path" | 72 | - echo 'Adding mycroft-core to virtualenv path' |
71 | - sed -i.tmp '1 a\ | 73 | - sed -i.tmp '1 a\ |
72 | -'"$TOP"' | 74 | -'"$TOP"' |
73 | -' "${VENV_PATH_FILE}" | 75 | -' "$VENV_PATH_FILE" |
74 | -fi | 76 | -fi |
75 | - | 77 | - |
76 | # install required python modules | 78 | # install required python modules |
77 | if ! pip install -r requirements.txt ; then | 79 | if ! pip install -r requirements.txt ; then |
78 | echo "Warning: Failed to install all requirements. Continue? y/N" | 80 | echo 'Warning: Failed to install all requirements. Continue? y/N' |
79 | diff --git a/start-mycroft.sh b/start-mycroft.sh | 81 | diff --git a/start-mycroft.sh b/start-mycroft.sh |
80 | index b9514a61ba5..64e0216a62f 100755 | 82 | index 0f88430982e..3aed2f189d4 100755 |
81 | --- a/start-mycroft.sh | 83 | --- a/start-mycroft.sh |
82 | +++ b/start-mycroft.sh | 84 | +++ b/start-mycroft.sh |
83 | @@ -20,7 +20,6 @@ script=${0} | 85 | @@ -20,7 +20,6 @@ script=${0} |
@@ -130,7 +132,7 @@ index b9514a61ba5..64e0216a62f 100755 | |||
130 | "sdkdoc") | 132 | "sdkdoc") |
131 | - source-venv | 133 | - source-venv |
132 | cd doc | 134 | cd doc |
133 | make ${opt} | 135 | make ${_params} |
134 | cd .. | 136 | cd .. |
135 | diff --git a/venv-activate.sh b/venv-activate.sh | 137 | diff --git a/venv-activate.sh b/venv-activate.sh |
136 | index d1e7bcb44e7..10b46d4de3b 100644 | 138 | index d1e7bcb44e7..10b46d4de3b 100644 |
@@ -188,5 +190,5 @@ index d1e7bcb44e7..10b46d4de3b 100644 | |||
188 | 190 | ||
189 | main $@ | 191 | main $@ |
190 | -- | 192 | -- |
191 | 2.21.0 | 193 | 2.23.0 |
192 | 194 | ||