Skip to content

Commit

Permalink
Adding travis-ci integration for macOS builds
Browse files Browse the repository at this point in the history
- Deploys to github
- Travis CI link in readme
  • Loading branch information
haata committed Nov 5, 2017
1 parent 3332f92 commit 3196022
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .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

2 changes: 2 additions & 0 deletions 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.

Expand Down
18 changes: 18 additions & 0 deletions 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 *

0 comments on commit 3196022

Please sign in to comment.