From 221edb00123b50e8c77dd430900816e1d67a3855 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Mon, 26 Feb 2018 02:34:38 -0500 Subject: [PATCH] add a .travis file and some build fixes --- .travis.yml | 31 +++++++++++++++++++++++++++++++ Makefile | 2 +- cfg/checks/audio.mk | 2 +- cfg/checks/video.mk | 2 +- src/api.c | 2 +- src/python_api.c | 2 +- 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..23dbd46 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +language: python +python: nightly + +addons: + apt: + packages: + - libalut-dev + - libconfig-dev + - libnotify-dev + - libopenal-dev + - libopus-dev + - libqrencode-dev + - libvpx-dev + +cache: + directories: + - $HOME/cache + +install: +# Where to find libraries. +- export LD_LIBRARY_PATH=$HOME/cache/usr/lib +- export PKG_CONFIG_PATH=$HOME/cache/usr/lib/pkgconfig +# c-sodium +- git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium +- test -f $HOME/cache/usr/lib/libsodium.so || (cd libsodium && ./configure --prefix=$HOME/cache/usr && make install -j$(nproc)) +# c-toxcore +- git clone --depth=1 https://github.com/TokTok/c-toxcore +- test -f $HOME/cache/usr/lib/libtoxcore.so || (cd c-toxcore && cmake -B_build -H. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/cache/usr && make -C_build install -j$(nproc)) + +script: +- make ENABLE_PYTHON=1 diff --git a/Makefile b/Makefile index ac88807..83d44be 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CFG_DIR = $(BASE_DIR)/cfg -include $(CFG_DIR)/global_vars.mk -LIBS = libtoxcore ncursesw libconfig libqrencode +LIBS = toxcore ncursesw libconfig libqrencode CFLAGS = -std=gnu99 -pthread -Wall -g -fstack-protector-all CFLAGS += '-DTOXICVER="$(VERSION)"' -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64 diff --git a/cfg/checks/audio.mk b/cfg/checks/audio.mk index 6e2cf84..7e684f7 100644 --- a/cfg/checks/audio.mk +++ b/cfg/checks/audio.mk @@ -1,5 +1,5 @@ # Variables for audio call support -AUDIO_LIBS = libtoxav openal +AUDIO_LIBS = openal AUDIO_CFLAGS = -DAUDIO ifneq (, $(findstring audio_device.o, $(OBJ))) AUDIO_OBJ = audio_call.o diff --git a/cfg/checks/video.mk b/cfg/checks/video.mk index cfef619..0fb2f77 100644 --- a/cfg/checks/video.mk +++ b/cfg/checks/video.mk @@ -1,5 +1,5 @@ # Variables for video call support -VIDEO_LIBS = libtoxav vpx x11 +VIDEO_LIBS = vpx x11 VIDEO_CFLAGS = -DVIDEO ifneq (, $(findstring video_device.o, $(OBJ))) VIDEO_OBJ = video_call.o diff --git a/src/api.c b/src/api.c index 4296b80..58cb2c7 100644 --- a/src/api.c +++ b/src/api.c @@ -36,7 +36,6 @@ #ifdef PYTHON #include "python_api.h" -#endif /* PYTHON */ Tox *user_tox; static WINDOW *cur_window; @@ -208,3 +207,4 @@ void invoke_autoruns(WINDOW *window, ToxWindow *self) closedir(d); } +#endif /* PYTHON */ diff --git a/src/python_api.c b/src/python_api.c index 313197f..93d106f 100644 --- a/src/python_api.c +++ b/src/python_api.c @@ -23,7 +23,6 @@ #ifdef PYTHON #include #include "api.h" -#endif /* PYTHON */ #include "execute.h" @@ -345,3 +344,4 @@ void python_draw_handler_help(WINDOW *win) wprintw(win, " %-29s: %.50s\n", cur->name, cur->help); } } +#endif /* PYTHON */