aboutsummaryrefslogtreecommitdiffhomepage
path: root/macosx
diff options
context:
space:
mode:
authorGravatar John Hood <cgull@glup.org>2016-10-31 00:54:14 -0400
committerGravatar John Hood <cgull@glup.org>2016-11-12 19:57:50 -0500
commit73b4ab21ad6264a77279a134061621d80188b6bf (patch)
tree8783ec534d337598085d391a5c68128bd6c7eab3 /macosx
parentc9d0c9c0c5e2a8b519c60ad87ebe9b3ac989cf56 (diff)
OS X package build on Travis
This builds an OS X package and deploys it to a GitHub release when a tag is pushed. It also generates a tarball reporting the build environment and configuration. The build log is still separate. This is not yet final, it deploys to cgull/mosh and not mobile-shell/mosh. It should not affect Linux or OS X CI builds (other than the change to the Travis Xcode 7.1 image). Included changes: The Travis Xcode 7 image seems to have added tmux while we were gone, breaking our Homebrew setup. There seems to be no clean reliable way to determine whether a Homebrew package is installed or needs updating. Reinstalling is less efficient but seems to work reliably. The OS X build is now split between four files: .travis.yml contains Travis-specific CI/release build configuration. macosx/brew.sh contains Homebrew-specific package manager installs and reporting. macosx/osx-xcode.sh contains Apple-specific OS/X and Xcode reporting. macosx/build.sh does the actual package build.
Diffstat (limited to 'macosx')
-rwxr-xr-xmacosx/brew-deps.sh69
-rwxr-xr-xmacosx/osx-xcode.sh30
2 files changed, 99 insertions, 0 deletions
diff --git a/macosx/brew-deps.sh b/macosx/brew-deps.sh
new file mode 100755
index 0000000..ddf28f0
--- /dev/null
+++ b/macosx/brew-deps.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+#
+# Install Homebrew dependencies
+#
+# This script handles build dependencies other than those provided by
+# MacOS and Xcode, for a Mosh build using macosx/build.sh or the
+# native autoconf/automake build for CI. It is intended to be used by
+# a build system, and should be agnostic to any particular system.
+#
+# Similar scripts could be developed for MacPorts, direct dependency
+# builds, etc.
+#
+
+#
+# Install and/or configure the system used to provide dependencies.
+#
+install()
+{
+ # Straight from https://brew.sh
+ if ! brew --version > /dev/null 2>&1; then
+ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+ fi
+}
+
+#
+# Install up-to-date build dependencies required for a development or
+# CI build. These dependencies only need to provide runtime
+# dependencies for the build system, support for things like previous
+# OS versions and fat binaries is not needed.
+#
+deps()
+{
+ brew update
+ brew update
+ brew reinstall tmux
+ brew reinstall protobuf
+}
+
+#
+# Install build dependencies required for the MacOS package build.
+# Runtime dependencies are required to support the targeted OS X
+# version, static libraries, and fat binaries for the package build.
+#
+# This reinstalls protobuf with --universal --bottle to get a fat
+# library that will run on any machine. (This takes about 15 minutes
+# on current Travis infrastructure.)
+#
+package_deps()
+{
+ deps
+ brew rm protobuf
+ brew install protobuf --universal --bottle
+}
+
+#
+# Describe the dependencies installed and used as best as possible.
+#
+describe()
+{
+ brew --version > brew-version.txt
+ brew info --json=v1 --installed > brew-info.json
+}
+
+#
+# Do something.
+#
+set -e
+"$@"
diff --git a/macosx/osx-xcode.sh b/macosx/osx-xcode.sh
new file mode 100755
index 0000000..7f20ade
--- /dev/null
+++ b/macosx/osx-xcode.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#
+# OS X and Xcode support script.
+#
+
+#
+# Describe the OS X and Xcode installation, patches, etc as best as possible.
+#
+# Beware: System Profiler dumps significant private and security information.
+#
+describe()
+{
+ # Most of the XML in this report is plist files, which can be read more easily with plutil -p
+ pkgutil --pkgs-plist > packages-plist.xml
+ mkdir package-info-plist/
+ for i in $(pkgutil --pkgs); do pkgutil --pkg-info-plist=$i > package-info-plist/$i.xml; done
+ xcodebuild -version > xcodebuild-version.txt
+ # CLT info can be found in package-info-plist/com.apple.pkg.CLTools_Executables.xml
+ xcode-select --print-path > xcode-path.txt
+ # System Profiler's XML can be read more easily with plutil -p, or
+ # opened with the System Profiler GUI.
+ system_profiler -xml -detailLevel full > system-profile.spx 2>/dev/null
+}
+
+#
+# Do something.
+#
+set -e
+"$@"