From f39c160db9904830dff0b88ff25a4999c1febbf8 Mon Sep 17 00:00:00 2001 From: lyubod Date: Tue, 7 Oct 2014 05:45:51 +0300 Subject: [PATCH 1/3] Create osx_build_script_toxcore.txt OS X shell script to do everything from git pull to sudo make install for toxcore, after dependencies have already been installed, by MacPorts, from source, etc. --- osx_build_script_toxcore.txt | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 osx_build_script_toxcore.txt diff --git a/osx_build_script_toxcore.txt b/osx_build_script_toxcore.txt new file mode 100644 index 00000000..8aea0d1c --- /dev/null +++ b/osx_build_script_toxcore.txt @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# written by Lubo Diakov +# hard coded toxcore directory, replace with other path or variable as needed +cd ~/Downloads/toxcore +echo "Now working in:"`pwd` + +# must have working git binary, and have done git clone at least once before +git pull +echo "If git pull responds: Already up-to-date. you can cancel the build" +echo "by typing anything except y or Y below" +read -p "Continue with build? (enter y to continue): " Last_Chance + +# blah blah +if [[ $Last_Chance = [Yy] ]]; then echo "Continuing!"; +else echo "Aborted!"; exit +fi +sleep 3 + +# if libsodium is built with macports, link it from /opt/local/ to /usr/local +if [ ! -L "/usr/local/lib/libsodium.dylib" ]; then + # Control will enter here if $DIRECTORY doesn't exist. + ln -s /opt/local/lib/libsodium.dylib /usr/local/lib/libsodium.dylib +fi +echo "The symlink /usr/local/lib/libsodium.dylib exists." +sleep 3 + +# replace ppc, i386 as needed. +./configure CC="gcc -arch ppc -arch i386" CXX="g++ -arch ppc -arch i386" CPP="gcc -E" CXXCPP="g++ -E" + +# get rid of prior builds, start clean +make clean +make +echo "" +echo "Sudo is required for make install only, all other steps run without it." +echo "Please type your sudo password below for make install:" +sudo make install + +exit From 660843c873725ba1bd90e6af2c61ba18135eee3d Mon Sep 17 00:00:00 2001 From: lyubod Date: Tue, 7 Oct 2014 05:52:09 +0300 Subject: [PATCH 2/3] Update INSTALL.md Added MacPorts related info. to Section heading "OS X Non-homebrew" --- INSTALL.md | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 824cfb5f..17e23f29 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -152,12 +152,31 @@ Grab the following packages: * https://gnu.org/software/automake/ * https://github.com/jedisct1/libsodium * http://check.sourceforge.net/ - * http://yasm.tortall.net/Download.html + * http://yasm.tortall.net/Download.html (install before libvpx) * https://code.google.com/p/webm/downloads/list * http://www.opus-codec.org/downloads/ * http://www.freedesktop.org/wiki/Software/pkg-config/ -You must install yasm before installing libvpx, otherwise libvpx will fail to make correctly. +Macports: (https://www.macports.org/) +All toxcore dependencies can be installed from MacPorts. This is often easier on PowerPC Macs, and any version of OS X prior to 10.6, since Homebrew is supported on 10.6 and up, but not much (or at all) on older systems. A few have slightly different package names from the corresponding package in Debian. + +Same: libtool autoconf automake libsodium check yasm +Different: libvpx (webm) libopus pkgconfig gettext + +(the libintl, from gettext, built into OS X 10.5 is missing libintl_setlocale, but the Macports build has it) + +Verify where libintl is on your system: (MacPorts puts it in /opt/local) +$ for d in /usr/local/lib /opt/local/lib /usr/lib /lib; do ls -l $d/libintl.*; done + +Check if that copy has libintl_setlocale: +nm /opt/local/lib/libintl.8.dylib | grep _libintl_setlocale + +Certain other tools may not be installed, or outdated, and should also be installed from MacPorts for simplicity: git cmake + +If libsodium was installed with MacPorts, you may want to symlink the copy in /opt/local/lib to /usr/local/lib. That way you don't need special configure switches for toxcore to find libsodium, and every time MacPorts updates libsodium, the new version will be linked to toxcore every time you build: +ln -s /opt/local/lib/libsodium.dylib /usr/local/lib/libsodium.dylib + +Much of the build can then be done as for other platforms: git clone, and so on. Differences will be noted with (OS X 10.5 specific) pkg-config is important for enabling a/v support in tox core, failure to install pkg-config will prevent tox core form finding the required libopus/libvpx libraries. (pkg-config may not configure properly, if you get an error about GLIB, run configure with the following parameter, --with-internal-glib). @@ -174,9 +193,21 @@ Compiling and installing Tox Core ```bash cd toxcore autoreconf -i -./configure +./configure (OS X 10.5 specific) +./configure CC="gcc -arch ppc -arch i386" CXX="g++ -arch ppc -arch i386" CPP="gcc -E" CXXCPP="g++ -E" make -make install +make install (OS X 10.5 specific) +should be: sudo make install +If it worked, you should have all the toxcore dylibs in /usr/local/lib: (besides the four below, the rest are symlinks to these) +$ ls -la /usr/local/lib/libtox*.dylib +libtoxav.0.dylib +libtoxcore.0.dylib +libtoxdns.0.dylib +libtoxencryptsave.0.dylib +to check what CPU architecture they're compiled for: +$ lipo -i /usr/local/lib/libtoxencryptsave.0.dylib +You should now be able to move on to compiling Toxic/Venom or some other client application +There is also a shell script called "osx_build_script_toxcore.txt" which automates everything from "git pull" to "sudo make install", once the dependencies are already taken care of by MacPorts. ``` If after running ./configure you get an error about core being unable to find libsodium (and you have installed it) run the following in place of ./configure; From eaf15bfb8901dbc0771cfe6228c17efe7b1405a8 Mon Sep 17 00:00:00 2001 From: lyubod Date: Tue, 7 Oct 2014 06:41:22 +0300 Subject: [PATCH 3/3] Update INSTALL.md --- INSTALL.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 17e23f29..14d2ef67 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -158,9 +158,12 @@ Grab the following packages: * http://www.freedesktop.org/wiki/Software/pkg-config/ Macports: (https://www.macports.org/) -All toxcore dependencies can be installed from MacPorts. This is often easier on PowerPC Macs, and any version of OS X prior to 10.6, since Homebrew is supported on 10.6 and up, but not much (or at all) on older systems. A few have slightly different package names from the corresponding package in Debian. +All toxcore dependencies can be installed from MacPorts. This is often easier on PowerPC Macs, +and any version of OS X prior to 10.6, since Homebrew is supported on 10.6 and up, but not much +(or at all) on older systems. A few packages have slightly different names from the corresponding +package in Debian. -Same: libtool autoconf automake libsodium check yasm +Same: libtool autoconf automake libsodium check yasm Different: libvpx (webm) libopus pkgconfig gettext (the libintl, from gettext, built into OS X 10.5 is missing libintl_setlocale, but the Macports build has it)