summaryrefslogtreecommitdiff
path: root/travis-ci
diff options
context:
space:
mode:
authorNeil Okamoto <neil.okamoto@gmail.com>2017-12-10 23:16:11 -0800
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2017-12-11 07:16:11 +0000
commitb484daa718c09c3d41e260878f93a35f05edb5b4 (patch)
tree3dfe2c2fdf6015488209fae7f0fcaa1a420530d1 /travis-ci
parentc1a500d7da606f48cbde8546da922ca6ddfea9ef (diff)
[#2120] Fix TLS related errors in Travis CI (#2128)
Fixes the Travis CI build errors reported in #2120. Diffs to .travis.yml are as follows: (1) I've added some explicit package dependencies into addons.apt.packages. This is basically the compiler toolchain needed to build gnutls from source (2) Configured $HOME/local to be cached by Travis between subsequent builds. This is done with the setting cache.directories. See Travis documentation for further information about the caching of data. Basically, the contents of that folder are rolled up into a tar ball and saved to an S3 bucket whenever the contents change. The tarball is retrieved and installed prior to the start of your CI job. (3) Added a utility script named travis-ci/travis-gnutls.sh which handles the downloading and compiling of the sources. The script is organized so that the version of gnutls can be easily updated whenever needed. Just edit the version numbers in that script and push the change. The script is able to detect when it doesn't have the specific version requested, and when that happens it deletes the cache and rebuilds gnutls. (4) While I was at it, I added emacs 25.3-travis and 26-pretest-travis to the build matrix. Note that git-snapshot-travis now reports itself as being version 27. (Also note, emacs 26 and 27 are still broken builds, but at least now it's not because of the build script itself.)
Diffstat (limited to 'travis-ci')
-rwxr-xr-xtravis-ci/travis-gnutls.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/travis-ci/travis-gnutls.sh b/travis-ci/travis-gnutls.sh
new file mode 100755
index 00000000..b89542f5
--- /dev/null
+++ b/travis-ci/travis-gnutls.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Setup a newer gnutls-cli on Travis CI
+# We need this as long as the Travis workers are Ubuntu 14.04
+# and the TLS cert chain on elpa.gnu.org is out-of-order
+
+set -x
+
+# adjust these versions as needed
+export NETTLE_VERSION=3.4
+export GNUTLS_VERSION=3.5.16
+
+export WORKDIR=${HOME}/local/
+export LD_LIBRARY_PATH=${WORKDIR}/lib/
+export PKG_CONFIG_PATH=${WORKDIR}/lib/pkgconfig/
+
+# exit if the cache is valid and up-to-date
+if [ -f ${WORKDIR}/bin/gnutls-cli ] && \
+ [ -f ${WORKDIR}/nettle-${NETTLE_VERSION}.tar.gz ] && \
+ [ -f ${WORKDIR}/gnutls-${GNUTLS_VERSION}.tar.xz ]
+then
+ exit 0
+fi
+
+# delete cache and rebuild
+rm -rf $WORKDIR
+mkdir $WORKDIR
+cd $WORKDIR
+curl -O https://ftp.gnu.org/gnu/nettle/nettle-${NETTLE_VERSION}.tar.gz \
+ && tar xfz nettle-${NETTLE_VERSION}.tar.gz \
+ && cd nettle-${NETTLE_VERSION} \
+ && ./configure --prefix=${WORKDIR} \
+ && make -j4 install \
+ && make distclean
+
+cd $WORKDIR
+curl -O https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-${GNUTLS_VERSION}.tar.xz \
+ && xz -d -k gnutls-${GNUTLS_VERSION}.tar.xz \
+ && tar xf gnutls-${GNUTLS_VERSION}.tar \
+ && cd gnutls-${GNUTLS_VERSION} \
+ && ./configure --prefix=${WORKDIR} \
+ --with-included-libtasn1 \
+ --with-included-unistring \
+ --without-p11-kit \
+ && make -j4 install \
+ && make distclean