README.macos.md 6.31 KB
Newer Older
1
# Linphone on MacOS X
2

3
## Build prerequisite
4 5

* Xcode (download from apple or using appstore application)
6 7
* [Java SE](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or openJDK
 This is required to generate a C sourcefile from SIP grammar using [antlr3](http://www.antlr3.org/) generator.
Simon Morlat's avatar
Simon Morlat committed
8
* [HomeBrew](http://brew.sh) or [Macports](http://www.macports.org/).
9

10 11 12 13 14
### Dependencies

#### Using MacPorts

##### Multiple MacOS version support
15

16
In order to enable generation of bundle for older MacOS version, it is recommended to:
17

18
 Edit `/opt/local/etc/macports/macports.conf` to add the following line:
19

20
 > macosx_deployment_target 10.7
21
 > buildfromsource always
22 23


24
##### Linphone library (liblinphone)
25

26
        sudo port install automake autoconf libtool pkgconfig intltool wget bcunit \
27
        antlr3 speex readline sqlite3 openldap libupnp \
28
        ffmpeg-devel -gpl2
29

30 31 32
##### Linphone UI (GTK version)

Install `GTK`. It is recommended to use the `quartz` backend for better integration.
33

34
        sudo port install gtk2 +quartz +no_x11
35
        sudo port install gtk-osx-application-gtk2 +no_python
36
        sudo port install hicolor-icon-theme
37

38
#### Using HomeBrew
39

40 41
##### Linphone library (liblinphone)

42
        brew install intltool libtool wget pkg-config automake libantlr3.4c \
43
                homebrew/versions/antlr3 gettext speex ffmpeg readline libvpx opus
44 45
        ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
        brew link --force gettext
46 47
        #readline is required from linphonec.c otherwise compilation will fail
        brew link readline --force
48

49 50
##### Linphone UI (GTK version)

51
        brew install cairo --without-x11
52
        brew install gtk+ --without-x11
53
        brew install gtk-mac-integration hicolor-icon-theme
54

55
### Building Linphone
56 57 58 59 60

The next pieces need to be compiled manually.

* To ensure compatibility with multiple MacOS versions it is recommended to do:

61 62
        export MACOSX_DEPLOYMENT_TARGET=10.7
        export LDFLAGS="-Wl,-headerpad_max_install_names"
63

64
* (MacPorts only) Install libantlr3c (library used by belle-sip for parsing)
65

66 67 68 69 70
        git clone -b linphone git://git.linphone.org/antlr3.git
        cd antlr3/runtime/C
        ./autogen.sh
        ./configure --disable-static --prefix=/opt/local && make
        sudo make install
71 72

* Install polarssl (encryption library used by belle-sip)
73

74
        git clone git://git.linphone.org/polarssl.git
75 76 77
        cd polarssl
        ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
78

79 80
* Install libvpx (Must be manualy build because the macport recipe does not support 'macosx_deployment_target')

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
        git clone https://chromium.googlesource.com/webm/libvpx -b v1.4.0
        cd libvpx
        ./configure --prefix=/opt/local \
                --target=x86_64-darwin10-gcc \
                --enable-error-concealment \
                --enable-multithread \
                --enable-realtime-only \
                --enable-spatial-resampling \
                --enable-vp8 \
                --disable-vp9 \
                --enable-libs \
                --disable-install-docs \
                --disable-debug-libs \
                --disable-examples \
                --disable-unit-tests \
                --as=yasm
        make
        sudo make install
99

100 101
* Install belle-sip (sip stack)

102 103 104 105
        git clone git://git.linphone.org/belle-sip.git
        cd belle-sip
        ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
106 107 108

* (Optional) Install srtp for call encryption

109 110 111
        git clone git://git.linphone.org/srtp.git
        cd srtp && autoconf && ./configure --prefix=/opt/local && make libsrtp.a
        sudo make install
112

113
* (Optional) Install zrtp, for unbreakable call encryption
114

115
        git clone git://git.linphone.org/bzrtp.git
116 117
        cd bzrtp && ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
118 119 120

* (Optional) Install gsm codec

121 122 123 124
        git clone git://git.linphone.org/gsm.git
        cd gsm
        make CCFLAGS="$CFLAGS -c -O2 -DNeedFunctionPrototypes=1"
        sudo make install INSTALL_ROOT=/opt/local GSM_INSTALL_INC=/opt/local/include
125 126 127 128 129

* (Optional, proprietary extension only) Compile and install the tunnel library
 If you got the source code from git, run `./autogen.sh` first.
 Then or otherwise, do:

130
        ./configure --prefix=/opt/local && make && sudo make install
131 132 133

* Compile Linphone
 If you got the source code from git, run `./autogen.sh` first.
134
 Then or otherwise, :
135

136
        PKG_CONFIG_PATH=/opt/local/lib/pkgconfig ./configure --prefix=/opt/local --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict && make
137 138 139

* Install on the system

140
        sudo make install
141

142
 You are done.
143 144 145

### Generate portable bundle

146
If you want to generate a portable bundle, then install `gtk-mac-bundler` linphone fork:
147

148 149
	git clone git://git.linphone.org/gtk-mac-bundler.git
	cd gtk-mac-bundler
150
	make install
151
    export PATH=$PATH:~/.local/bin
152 153 154
	# set writing right for owner on the libssl and libcrypto libraries in order gtk-mac-bundler
	# be able to rewrite their rpath
	sudo chmod u+w /opt/local/lib/libssl.1.0.0.dylib /opt/local/lib/libcrypto.1.0.0.dylib
155 156 157 158

The bundler file in `build/MacOS/linphone.bundle` expects some plugins to be installed in `/opt/local/lib/mediastreamer/plugins`.
If you don't need plugins, remove or comment out this line from the bundler file:

159 160 161
        <binary>
        ${prefix:ms2plugins}/lib/mediastreamer/plugins/*.*.so
        </binary>
162

163 164 165 166 167 168
If using HomeBrew, this is not working yet. However you will at least need to:

        brew install shared-mime-info glib-networking hicolor-icon-theme
        update-mime-database /usr/local/share/mime

 And modify also:
169 170 171

        <prefix name="default">/usr/local</prefix>

172 173
Then run, inside Linphone source tree configure as told before but with `--enable-relativeprefix` appended.

174
        make && make bundle
175 176 177 178

The resulting bundle is located in Linphone build directory, together with a zipped version.

* For a better appearance, you can install `gtk-quartz-engine` (a GTK theme) that makes GTK application more similar to other Mac applications (but not perfect).
179
	sudo port install gnome-common
180 181 182 183 184
	git clone https://github.com/jralls/gtk-quartz-engine.git
	cd gtk-quartz-engine
	./autogen.sh
	./configure --prefix=/opt/local CFLAGS="$CFLAGS -Wno-error" && make
	sudo make install
185 186 187 188 189 190 191

Generate a new bundle to have it included.