diff --git a/docs/Install.osx b/docs/Install.osx index 092c1425..dff5b87b 100644 --- a/docs/Install.osx +++ b/docs/Install.osx @@ -1,140 +1,144 @@ Installation procedure for SIP SIMPLE SDK on MacOSX --------------------------------------------------- Home page: http://sipsimpleclient.org This document describes the installation procedure on MacOSX >= 10.14 The installation procedure consists of the steps described below: Step 1. Prerequisites Step 2. Install dependencies Step 3. Install SIP SIMPLE SDK Step 1. Prerequisites --------------------- - * MacOSX >= 10.14 - * Apple Developer tools (XCode 11) + * MacOSX 13 + * Apple Developer tools (XCode 14) * MacPorts from https://guide.macports.org Step 2. Install dependencies ---------------------------- See Dependencies.txt for detailed description of the required libraries and their minimum version number. A. Install the C dependencies Install some building tools: sudo port install darcs pkg-config yasm Install the dynamic libraries required by sipsimple: sudo port install x264 gnutls openssl sqlite3 gnutls ffmpeg mpfr libmpc libvpx If building for the Mac Store or a notarized version a lot more attention is required to build all dependencies. All dynamic libraries must: 1. be signed with an Apple developer account 2. contain LC_VERSION_MIN_MACOSX option 3. not load non-system libraries from outside the sandbox For solving 2) all port packages and their depedencies must be re-compiled from sources. First locate all the dependencies of each package: otool -L /opt/local/lib/XYZ.dylib For each found dependency, remove the binary package and reinstall the port from source: sudo port uninstall package sudo port -s install package Check if the library contains LC_VERSION_MIN_MACOSX flag, for example: otool -l /opt/local/lib/libgnutls.dylib |grep -B1 -A3 LC_VERSION_MIN_MACOSX Load command 8 cmd LC_VERSION_MIN_MACOSX cmdsize 16 version 10.11 sdk 10.14 For solving 3) use install_name_tool as follows: old_path="/opt/local/lib/\|/usr/local/opt/libmpc/lib/" # <-- add all native lib paths new_path="@executable_path/../Frameworks/" # <- replace with relative path inside sandbox for library in $@; do new_basename=$(basename $library) echo $new_basename install_name_tool -id $new_path$new_basename $library dependencies=$(otool -L $library | grep $old_path | awk '{print $1}') for dependency in $dependencies; do new_basename=$(basename $dependency) new_name="$new_path$new_basename" install_name_tool -change $dependency $new_name $library done done For example: otool -L /opt/local/lib/libgnutls.dylib /opt/local/lib/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.1.0) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.255.3) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1575.17.0) /opt/local/lib/libp11-kit.0.dylib (compatibility version 4.0.0, current version 4.0.0) /opt/local/lib/libidn2.0.dylib (compatibility version 4.0.0, current version 4.7.0) /opt/local/lib/libunistring.2.dylib (compatibility version 4.0.0, current version 4.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1) /opt/local/lib/libtasn1.6.dylib (compatibility version 13.0.0, current version 13.0.0) /opt/local/lib/libnettle.8.dylib (compatibility version 8.0.0, current version 8.1.0) /opt/local/lib/libhogweed.6.dylib (compatibility version 6.0.0, current version 6.1.0) /opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0) /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0) after running install_name_tool becomes: otool -L Frameworks/libgnutls.30.dylib @executable_path/../Frameworks/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.1.0) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.255.3) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1575.17.0) @executable_path/../Frameworks/libp11-kit.0.dylib (compatibility version 4.0.0, current version 4.0.0) @executable_path/../Frameworks/libidn2.0.dylib (compatibility version 4.0.0, current version 4.7.0) @executable_path/../Frameworks/libunistring.2.dylib (compatibility version 4.0.0, current version 4.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1) @executable_path/../Frameworks/libtasn1.6.dylib (compatibility version 13.0.0, current version 13.0.0) @executable_path/../Frameworks/libnettle.8.dylib (compatibility version 8.0.0, current version 8.1.0) @executable_path/../Frameworks/libhogweed.6.dylib (compatibility version 6.0.0, current version 6.1.0) @executable_path/../Frameworks/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0) @executable_path/../Frameworks/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0) Building libvpx library ----------------------- To obtain LC_VERSION_MIN_MACOSX for libvpx.dylib: Download the sources of libvpx from github. Run configure, then edit libs.mk and change the line: $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm to: $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm -mmacosx-version-min=10.11 Step 3. Install SIP SIMPLE SDK ------------------------------ See Install.linux document Same steps related to C dependencies must be taken for .so dynamic libraries that are part of Python packages on which the SDK depends. + +See install_osx_user.sh script in the top directory. + + diff --git a/get_dependencies.sh b/get_dependencies.sh index b4b49dcf..ed2112b9 100755 --- a/get_dependencies.sh +++ b/get_dependencies.sh @@ -1,79 +1,82 @@ #!/bin/bash -# -# Update PJSIP -# +unamestr=$(uname) +if [[ "$unamestr" == 'Linux' ]]; then sudo apt install python3 dh-python python3-all-dev cython3 libasound2-dev \ python3-dateutil python3-dnspython libssl-dev libv4l-dev libavcodec-dev \ libavformat-dev libopencore-amrnb-dev libopencore-amrwb-dev libavutil-dev \ libswscale-dev libx264-dev libvpx-dev libopus-dev libsqlite3-dev pkg-config \ uuid-dev cython cython-dbg python3-setuptools devscripts debhelper dh-python \ python3-all-dev python3-all-dbg libasound2-dev libssl-dev libsqlite3-dev +fi cd deps +# +# Update PJSIP +# echo "Preparing PJSIP sources..." if [ ! -f 2.10.tar.gz ]; then echo Downloading PJSIP 2.10... wget https://github.com/pjsip/pjproject/archive/2.10.tar.gz if [ $? -eq 0 ]; then echo "PJSIP downloaded" else echo Fail to download PJSIP exit 1 fi fi tar xzf 2.10.tar.gz if [ -d pjsip ]; then rm -r pjsip fi mkdir pjsip mv pjproject*/* ./pjsip/ # # Update ZSRTP # # Clone latest version from github if [ ! -d ZRTPCPP ]; then echo Downloading ZRTP... git clone https://github.com/wernerd/ZRTPCPP.git if [ $? -eq 0 ]; then echo "ZRTP downloaded" cd ZRTPCPP git checkout 6b3cd8e6783642292bad0c21e3e5e5ce45ff3e03 cd .. else echo Fail to download ZRTP exit 1 fi fi # Copy wrapper from old version to third_party/zsrtp/ echo "Preparing ZRTP sources..." mkdir ./pjsip/third_party/zsrtp cp -r zsrtp/include ./pjsip/third_party/zsrtp/ cp -r zsrtp/srtp ./pjsip/third_party/zsrtp/ cp -r zsrtp/build ./pjsip/third_party/build/zsrtp # Copy new version to third_party/zsrtp/ mkdir ./pjsip/third_party/zsrtp/zrtp cp -r ZRTPCPP/bnlib ./pjsip/third_party/zsrtp/zrtp/ cp -r ZRTPCPP/common ./pjsip/third_party/zsrtp/zrtp/ cp -r ZRTPCPP/cryptcommon ./pjsip/third_party/zsrtp/zrtp/ cp -r ZRTPCPP/srtp ./pjsip/third_party/zsrtp/zrtp/ cp -r ZRTPCPP/zrtp ./pjsip/third_party/zsrtp/zrtp/ cp ZRTPCPP/COPYING ./pjsip/third_party/zsrtp/zrtp/ cp ZRTPCPP/README.md ./pjsip/third_party/zsrtp/zrtp/ for p in patches/0*.patch; do echo "Applying patch $p" cat $p | patch -p0 > /dev/null done cd - > /dev/null diff --git a/install_osx_user.sh b/install_osx_user.sh new file mode 100644 index 00000000..c546a6ca --- /dev/null +++ b/install_osx_user.sh @@ -0,0 +1,25 @@ +#!/bin/bash +sudo port install darcs yasm x264 gnutls openssl sqlite3 gnutls ffmpeg mpfr libmpc libvpx + +pip3 install --user cython==0.29.37 dnspython lxml twisted python-dateutil greenlet zope.interface requests gmpy2 wheel gevent + +./get_dependencies.sh + +cd .. +for p in python3-application python3-eventlib python3-gnutls python3-otr python3-msrplib python3-xcaplib; do + if [ ! -d $p ]; then + darcs clone http://devel.ag-projects.com/repositories/$p + fi + cd $p + pip3 install --user . + cd .. +done + +cd python3-sipsimple +pip3 install --user . +cd .. + +cd sipclients3 +pip3 install --user . +cd .. +