README.macos.md 6.07 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 22 23



24
##### Linphone library (liblinphone)
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
25

26
        sudo port install automake autoconf libtool pkgconfig intltool wget cunit \
27
        antlr3 speex libvpx readline sqlite3 openldap libupnp \
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
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 35
        sudo port install gtk2 +quartz +no_x11 libsoup
        sudo port install gtk-osx-application +no_python
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
36
        sudo port install hicolor-icon-theme
37

38
#### Using HomeBrew
39

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

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
42
        brew tap Gui13/linphone
43
        brew install intltool libtool wget pkg-config automake libantlr3.4c \
François Grisez's avatar
François Grisez committed
44
                antlr3.2 gettext speex ffmpeg readline libvpx opus
45 46
        ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
        brew link --force gettext
47

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

François Grisez's avatar
François Grisez committed
50
	brew install cairo --without-x11
51
        brew install gtk+ --without-x11
52
        brew install gettext gtk-mac-integration libsoup hicolor-icon-theme
53 54 55
        #readline is required from linphonec.c otherwise compilation will fail
        brew link readline --force

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
56
### Building Linphone
57 58 59 60 61

The next pieces need to be compiled manually.

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

François Grisez's avatar
François Grisez committed
62 63
        export MACOSX_DEPLOYMENT_TARGET=10.7
        export LDFLAGS="-Wl,-headerpad_max_install_names"
64

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

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
67 68 69 70 71
        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
72 73

* Install polarssl (encryption library used by belle-sip)
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
74 75 76 77 78

        git clone git://git.linphone.org/polarssl.git -b linphone
        cd polarssl
        ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
79 80 81

* Install belle-sip (sip stack)

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
82 83 84 85
        git clone git://git.linphone.org/belle-sip.git
        cd belle-sip
        ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
86 87 88

* (Optional) Install srtp for call encryption

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
89 90 91
        git clone git://git.linphone.org/srtp.git
        cd srtp && autoconf && ./configure --prefix=/opt/local && make libsrtp.a
        sudo make install
92

Gautier Pelloux-Prayer's avatar
Gautier Pelloux-Prayer committed
93
* (Optional) Install zrtp, for unbreakable call encryption
94

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
95 96 97
        git clone git://git.linphone.org:bzrtp
        cd bzrtp && ./autogen.sh && ./configure --prefix=/opt/local && make
        sudo make install
98 99 100

* (Optional) Install gsm codec

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
101 102 103 104
        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
105 106 107 108 109 110 111 112

* (Optional) libvpx-1.2 has a bug on MacOS resulting in ugly video. It is recommended to upgrade it manually to 1.3 from source.
The libvpx build isn't able to produce dual architecture files. To workaround this, configure libvpx twice and use lipo to create a dual architecture `libvpx.a`.

* (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:

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
113
        ./configure --prefix=/opt/local && make && sudo make install
114 115 116

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

119
        PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict && make
120 121 122

* Install on the system

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
123
        sudo make install
124

125
 You are done.
126 127 128 129 130

### Generate portable bundle

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

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
131
        git clone https://github.com/jralls/gtk-mac-bundler.git
François Grisez's avatar
François Grisez committed
132 133 134
        cd gtk-mac-bundler
	git checkout 6e2ed855aaeae43c29436c342ae83568573b5636
	make install
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
135
        export PATH=$PATH:~/.local/bin
136
        # make this dummy charset.alias file for the bundler to be happy:
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
137
        sudo touch /opt/local/lib/charset.alias
François Grisez's avatar
François Grisez committed
138 139 140
	# 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
141 142 143 144

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:

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
145 146 147
        <binary>
        ${prefix:ms2plugins}/lib/mediastreamer/plugins/*.*.so
        </binary>
148

149 150 151 152 153 154
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:
155 156 157

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

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

Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
160
        make && make bundle
161 162 163 164

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).
165
	sudo port install gnome-common
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
166 167
        git clone https://github.com/jralls/gtk-quartz-engine.git
        cd gtk-quartz-engine
168
        ./autogen.sh
Guillaume BIENKOWSKI's avatar
Guillaume BIENKOWSKI committed
169 170
        ./configure --prefix=/opt/local CFLAGS="$CFLAGS -Wno-error" && make
        sudo make install
171 172 173 174 175 176 177

Generate a new bundle to have it included.