Browse Source

Travis build configuration

Luke Dashjr 11 years ago
parent
commit
104d446651
3 changed files with 48 additions and 0 deletions
  1. 20 0
      .travis.deps
  2. 9 0
      .travis.script
  3. 19 0
      .travis.yml

+ 20 - 0
.travis.deps

@@ -0,0 +1,20 @@
+test "x$1" = "xI-am-okay-with-destroying-my-system" || exit 1
+set -ex
+
+echo -e 'deb http://ftp.us.debian.org/debian/ wheezy main\ndeb http://security.debian.org/ wheezy/updates main' | sudo tee '/etc/apt/sources.list'
+sudo rm -r /etc/apt/sources.list.d
+curl https://ftp-master.debian.org/keys/archive-key-7.0.asc | sudo apt-key add -
+sudo apt-get update -qq
+sudo apt-get install -y build-essential autoconf automake libtool libcurl4-gnutls-dev libjansson-dev uthash-dev $EXTRA_DEPS
+
+if [ -n "$UBUNTU_DEPS" ]; then
+	cat <<\EOF | sudo tee '/etc/apt/sources.list'
+deb http://gb.archive.ubuntu.com/ubuntu/ trusty main restricted universe
+deb http://gb.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
+deb http://gb.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe
+deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe
+EOF
+	sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
+	sudo apt-get update -qq
+	sudo apt-get install -y $UBUNTU_DEPS
+fi

+ 9 - 0
.travis.script

@@ -0,0 +1,9 @@
+test "x$1" = "xI-am-okay-with-destroying-my-system" || exit 1
+set -ex
+
+[ "$CC" = "clang" ] && CC=$(which "$CC")
+./autogen.sh
+./configure $GLOBAL_CONFIGURE_ARGS $CONFIGURE_ARGS
+make CFLAGS="$GLOBAL_CFLAGS $BUILD_CFLAGS" $MAKEOPTS
+make check
+sudo make install

+ 19 - 0
.travis.yml

@@ -0,0 +1,19 @@
+os: linux
+language: c
+compiler:
+  - clang
+  - gcc
+env:
+  global:
+    - MAKEOPTS=-j3
+    - GLOBAL_CFLAGS='-O2 -Wall'
+    - GLOBAL_CONFIGURE_ARGS='--prefix=/usr'
+  matrix:
+    # Upgrade GCC to avoid false warnings; build the full project with -Werror
+    - UBUNTU_DEPS='gcc libhidapi-dev' EXTRA_DEPS='pkg-config libncursesw5-dev libudev-dev libusb-1.0-0-dev libevent-dev libmicrohttpd-dev libi2c-dev yasm' BUILD_CFLAGS='-Werror' CONFIGURE_ARGS='--enable-other-drivers --enable-scrypt'
+matrix:
+  fast_finish: true
+install:
+  - bash .travis.deps I-am-okay-with-destroying-my-system
+script:
+  - bash .travis.script I-am-okay-with-destroying-my-system