From 4ecd34c8e3b77f673aafcb464e52269fd4bf6228 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Wed, 7 Oct 2015 14:40:55 +0200 Subject: [PATCH] try travis for osx --- .travis.yml | 11 ++++++----- build-and-test.sh | 24 +++++++++++++++++++++--- mac.mk | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d91991..0f39fff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: c +os: + - osx + - linux compiler: - gcc - clang @@ -6,16 +9,14 @@ env: - EXTRA=libpcsclite-dev script: - ./build-and-test.sh -before_install: - - sudo apt-get update -qq - - sudo apt-get remove -qq -y $REMOVE - - sudo apt-get autoremove -qq - - sudo apt-get install -qq -y gengetopt help2man $EXTRA matrix: include: - compiler: gcc + os: linux env: EXTRA="wine mingw-w64 mingw-w64-dev" REMOVE=mingw32 ARCH=32 - compiler: gcc + os: linux env: EXTRA="wine mingw-w64 mingw-w64-dev" REMOVE=mingw32 ARCH=64 - compiler: gcc + os: linux env: COVERAGE="--enable-coverage" EXTRA="libpcsclite-dev lcov" diff --git a/build-and-test.sh b/build-and-test.sh index 4c07d45..956d835 100755 --- a/build-and-test.sh +++ b/build-and-test.sh @@ -4,13 +4,31 @@ set -e autoreconf -i +if [ "x$TRAVIS_OS_NAME" != "xosx" ]; then + sudo apt-get update -qq + sudo apt-get remove -qq -y $REMOVE + sudo apt-get autoremove -qq + sudo apt-get install -qq -y gengetopt help2man $EXTRA + TAR=tar +else + ARCH=osx + brew update + brew install help2man + brew install pkg-config + brew install gengetopt + brew install gnu-tar + TAR=gtar +fi if [ "x$ARCH" != "x" ]; then version=`cat NEWS | grep unreleased | cut -d' ' -f3` set +e - tar --exclude .git --transform="s/^\./yubico-piv-tool-${version}/" -czf yubico-piv-tool-${version}.tar.gz . + $TAR --exclude .git --transform="s/^\./yubico-piv-tool-${version}/" -czf yubico-piv-tool-${version}.tar.gz . set -e - - make -f windows.mk ${ARCH}bit VERSION=$version + if [ "x$ARCH" != "xosx" ]; then + make -f windows.mk ${ARCH}bit VERSION=$version + else + make -f mac.mk mac VERSION=$version + fi else ./configure $COVERAGE make check diff --git a/mac.mk b/mac.mk index 1c4ffc4..30e7d35 100644 --- a/mac.mk +++ b/mac.mk @@ -61,7 +61,7 @@ doit: tar xfz $(PACKAGE)-$(VERSION).tar.gz && \ cd $(PACKAGE)-$(VERSION)/ && \ PKG_CONFIG_PATH=$(PWD)/tmp/root/lib/pkgconfig ./configure --prefix=$(PWD)/tmp/root && \ - make install check && \ + make install $(CHECK) && \ chmod u+w $(PWD)/tmp/root/lib/libcrypto.1.0.0.dylib && \ install_name_tool -id @executable_path/../lib/libcrypto.1.0.0.dylib $(PWD)/tmp/root/lib/libcrypto.1.0.0.dylib && \ install_name_tool -id @executable_path/../lib/libykpiv.1.dylib $(PWD)/tmp/root/lib/libykpiv.1.dylib && \