diff options
Diffstat (limited to 'INSTALL.md')
-rw-r--r-- | INSTALL.md | 204 |
1 files changed, 188 insertions, 16 deletions
@@ -1,18 +1,22 @@ | |||
1 | #Install Instructions | 1 | #Install Instructions |
2 | 2 | ||
3 | - [Installation](#installation) | 3 | - [Installation](#installation) |
4 | - [Unix like](#unix) | 4 | - [Unix like](#unix) |
5 | - [OS X](#osx) | 5 | - [OS X](#osx) |
6 | - [Homebrew](#homebrew) | 6 | - [Homebrew](#homebrew) |
7 | - [Non-Homebrew](#non-homebrew) | 7 | - [Non-Homebrew](#non-homebrew) |
8 | - [Windows](#windows) | 8 | - [Windows](#windows) |
9 | 9 | - [Cross-Compile](#windows-cross-compile) | |
10 | - [Setting up a VM](#windows-cross-compile-vm) | ||
11 | - [Setting up the environment](#windows-cross-compile-environment) | ||
12 | - [Compiling](#windows-cross-compile-compiling) | ||
13 | - [Native](#windows-native) | ||
10 | - [Additional](#additional) | 14 | - [Additional](#additional) |
11 | - [Advanced configure options] (#aconf) | 15 | - [Advanced configure options](#aconf) |
12 | - [A/V support](#av) | 16 | - [A/V support](#av) |
13 | - [libtoxav] (#libtoxav) | 17 | - [libtoxav](#libtoxav) |
14 | - [Bootstrap daemon] (#bootstrapd) | 18 | - [Bootstrap daemon](#bootstrapd) |
15 | - [nTox] (#ntox) | 19 | - [nTox](#ntox) |
16 | 20 | ||
17 | <a name="installation" /> | 21 | <a name="installation" /> |
18 | ##Installation | 22 | ##Installation |
@@ -176,12 +180,182 @@ http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42 | |||
176 | <a name="windows" /> | 180 | <a name="windows" /> |
177 | ###Windows: | 181 | ###Windows: |
178 | 182 | ||
183 | <a name="windows-cross-compile" /> | ||
184 | |||
185 | ####Cross-compile | ||
186 | |||
187 | It's a bit challenging to build Tox and all of its dependencies nativly on Windows, so we will show an easier, less error and headache prone method of building it -- cross-compiling. | ||
188 | |||
189 | <a name="windows-cross-compile-vm" /> | ||
190 | #####Setting up a VM | ||
191 | |||
192 | We will assume that you don't have any VM running Linux around and will guide you from the ground up. | ||
193 | |||
194 | First, you would need to get a virtual machine and a Linux distribution image file. | ||
195 | |||
196 | For a virtual machine we will use VirtualBox. You can get it [here](https://www.virtualbox.org/wiki/Downloads). | ||
197 | |||
198 | For a Linux distribution we will use Lubuntu 14.04 32-bit, which you can get [here](https://help.ubuntu.com/community/Lubuntu/GetLubuntu). | ||
199 | |||
200 | After you have those downloaded, install the VirtualBox and create a VM in it. The default of 512mb of RAM and 8gb of dynamically-allocated virtual hard drive would be enough. | ||
201 | |||
202 | When you have created the VM, go into its **Settings** -> **System** -> **Processor** and add some cores, if you have any additional available, for faster builds. | ||
203 | |||
204 | Then, go to **Settings** -> **Storage**, click on **Empty** under **Controller: IDE**, click on the little disc icon on the right side of the window, click on **Choose a virtual CD/DVD disk file** and select the downloaded Lubuntu image file. | ||
205 | |||
206 | Start the VM and follow the installation instructions. | ||
207 | |||
208 | After Lubuntu is installed and you have booted into it, in VirtualBox menu on top of the window select **Devices** -> **Insert Guest Additions CD image...**. | ||
209 | |||
210 | Open terminal from **Lubuntu's menu** -> **Accessories**. | ||
211 | |||
212 | Execute: | ||
213 | ```bash | ||
214 | sudo apt-get update | ||
215 | sudo apt-get install build-essential -y | ||
216 | cd /media/*/*/ | ||
217 | sudo ./VBoxLinuxAdditions.run | ||
218 | ``` | ||
219 | |||
220 | After that, create a folder called `toxbuild` somewhere on your Windows system. The go to **Devices** -> **Shared Folders Settings...** in the VirtualBox menu, add the `toxbuild` folder there and set **Auto-mount** and **Make Permanent** options. | ||
221 | |||
222 | Execute: | ||
223 | ```bash | ||
224 | sudo adduser `whoami` vboxsf | ||
225 | ``` | ||
226 | Note the use of a [grave accent](http://en.wikipedia.org/wiki/Grave_accent) instead of an apostrophe. | ||
227 | |||
228 | Then just reboot the system with: | ||
229 | ```bash | ||
230 | sudo reboot | ||
231 | ``` | ||
232 | |||
233 | After the system is booted, go to **Devices** -> **Shared Clipboard** and select **Bidirectional**. Now you will be able to copy-paste text between the host and the guest systems. | ||
234 | |||
235 | Now that the virtual machine is all set up, let's move to getting build dependencies and setting up environment variables. | ||
236 | |||
237 | <a name="windows-cross-compile-environment" /> | ||
238 | #####Setting up the environment | ||
239 | |||
240 | First we will install all tools that we would need for building: | ||
241 | ```bash | ||
242 | sudo apt-get install build-essential libtool autotools-dev automake checkinstall check git yasm pkg-config mingw-w64 -y | ||
243 | ``` | ||
244 | |||
245 | Then we will define a few variables, **depending on which you will build either 32-bit or 64-bit Tox**. | ||
246 | |||
247 | For 32-bit Tox build, do: | ||
248 | ```bash | ||
249 | WINDOWS_TOOLCHAIN=i686-w64-mingw32 | ||
250 | LIB_VPX_TARGET=x86-win32-gcc | ||
251 | ``` | ||
252 | |||
253 | For 64-bit Tox build, do: | ||
254 | ```bash | ||
255 | WINDOWS_TOOLCHAIN=x86_64-w64-mingw32 | ||
256 | LIB_VPX_TARGET=x86_64-win64-gcc | ||
257 | ``` | ||
258 | |||
259 | This is the only difference between 32-bit and 64-bit build procedures. | ||
260 | |||
261 | For speeding up the build process do: | ||
262 | ``` | ||
263 | MAKEFLAGS=j$(nproc) | ||
264 | export MAKEFLAGS | ||
265 | ``` | ||
266 | |||
267 | And let's make a folder where we will be building everything at | ||
268 | ```bash | ||
269 | cd ~ | ||
270 | mkdir prefix | ||
271 | cd prefix | ||
272 | PREFIX_DIR=$(pwd) | ||
273 | cd .. | ||
274 | mkdir build | ||
275 | cd build | ||
276 | ``` | ||
277 | |||
278 | <a name="windows-cross-compile-compiling" /> | ||
279 | #####Compiling | ||
280 | |||
281 | Now we will build libraries needed for audio/video: VPX and Opus. | ||
282 | |||
283 | VPX: | ||
284 | ```bash | ||
285 | git clone http://git.chromium.org/webm/libvpx.git | ||
286 | cd libvpx | ||
287 | git checkout tags/v1.3.0 | ||
288 | CROSS="$WINDOWS_TOOLCHAIN"- ./configure --target="$LIB_VPX_TARGET" --prefix="$PREFIX_DIR" --disable-examples --disable-unit-tests --disable-shared --enable-static | ||
289 | make | ||
290 | make install | ||
291 | cd .. | ||
292 | ``` | ||
293 | |||
294 | Opus: | ||
295 | ```bash | ||
296 | wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz | ||
297 | tar -xf opus-1.1.tar.gz | ||
298 | cd opus-1.1 | ||
299 | ./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-extra-programs --disable-doc --disable-shared --enable-static | ||
300 | make | ||
301 | make install | ||
302 | cd .. | ||
303 | ``` | ||
304 | |||
305 | Now we will build sodium crypto library: | ||
306 | ```bash | ||
307 | git clone https://github.com/jedisct1/libsodium/ | ||
308 | cd libsodium | ||
309 | git checkout tags/0.4.5 | ||
310 | ./autogen.sh | ||
311 | ./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-shared --enable-static | ||
312 | make | ||
313 | make install | ||
314 | cd .. | ||
315 | ``` | ||
316 | |||
317 | And finally we will build Tox: | ||
318 | ```bash | ||
319 | git clone https://github.com/irungentoo/toxcore | ||
320 | cd toxcore | ||
321 | ./autogen.sh | ||
322 | ./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-ntox --disable-tests --disable-testing --with-dependency-search="$PREFIX_DIR" --disable-shared --enable-static | ||
323 | make | ||
324 | make install | ||
325 | cd .. | ||
326 | ``` | ||
327 | |||
328 | Then we make Tox shared library: | ||
329 | ```bash | ||
330 | cd "$PREFIX_DIR" | ||
331 | mkdir tmp | ||
332 | cd tmp | ||
333 | $WINDOWS_TOOLCHAIN-ar x ../lib/libtoxcore.a | ||
334 | $WINDOWS_TOOLCHAIN-ar x ../lib/libtoxav.a | ||
335 | $WINDOWS_TOOLCHAIN-ar x ../lib/libtoxdns.a | ||
336 | $WINDOWS_TOOLCHAIN-gcc -Wl,--export-all-symbols -Wl,--out-implib=libtox.dll.a -shared -o libtox.dll *.o ../lib/*.a /usr/$WINDOWS_TOOLCHAIN/lib/libwinpthread.a -lws2_32 -static-libgcc | ||
337 | ``` | ||
338 | |||
339 | And we will copy it over to the `toxbuild` directory: | ||
340 | ```bash | ||
341 | mkdir -p /media/sf_toxbuild/release/lib | ||
342 | mv libtox.dll* /media/sf_toxbuild/release/lib | ||
343 | mkdir -p /media/sf_toxbuild/release/include | ||
344 | mv ../include/tox /media/sf_toxbuild/release/include | ||
345 | ``` | ||
346 | |||
347 | That's it. Now you should have `release/lib/libtox.dll` and `release/include/tox/<headers>` in your `toxbuild` directory on the Windows system. | ||
348 | |||
349 | <a name="windows-native" /> | ||
350 | ####Native | ||
351 | |||
352 | Note that the Native instructions are incomplete, in a sense that they miss instructions needed for adding audio/video support to Tox. You also might stumble upon some unknown MinGW+msys issues while trying to build it. | ||
353 | |||
179 | You should install: | 354 | You should install: |
180 | - [MinGW](http://sourceforge.net/projects/mingw/) | 355 | - [MinGW](http://sourceforge.net/projects/mingw/) |
181 | 356 | ||
182 | When installing MinGW, make sure to select the MSYS option in the installer. | 357 | When installing MinGW, make sure to select the MSYS option in the installer. |
183 | MinGW will install an "MinGW shell" (you should get a shortcut for it), make | 358 | MinGW will install an "MinGW shell" (you should get a shortcut for it), make sure to perform all operations (i.e., generating/running configure script, compiling, etc.) from the MinGW shell. |
184 | sure to perform all operations (i.e., generating/running configure script, compiling, etc.) from the MinGW shell. | ||
185 | 359 | ||
186 | First download the source tarball from https://download.libsodium.org/libsodium/releases/ and build it. | 360 | First download the source tarball from https://download.libsodium.org/libsodium/releases/ and build it. |
187 | Assuming that you got the libsodium-0.5.0.tar.gz release: | 361 | Assuming that you got the libsodium-0.5.0.tar.gz release: |
@@ -194,8 +368,7 @@ make install | |||
194 | cd .. | 368 | cd .. |
195 | ``` | 369 | ``` |
196 | 370 | ||
197 | You can also use a precompiled win32 binary of libsodium, however you will have | 371 | You can also use a precompiled win32 binary of libsodium, however you will have to place the files in places where they can be found, i.e., dll's go to /bin headers to /include and libraries to /lib directories in your MinGW shell. |
198 | to place the files in places where they can be found, i.e., dll's go to /bin headers to /include and libraries to /lib directories in your MinGW shell. | ||
199 | 372 | ||
200 | Next, install ProjectTox-Core library, should either clone this repo by using git, or just download a [zip of current Master branch](https://github.com/irungentoo/ProjectTox-Core/archive/master.zip) and extract it somewhere. | 373 | Next, install ProjectTox-Core library, should either clone this repo by using git, or just download a [zip of current Master branch](https://github.com/irungentoo/ProjectTox-Core/archive/master.zip) and extract it somewhere. |
201 | 374 | ||
@@ -335,4 +508,3 @@ Install on ubuntu: | |||
335 | ```bash | 508 | ```bash |
336 | sudo apt-get install ncurses-dev | 509 | sudo apt-get install ncurses-dev |
337 | ``` | 510 | ``` |
338 | |||