summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-04 00:06:47 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-02-04 00:36:31 +0000
commitf41c11c34e04e6d7a04cb20f79bc2643c0e33dd1 (patch)
treed6de2568920dc521d4d57680ac396dc5d5212859
parent99bfb9a4f2b15d3b5a9fe3878df2eb5e55c428aa (diff)
Use more ubuntu packages; remove hstox for now.
Since trusty has more up-to-date packages, we can remove some of the custom install code. Also, we're not using hstox at the moment, so there is no need to slow down the builds for now.
-rw-r--r--.travis.yml21
-rwxr-xr-xother/travis/toxcore-linux-install60
-rw-r--r--toxcore/onion_announce.c4
-rw-r--r--toxcore/tox_api.c20
4 files changed, 16 insertions, 89 deletions
diff --git a/.travis.yml b/.travis.yml
index 9c6d1ef1..48f5ce3a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,22 +15,18 @@ matrix:
15 apt: &apt-dependencies 15 apt: &apt-dependencies
16 sources: 16 sources:
17 - avsm 17 - avsm
18 - hvr-ghc
19 packages: 18 packages:
20 - alex-3.1.7 # For hstox. 19 - aspcud # For Opam
21 - cabal-install-1.18 # For hstox.
22 - check # For tests. 20 - check # For tests.
23 - ghc-7.8.4 # For hstox. 21 - libconfig-dev # For tox-bootstrapd.
24 - happy-1.19.5 # For hstox.
25 - libcv-dev # For av_test. 22 - libcv-dev # For av_test.
26 - libhighgui-dev # For av_test. 23 - libhighgui-dev # For av_test.
27 - libopencv-contrib-dev # For av_test. 24 - libopencv-contrib-dev # For av_test.
25 - libopus-dev # For toxav.
28 - libsndfile1-dev # For av_test. 26 - libsndfile1-dev # For av_test.
29 - libvpx-dev # For toxav. 27 - libvpx-dev # For toxav.
30 - opam # For apidsl and Frama-C. 28 - opam # For apidsl and Frama-C.
31 - aspcud # For Opam
32 - portaudio19-dev # For av_test. 29 - portaudio19-dev # For av_test.
33 - texinfo # For libconfig.
34 - stage: "Stage 1" 30 - stage: "Stage 1"
35 if: type IN (push, api, cron) 31 if: type IN (push, api, cron)
36 env: JOB=autotools ENV=linux 32 env: JOB=autotools ENV=linux
@@ -86,13 +82,6 @@ matrix:
86 82
87cache: 83cache:
88 directories: 84 directories:
89 # Although Travis documentation says not to rely on the value of $HOME, we
90 # rely on it here because cabal installs its packages there by default. If
91 # that ever changes, these values need to be updated.
92 # Note that we can't use shell expressions in these paths, so we can't ask
93 # cabal where its data is stored.
94 - $HOME/.cabal
95 - $HOME/.ghc
96 - $HOME/cache 85 - $HOME/cache
97 - /opt/freebsd/cache 86 - /opt/freebsd/cache
98 87
@@ -108,7 +97,3 @@ notifications:
108 template: 97 template:
109 - "%{result} %{repository_name} %{build_url}" 98 - "%{result} %{repository_name} %{build_url}"
110 - "#%{build_number} changes: %{compare_url}" 99 - "#%{build_number} changes: %{compare_url}"
111
112branches:
113 only:
114 - master
diff --git a/other/travis/toxcore-linux-install b/other/travis/toxcore-linux-install
index cc567a20..6d72728d 100755
--- a/other/travis/toxcore-linux-install
+++ b/other/travis/toxcore-linux-install
@@ -21,7 +21,7 @@ sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyo
21 21
22# Install astyle (version in ubuntu-precise too old). 22# Install astyle (version in ubuntu-precise too old).
23[ -f $ASTYLE ] || { 23[ -f $ASTYLE ] || {
24 wget -O ../astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz 24 wget -O ../astyle.tar.gz http://http.debian.net/debian/pool/main/a/astyle/astyle_2.06.orig.tar.gz
25 tar -xf ../astyle.tar.gz -C $CACHE_DIR 25 tar -xf ../astyle.tar.gz -C $CACHE_DIR
26 make -C $CACHE_DIR/astyle/build/gcc -j$NPROC 26 make -C $CACHE_DIR/astyle/build/gcc -j$NPROC
27} 27}
@@ -35,61 +35,3 @@ sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyo
35 make install -j$NPROC 35 make install -j$NPROC
36 cd - # popd 36 cd - # popd
37} 37}
38
39# Install msgpack-c.
40[ -f $CACHE_DIR/lib/libmsgpackc.so ] || {
41 git clone --depth=1 https://github.com/msgpack/msgpack-c ../msgpack-c
42 $CC -shared -fPIC -O3 -I../msgpack-c/include ../msgpack-c/src/*.c -o $CACHE_DIR/lib/libmsgpackc.so
43 cp -a ../msgpack-c/include/* $CACHE_DIR/include/
44 sed -e "s|@prefix@|$CACHE_DIR|" \
45 -e 's|@exec_prefix@|${prefix}|' \
46 -e 's|@libdir@|${prefix}/lib|' \
47 -e 's|@includedir@|${prefix}/include|' \
48 -e 's|@VERSION@|2.1.1|' \
49 ../msgpack-c/msgpack.pc.in \
50 > $CACHE_DIR/lib/pkgconfig/msgpack.pc
51 # TODO(iphydf): This doesn't work, because the cmake version on travis is too
52 # old. We're building it manually, instead.
53 # cd ../msgpack-c # pushd
54 # cmake . -DCMAKE_INSTALL_PREFIX:PATH=$CACHE_DIR \
55 # -DMSGPACK_ENABLE_CXX=OFF \
56 # -DMSGPACK_BUILD_EXAMPLES=OFF \
57 # -DMSGPACK_BUILD_TESTS=OFF
58 # make -j$NPROC
59 # make install -j$NPROC
60 # cd - # popd
61}
62
63# Install libconfig (version in ubuntu-precise too old).
64[ -f $CACHE_DIR/lib/libconfig.a ] || {
65 git clone --depth=1 --branch=v1.7.1 https://github.com/hyperrealm/libconfig ../libconfig
66 cd ../libconfig # pushd
67 autoreconf -fi
68 ./configure --prefix=$CACHE_DIR
69 touch lib/scanner.l
70 make install -j$NPROC
71 cd - # popd
72}
73
74# Install libopus (not in ubuntu-precise).
75[ -f $CACHE_DIR/lib/libopus.a ] || {
76 git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus ../opus
77 cd ../opus # pushd
78 ./autogen.sh
79 ./configure --prefix=$CACHE_DIR
80 make install -j$NPROC
81 cd - # popd
82}
83
84if [ "$CC" = "clang" ]; then
85 # An initial update is required or the cabal cache will be empty and no packages
86 # can be installed.
87 cabal update
88
89 # Install the hstox test runner after installing libsodium.
90 CABAL_FLAGS="--disable-library-profiling"
91 CABAL_FLAGS="$CABAL_FLAGS --extra-include-dirs=$CACHE_DIR/include"
92 CABAL_FLAGS="$CABAL_FLAGS --extra-lib-dirs=$CACHE_DIR/lib"
93 git clone --recursive --depth=1 https://github.com/TokTok/hs-toxcore ../hs-toxcore
94 (cd ../hs-toxcore && cabal install $CABAL_FLAGS)
95fi
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c
index 585e78a1..34e04dcd 100644
--- a/toxcore/onion_announce.c
+++ b/toxcore/onion_announce.c
@@ -87,7 +87,7 @@ int create_announce_request(uint8_t *packet, uint16_t max_packet_length, const u
87 } 87 }
88 88
89 uint8_t plain[ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE + 89 uint8_t plain[ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE +
90 ONION_ANNOUNCE_SENDBACK_DATA_LENGTH]; 90 ONION_ANNOUNCE_SENDBACK_DATA_LENGTH];
91 memcpy(plain, ping_id, ONION_PING_ID_SIZE); 91 memcpy(plain, ping_id, ONION_PING_ID_SIZE);
92 memcpy(plain + ONION_PING_ID_SIZE, client_id, CRYPTO_PUBLIC_KEY_SIZE); 92 memcpy(plain + ONION_PING_ID_SIZE, client_id, CRYPTO_PUBLIC_KEY_SIZE);
93 memcpy(plain + ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE, data_public_key, CRYPTO_PUBLIC_KEY_SIZE); 93 memcpy(plain + ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE, data_public_key, CRYPTO_PUBLIC_KEY_SIZE);
@@ -375,7 +375,7 @@ static int handle_announce_request(void *object, IP_Port source, const uint8_t *
375 get_shared_key(&onion_a->shared_keys_recv, shared_key, dht_get_self_secret_key(onion_a->dht), packet_public_key); 375 get_shared_key(&onion_a->shared_keys_recv, shared_key, dht_get_self_secret_key(onion_a->dht), packet_public_key);
376 376
377 uint8_t plain[ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE + 377 uint8_t plain[ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE +
378 ONION_ANNOUNCE_SENDBACK_DATA_LENGTH]; 378 ONION_ANNOUNCE_SENDBACK_DATA_LENGTH];
379 int len = decrypt_data_symmetric(shared_key, packet + 1, packet + 1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE, 379 int len = decrypt_data_symmetric(shared_key, packet + 1, packet + 1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE,
380 ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + 380 ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH +
381 CRYPTO_MAC_SIZE, plain); 381 CRYPTO_MAC_SIZE, plain);
diff --git a/toxcore/tox_api.c b/toxcore/tox_api.c
index 89da8583..6c0bd71f 100644
--- a/toxcore/tox_api.c
+++ b/toxcore/tox_api.c
@@ -40,20 +40,20 @@ void tox_options_set_##ns##name(struct Tox_Options *options, type name) \
40 options->ns##name = name; \ 40 options->ns##name = name; \
41} 41}
42 42
43ACCESSORS(bool, , ipv6_enabled) 43ACCESSORS(bool,, ipv6_enabled)
44ACCESSORS(bool, , udp_enabled) 44ACCESSORS(bool,, udp_enabled)
45ACCESSORS(TOX_PROXY_TYPE, proxy_ , type) 45ACCESSORS(TOX_PROXY_TYPE, proxy_, type)
46ACCESSORS(const char *, proxy_ , host) 46ACCESSORS(const char *, proxy_, host)
47ACCESSORS(uint16_t, proxy_ , port) 47ACCESSORS(uint16_t, proxy_, port)
48ACCESSORS(uint16_t, , start_port) 48ACCESSORS(uint16_t,, start_port)
49ACCESSORS(uint16_t, , end_port) 49ACCESSORS(uint16_t,, end_port)
50ACCESSORS(uint16_t, , tcp_port) 50ACCESSORS(uint16_t,, tcp_port)
51ACCESSORS(bool, , hole_punching_enabled) 51ACCESSORS(bool,, hole_punching_enabled)
52ACCESSORS(TOX_SAVEDATA_TYPE, savedata_, type) 52ACCESSORS(TOX_SAVEDATA_TYPE, savedata_, type)
53ACCESSORS(size_t, savedata_, length) 53ACCESSORS(size_t, savedata_, length)
54ACCESSORS(tox_log_cb *, log_, callback) 54ACCESSORS(tox_log_cb *, log_, callback)
55ACCESSORS(void *, log_, user_data) 55ACCESSORS(void *, log_, user_data)
56ACCESSORS(bool, , local_discovery_enabled) 56ACCESSORS(bool,, local_discovery_enabled)
57 57
58const uint8_t *tox_options_get_savedata_data(const struct Tox_Options *options) 58const uint8_t *tox_options_get_savedata_data(const struct Tox_Options *options)
59{ 59{