Commit a1d981a3 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

MAINT-7081: Add autobuild wrapper files, initially tested on Mac.

parent 0cab4a85
# BuildParams
#
# Please refer to:
# https://wiki.secondlife.com/wiki/Automated_Build_System
# Use Public Upload Locations
public_build = true
# Need viewer-build-variables as well as other shared repositories
# build_variables_repository_url set in TC project hierarchy
buildscripts_shared_more_NAMEs="build_variables"
# eof
<?xml version="1.0" ?>
<llsd>
<map>
<key>package_description</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa
Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>Library providing HTTP 2 support for libcurl</string>
<key>license</key>
<string>MIT</string>
<key>license_file</key>
<string>LICENSES/nghttp2.txt</string>
<key>name</key>
<string>nghttp2</string>
<key>platforms</key>
<map>
<key>common</key>
<map>
<key>build_directory</key>
<string>stage</string>
<key>configurations</key>
<map>
<key>default</key>
<map>
<key>build</key>
<map>
<key>arguments</key>
<array>
<string>../build-cmd.sh</string>
</array>
<key>command</key>
<string>bash</string>
</map>
<key>default</key>
<boolean>true</boolean>
<key>name</key>
<string>default</string>
</map>
</map>
<key>manifest</key>
<array>
<string>LICENSES/nghttp2.txt</string>
<string>include/nghttp2/*.h</string>
</array>
<key>name</key>
<string>common</string>
</map>
<key>darwin</key>
<map>
<key>configurations</key>
<map>
<key>default</key>
<map>
<key>default</key>
<boolean>true</boolean>
<key>name</key>
<string>default</string>
</map>
</map>
<key>manifest</key>
<array>
<string>lib/release/libnghttp2*.dylib</string>
</array>
<key>name</key>
<string>darwin</string>
</map>
<key>linux</key>
<map>
<key>configurations</key>
<map>
<key>default</key>
<map>
<key>default</key>
<boolean>true</boolean>
<key>name</key>
<string>default</string>
</map>
</map>
<key>manifest</key>
<array>
<string>lib/release/nghttp2.a</string>
</array>
<key>name</key>
<string>linux</string>
</map>
<key>windows</key>
<map>
<key>configurations</key>
<map>
<key>default</key>
<map>
<key>default</key>
<boolean>true</boolean>
<key>name</key>
<string>default</string>
</map>
</map>
<key>manifest</key>
<array>
<string>lib/release/nghttp2.lib</string>
</array>
<key>name</key>
<string>windows</string>
</map>
<key>windows64</key>
<map>
<key>configurations</key>
<map>
<key>default</key>
<map>
<key>default</key>
<boolean>true</boolean>
<key>name</key>
<string>default</string>
</map>
</map>
<key>manifest</key>
<array>
<string>lib/release/nghttp2.lib</string>
</array>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>source_directory</key>
<string>nghttp2</string>
<key>source_type</key>
<string>hg</string>
<key>version_file</key>
<string>VERSION.txt</string>
</map>
<key>type</key>
<string>autobuild</string>
<key>version</key>
<string>1.3</string>
</map>
</llsd>
#!/usr/bin/env bash
cd "$(dirname "$0")"
# turn on verbose debugging output for parabuild logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# complain about unset env variables
set -u
if [ -z "$AUTOBUILD" ] ; then
exit 1
fi
if [ "$OSTYPE" = "cygwin" ] ; then
autobuild="$(cygpath -u $AUTOBUILD)"
else
autobuild="$AUTOBUILD"
fi
top="$(pwd)"
stage="$(pwd)/stage"
# load autobuild provided shell functions and variables
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"
NGHTTP2_VERSION_HEADER_DIR="$top/nghttp2/lib/includes/nghttp2"
version="$(sed -n -E 's/#define NGHTTP2_VERSION "([^"]+)"/\1/p' "${NGHTTP2_VERSION_HEADER_DIR}/nghttp2ver.h" | tr -d '\r' )"
build=${AUTOBUILD_BUILD_ID:=0}
echo "${version}.${build}" > "${stage}/VERSION.txt"
# Restore all .sos
restore_sos ()
{
for solib in "${stage}"/packages/lib/release/lib*.so*.disable; do
if [ -f "$solib" ]; then
mv -f "$solib" "${solib%.disable}"
fi
done
}
# Restore all .dylibs
restore_dylibs ()
{
for dylib in "$stage/packages/lib"/release/*.dylib.disable; do
if [ -f "$dylib" ]; then
mv "$dylib" "${dylib%.disable}"
fi
done
}
pushd "$top/nghttp2"
case "$AUTOBUILD_PLATFORM" in
windows*)
packages="$(cygpath -m "$stage/packages")"
load_vsvars
cmake . -G"$AUTOBUILD_WIN_CMAKE_GEN" -DCMAKE_C_FLAGS:STRING="$LL_BUILD_RELEASE" \
-DCMAKE_CXX_FLAGS:STRING="$LL_BUILD_RELEASE" \
-DCMAKE_INSTALL_PREFIX="$(cygpath -m "$stage")"
cmake --build .
# Stage archives
mkdir -p "${stage}/lib/release"
mv "$top/nghttp2/lib/nghttp2.lib" "${stage}"/lib/release/
;;
darwin*)
opts="${TARGET_OPTS:--arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE}"
## # Release configure and build
## ./configure --enable-lib-only CFLAGS="$opts" CXXFLAGS="$opts"
## make
## make check
cmake . -DCMAKE_C_FLAGS:STRING="$opts" \
-DCMAKE_CXX_FLAGS:STRING="$opts" \
-DCMAKE_INSTALL_PREFIX="$(cygpath -m "$stage")"
cmake --build .
mkdir -p "$stage/lib/release"
mv "$top/nghttp2/lib"/libnghttp2*.dylib "$stage/lib/release/"
# make distclean
;;
linux*)
# Linux build environment at Linden comes pre-polluted with stuff that can
# seriously damage 3rd-party builds. Environmental garbage you can expect
# includes:
#
# DISTCC_POTENTIAL_HOSTS arch root CXXFLAGS
# DISTCC_LOCATION top branch CC
# DISTCC_HOSTS build_name suffix CXX
# LSDISTCC_ARGS repo prefix CFLAGS
# cxx_version AUTOBUILD SIGN CPPFLAGS
#
# So, clear out bits that shouldn't affect our configure-directed build
# but which do nonetheless.
#
# unset DISTCC_HOSTS CC CXX CFLAGS CPPFLAGS CXXFLAGS
# Default target per --address-size
opts="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE}"
# Handle any deliberate platform targeting
if [ -z "${TARGET_CPPFLAGS:-}" ]; then
# Remove sysroot contamination from build environment
unset CPPFLAGS
else
# Incorporate special pre-processing flags
export CPPFLAGS="$TARGET_CPPFLAGS"
fi
# Release configure and build
./configure --enable-lib-only CFLAGS="$opts" CXXFLAGS="$opts"
make
make check
mkdir -p "$stage/lib/release"
mv "$top/nghttp2/lib/libnghttp2.a" "$stage/lib/release/"
;;
esac
mkdir -p "$stage/LICENSES"
cp "$top/nghttp2/COPYING" "$stage/LICENSES/nghttp2.txt"
popd
mkdir -p "$stage/include/nghttp2"
cp "$NGHTTP2_VERSION_HEADER_DIR"/*.h "$stage/include/nghttp2/"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment