Skip to content

Commit 83e6f13

Browse files
committed
Added new scripts to install SDK on mac using python virtual environment
1 parent de8ac76 commit 83e6f13

10 files changed

Lines changed: 134 additions & 67 deletions

docs/Install.osx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Installation procedure for SIP SIMPLE SDK on MacOSX
33
---------------------------------------------------
44

5-
Home page: http://sipsimpleclient.org
5+
This document is very old, see ../mac folder instead.
66

7-
This document describes the installation procedure on MacOSX >= 10.14
7+
This document describes the installation procedure on MacOSX < 10.14
88

99
The installation procedure consists of the steps described below:
1010

@@ -142,4 +142,3 @@ that are part of Python packages on which the SDK depends.
142142

143143
See install_osx_user.sh script in the top directory.
144144

145-

install_osx_user.sh

Lines changed: 0 additions & 64 deletions
This file was deleted.

mac/01-install-build-env.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
env python3 -V|grep -E "3.11|3.10|3.9" > /dev/null
3+
4+
RESULT=$?
5+
if [ $RESULT -ne 0 ]; then
6+
echo
7+
echo "Please install Python 3.9, 3.10 or 3.11 from https://www.python.org/"
8+
echo
9+
exit 1
10+
fi
11+
12+
which port > /dev/null
13+
RESULT=$?
14+
15+
if [ $RESULT -ne 0 ]; then
16+
echo
17+
echo "Please install Mac Ports from https://www.macports.org"
18+
echo
19+
exit 1
20+
fi
21+
22+
pip3 install --user virtualenv
23+

mac/02-install-c-deps.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Install C building dependencies
4+
echo "Installing port dependencies..."
5+
6+
sudo port install yasm x264 gnutls openssl sqlite3 ffmpeg mpfr libmpc libvpx wget gmp mpc
7+
8+
RESULT=$?
9+
if [ $RESULT -ne 0 ]; then
10+
echo
11+
echo "Failed to install all C dependencies"
12+
echo
13+
exit 1
14+
fi

mac/03-install-python-deps.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
if [ ! -d ~/work ]; then
3+
mkdir ~/work
4+
fi
5+
6+
arch=`python3 -c "import platform; print(platform.processor())"`
7+
pver=`python3 -c "import sys; print(sys.version[0:3])"`
8+
9+
envdir=sipsimple-python-$pver-$arch-env
10+
11+
if [ ! -d ~/work/$envdir ]; then
12+
mkdir ~/work/$envdir
13+
virtualenv -p /usr/local/bin/python3 ~/work/$envdir
14+
else
15+
echo "Environment exists in ~/work/$envdir"
16+
fi
17+
18+
source activate_venv.sh
19+
20+
export CFLAGS="-I/opt/local/include"
21+
export LDFLAGS="-L/opt/local/lib"
22+
23+
pip3 install --upgrade pip
24+
pip3 install -r python-requirements.txt
25+
pip3 install -r sipsimple-requirements.txt

mac/04-install_sipsimple.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
version="5.2.3-mac"
4+
wget https://github.com/AGProjects/python3-sipsimple/archive/refs/tags/$version.tar.gz
5+
6+
tar zxvf $version.tar.gz
7+
rm $version.tar.gz
8+
9+
source activate_venv.sh
10+
11+
cd python3-sipsimple-$version
12+
13+
echo "Installing SIP Simple SDK..."
14+
15+
chmod +x ./get_dependencies*
16+
./get_dependencies-211.sh
17+
18+
if [ $? -ne 0 ]; then
19+
echo
20+
echo "Failed to install all SIP SIMPLE SDK dependencies"
21+
echo
22+
exit 1
23+
fi
24+
25+
pip3 install .
26+
if [ $? -ne 0 ]; then
27+
echo
28+
echo "Failed to build SIP SIMPLE SDK"
29+
echo
30+
cd
31+
exit 1
32+
fi

mac/05-install_sipclients.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
source activate_venv.sh
3+
pip3 install https://github.com/AGProjects/sipclients3/archive/refs/tags/5.2.3.tar.gz

mac/activate_venv.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
arch=`python3 -c "import platform; print(platform.processor())"`
3+
pver=`python3 -c "import sys; print(sys.version[0:3])"`
4+
5+
venv="$HOME/work/sipsimple-python-$pver-$arch-env"
6+
7+
echo "Activating $venv..."
8+
9+
if [[ "$0" = "$BASH_SOURCE" ]]; then
10+
echo "Needs to be run using source: . activate_venv.sh"
11+
12+
else
13+
VENVPATH="$venv/bin/activate"
14+
source "$VENVPATH"
15+
fi

mac/python-requirements.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cython==0.29.37
2+
dnspython
3+
lxml
4+
twisted
5+
python-dateutil
6+
greenlet
7+
zope.interface
8+
requests
9+
gmpy2
10+
wheel
11+
gevent
12+
pytz
13+
certifi
14+
cryptography
15+
python3-application @ https://github.com/AGProjects/python3-application/archive/refs/tags/release-3.0.7.tar.gz

mac/sipsimple-requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python3-eventlib @ https://github.com/AGProjects/python3-eventlib/archive/refs/tags/0.3.0.tar.gz
2+
python3-gnutls @ https://github.com/AGProjects/python3-gnutls/archive/refs/tags/release-3.1.10.tar.gz
3+
python3-otr @ https://github.com/AGProjects/python3-otr/archive/refs/tags/2.0.2.tar.gz
4+
python3-xcaplib @ https://github.com/AGProjects/python3-xcaplib/archive/refs/tags/2.0.1.tar.gz
5+
python3-msrplib @ https://github.com/AGProjects/python3-msrplib/archive/refs/tags/0.21.0.tar.gz

0 commit comments

Comments
 (0)