Skip to content

Commit b7301e7

Browse files
committed
Split Travis, packaging-dependent, and OS X scripting. Add reporting.
1 parent 1a23792 commit b7301e7

File tree

3 files changed

+126
-20
lines changed

3 files changed

+126
-20
lines changed

.travis.yml

+25-20
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,30 @@ addons:
2929
- tmux
3030
- perl
3131

32-
# OS X dependencies. For tag builds, reinstall protobuf with
33-
# --universal --bottle to get a fat library that will run on any
34-
# machine. (This takes about 15 minutes on current Travis
35-
# infrastructure.)
3632
before_install:
33+
# Get full repo and describe this
34+
- git fetch --tags --unshallow
35+
- git describe --long
36+
# OS X dependencies. The package_deps step takes 15 minutes or so
37+
# and is fairly quiet, so wrap it in travis_wait to keep it from
38+
# being killed.
3739
- |
38-
if test osx = "${TRAVIS_OS_NAME}"; then
39-
brew update
40-
brew update
41-
brew reinstall protobuf
42-
if test -n "${TRAVIS_TAG}"; then
43-
brew rm protobuf &&
44-
travis_wait 30 brew install protobuf --universal --bottle
40+
(
41+
set -e
42+
if test osx = "${TRAVIS_OS_NAME}"; then
43+
macosx/brew-deps.sh install
44+
if test -n "${TRAVIS_TAG}"; then
45+
travis_wait 30 macosx/brew-deps.sh package_deps
46+
else
47+
macosx/brew-deps.sh deps
48+
fi
49+
macosx/brew-deps.sh describe
50+
macosx/osx-xcode.sh describe
4551
fi
46-
brew reinstall tmux
47-
brew --version
48-
brew info --json=v1 --installed
49-
fi
50-
- git fetch --tags --unshallow
51-
52+
)
53+
# Describe this system.
54+
- id
55+
- env
5256
# 'make distcheck', and OS X package build on tag builds.
5357
script:
5458
- ./autogen.sh
@@ -58,9 +62,10 @@ script:
5862
- |
5963
if test osx = "${TRAVIS_OS_NAME}" && test -n "${TRAVIS_TAG}"; then
6064
(
61-
cd macosx &&
62-
env MACOSX_DEPLOYMENT_TARGET=10.10 ./build.sh &&
63-
ln ${TRAVIS_TAG}.pkg mosh.pkg &&
65+
set -e
66+
cd macosx
67+
env MACOSX_DEPLOYMENT_TARGET=10.10 ./build.sh
68+
ln ${TRAVIS_TAG}.pkg mosh.pkg
6469
shasum -a 256 mosh.pkg
6570
)
6671
fi

macosx/brew-deps.sh

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/sh
2+
3+
#
4+
# Install Homebrew dependencies
5+
#
6+
# This script handles build dependencies other than those provided by
7+
# MacOS and Xcode, for a Mosh build using macosx/build.sh or the
8+
# native autoconf/automake build for CI. It is intended to be used by
9+
# a build system, and should be agnostic to any particular system.
10+
#
11+
# Similar scripts could be developed for MacPorts, direct dependency
12+
# builds, etc.
13+
#
14+
15+
#
16+
# Install and/or configure the system used to provide dependencies.
17+
#
18+
install()
19+
{
20+
# Straight from https://brew.sh
21+
if ! brew --version > /dev/null 2>&1; then
22+
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
23+
fi
24+
}
25+
26+
#
27+
# Install up-to-date build dependencies required for a development or
28+
# CI build. These dependencies only need to provide runtime
29+
# dependencies for the build system, support for things like previous
30+
# OS versions and fat binaries is not needed.
31+
#
32+
deps()
33+
{
34+
brew update
35+
brew update
36+
brew reinstall tmux
37+
brew reinstall protobuf
38+
}
39+
40+
#
41+
# Install build dependencies required for the MacOS package build.
42+
# Runtime dependencies are required to support the targeted OS X
43+
# version, static libraries, and fat binaries for the package build.
44+
#
45+
# This reinstalls protobuf with --universal --bottle to get a fat
46+
# library that will run on any machine. (This takes about 15 minutes
47+
# on current Travis infrastructure.)
48+
#
49+
package_deps()
50+
{
51+
deps
52+
brew rm protobuf
53+
brew install protobuf --universal --bottle
54+
}
55+
56+
#
57+
# Describe the dependencies installed and used as best as possible.
58+
#
59+
describe()
60+
{
61+
printf "Homebrew version:\n"
62+
brew --version
63+
printf "Homebrew dump:\n"
64+
brew info --json=v1 --installed
65+
}
66+
67+
#
68+
# Do something.
69+
#
70+
set -e
71+
"$@"

macosx/osx-xcode.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
#
4+
# OS X and Xcode support script.
5+
#
6+
7+
#
8+
# Describe the OS X and Xcode installation, patches, etc as best as possible.
9+
#
10+
describe()
11+
{
12+
printf "OS X packages:\n"
13+
pkgutil --pkgs
14+
printf "Xcode version:\n"
15+
xcodebuild -version
16+
printf "Xcode path:\n"
17+
xcode-select --print-path
18+
# System Profiler's XML can be read more easily with plutil -p, or
19+
# saved with an .spx extension and opend with the System Profiler
20+
# GUI.
21+
printf "System Profiler:\n"
22+
system_profiler -xml 2>/dev/null
23+
printf "OS X report end.\n"
24+
}
25+
26+
#
27+
# Do something.
28+
#
29+
set -e
30+
"$@"

0 commit comments

Comments
 (0)