• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3set -e
4
5# Translate package names from Ubuntu packages to OSX brew packages
6ubuntu2osx() {
7    case "$1" in
8	libusb-dev)       echo "libusb-compat" ;;
9	libusb-1.0-0-dev) echo "libusb" ;;
10	libgd2-xpm-dev)   echo "gd" ;;
11	*)
12	    echo "Error: Unknown package name: '$1'" >&2
13	    exit 2 ;;
14    esac
15}
16
17case "$TRAVIS_OS_NAME" in
18    linux)
19	echo "autopoint" "$@"
20	;;
21    osx)
22	accu="gettext"
23	for pkg in "$@"; do
24	    pkg="$(ubuntu2osx "$pkg")"
25	    accu="$accu $pkg"
26	done
27	echo "$accu"
28	;;
29    *)
30	echo "Unknown TRAVIS_OS_NAME value: '$TRAVIS_OS_NAME'" >&2
31	exit 1
32esac
33
34exit 0
35
36# Test this script.
37#
38# Usage: Type ( into a shell, paste test code, type ) and press Enter.
39true <<EOF
40for SH in "bash" "busybox sh"; do
41  for os in linux osx no-os; do
42    for EXTRALIBS in "" "libusb-dev" "libusb-1.0-0-dev libgd2-xpm-dev" "nosuchlib"; do
43      echo "### SHELL: $SH OS: $os EXTRALIBS: '$EXTRALIBS' ###"
44      env TRAVIS_OS_NAME=$os $SH .travis-before-install $EXTRALIBS
45      echo "### Status: $?"
46      echo
47    done
48  done
49done
50EOF
51