source: gs3-extensions/structured-audio/trunk/deprecated/SETUP-TOP-LEVEL.sh@ 37593

Last change on this file since 37593 was 37593, checked in by davidb, 13 months ago

Moving older way of doing things out of the way (deprecated)

File size: 1.5 KB
Line 
1
2_full_pyver_=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)')
3_majorminor_pyver_=${_full_pyver_%.*}
4
5# Symlink this file so it is in the top-level Greenstone3 directory area
6
7source ./gs3-setup.sh
8
9function check_pip_installed()
10{
11 if [ ! -d "$GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python3/lib/python${_majorminor_pyver_}/site-packages/$1" ] \
12 && [ ! -f "$GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python3/lib/python${_majorminor_pyver_}/site-packages/$1.py" ] ; then
13 echo "!!!!" >&2
14 echo "! Failed to find directory or file: " >&2
15 echo "! $GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python3/lib/python${_majorminor_pyver_}/site-packages/$1(.py)" >&2
16 echo "!!!!" >&2
17 echo "! You need to: " >&2
18 if [ "x$VIRTUAL_ENV" = "x" ] ; then
19 echo "! source $GEXT_STRUCTURED_AUDIO/$GSDLOS/virtualenv-python3/bin/activate" >&2
20 echo "! Then: " >&2
21 fi
22
23 if [ "$1" = "pyannote" ] ; then
24 echo "! pip install https://github.com/pyannote/pyannote-audio/archive/develop.zip" >&2
25 else
26 echo "! pip install $1" >&2
27 fi
28
29 echo "!" >&2
30 echo "!!!!" >&2
31
32 return 1
33 fi
34}
35
36function check_pip_installed_all()
37{
38 for pkg in wheel pyannote speechbrain ; do
39 check_pip_installed $pkg
40 if [ $? != 0 ] ; then
41 return 1
42 fi
43 done
44}
45
46
47if [ "x$VIRTUAL_ENV" = "x" ] ; then
48
49 echo ""
50 echo "****"
51 echo "* Activating Python v3 Virtual Env "
52 echo "****"
53 echo ""
54
55 source $GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python3/bin/activate
56
57fi
58
59
60check_pip_installed_all
61
62if [ $? != 0 ] ; then
63 return 1
64fi
Note: See TracBrowser for help on using the repository browser.