From 31960224918c33346e1af36eacdf2795808022ac Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Fri, 3 Nov 2017 21:02:02 -0700 Subject: [PATCH] Adding travis-ci integration for macOS builds - Deploys to github - Travis CI link in readme --- .travis.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ README | 2 ++ package.bash | 18 ++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .travis.yml create mode 100755 package.bash diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0b24a97 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,47 @@ +# travis-ci integration to build macOS binaries for dfu-util + +language: c + +os: + - osx + +compiler: + - clang + +# Package Setup +before_install: + - brew update + - brew install tree libusb + +# System Setup +install: + # Info about OS + - uname -a + + # Prepare output dir + - mkdir -p output + + # Directory tree to validate checkout + - tree + +# Run Build +script: + - ./autogen.sh && ./configure && make && ./package.bash + +## Deploy release +deploy: + provider: releases + api_key: $GITHUB_OAUTH_TOKEN + skip_cleanup: true + draft: true # XXX Must "publish" on github + prerelease: true # XXX Set this to false to enable a stable release + file_glob: true + file: output/dfu-util* + on: + tags: true + repo: kiibohd/dfu-util + +# Post Build Commands/Packaging +after_script: + - tree + diff --git a/README b/README index 89f051a..fb0babf 100644 --- a/README +++ b/README @@ -1,5 +1,7 @@ Dfu-util - Device Firmware Upgrade Utilities +https://travis-ci.org/kiibohd/dfu-util + Dfu-util is the host side implementation of the DFU 1.0 [1] and DFU 1.1 [2] specification of the USB forum. diff --git a/package.bash b/package.bash new file mode 100755 index 0000000..ded8d01 --- /dev/null +++ b/package.bash @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e +set -x + +# Copy Files, including libusb +mkdir -p pkg +cp src/dfu-util src/dfu-prefix src/dfu-suffix pkg/. +cp /usr/local/opt/libusb/lib/libusb-1.0.0.dylib pkg/. + +# Change rpath to point to packaged libusb +cd pkg +install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib "@loader_path/libusb-1.0.0.dylib" dfu-util +install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib "@loader_path/libusb-1.0.0.dylib" dfu-prefix +install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib "@loader_path/libusb-1.0.0.dylib" dfu-suffix + +zip -r ../output/dfu-util-${TRAVIS_TAG}.zip * +