Skip to content

Instantly share code, notes, and snippets.

@lehitoskin
Created May 1, 2014 17:47
Show Gist options
  • Save lehitoskin/f7fd4399b7ef2a96972c to your computer and use it in GitHub Desktop.
Save lehitoskin/f7fd4399b7ef2a96972c to your computer and use it in GitHub Desktop.
Install Tox Locally
#!/bin/bash
WORKSPACE=~/build
mkdir -p $WORKSPACE
cd $WORKSPACE
wget http://jenkins.tox.im/job/Tar_Sodium/lastSuccessfulBuild/artifact/sodium.tar
wget http://jenkins.tox.im/job/Tar_Tox/lastSuccessfulBuild/artifact/toxcore.tar
git clone http://github.com/naxuroqa/Venom
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
tar -xf sodium.tar
mv new libsodium
tar -xf toxcore.tar
mv new libtoxcore
tar -xzf djbdns-1.05.tar.gz
# build libsodium
cd $WORKSPACE/libsodium
autoreconf -if
sh ./autogen.sh
./configure --disable-shared --enable-static --prefix=$WORKSPACE/obj
make
make install
# build libtoxcore
cd $WORKSPACE/libtoxcore
autoreconf -if
./configure --enable-static --disable-shared --prefix=$WORKSPACE/obj --disable-ntox --disable-tests --disable-dht-bootstrap-daemon --with-libsodium-headers=$WORKSPACE/obj/include --with-libsodium-libs=$WORKSPACE/obj/lib
make
make install
# cjdns
cd $WORKSPACE/djbdns-1.05
echo gcc -O2 -include /usr/include/errno.h > conf-cc
make
# Venom
cd $WORKSPACE/Venom
mkdir build
cd build
echo "prefix=$WORKSPACE/obj
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libtoxcore
Description: Tox protocol library
Requires:
Version: 0.0.0
Libs: -L\${libdir} -ltoxcore -lsodium
Cflags: -I\${includedir}" > $WORKSPACE/obj/lib/pkgconfig/libtoxcore.pc
PKG_CONFIG_PATH=$WORKSPACE/obj/lib/pkgconfig CC='ccache gcc' cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/tmp -DLINK_TOX_STATIC=TRUE -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="g++" -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="gcc" -DCMAKE_C_FLAGS="${GOODCFLAGS}" -DDJBDNS_DIRECTORY="$WORKSPACE/djbdns-1.05"
make
make install
make clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment