Commit f4992322 authored by callum_linden's avatar callum_linden

First check-in on new version that downloads the CEF bundle each time vs keeps...

First check-in on new version that downloads the CEF bundle each time vs keeps it in the repository. Windows 32/64 appear to be working - macOS to follow
parents
syntax: glob
stage
.DS_Store
# BuildParams
#
# Please refer to:
# https://wiki.secondlife.com/wiki/Automated_Build_System
public_build = true
build_Darwin = true
build_CYGWIN = true
build_Linux = false
Important: This file is not part of the CEF distribution.
It only serves to outline what is here and remind users
who want to update to different versions of CEF that the
CEF bundles (bz2 files) are downloaded by build-cmd.sh and
build locally. They may or may not be proxied via a Linden
owned S3 bucket to ensure we have a copy if the current
provider (Spotify) decides to remove the page of automated
builds.
------------------------------------------------------------
The Chromium Embedded Framework (CEF) is a simple framework for
embedding Chromium-based browsers in other applications.
It is Copyright 2008-2014 Marshall A. Greenblatt.
Portions Copyright (c) 2006-2009 Google Inc. All rights reserved.
To update the version of CEF for a platform or bit-width:
* Visit http://opensource.spotify.com/cefbuilds/index.html and
download the version you want to import. Use the minimal download
version.
* Add the new code to the repository in the VENDOR branch as per the
Linden Lab Mercurial Vendor Branch Strategy outlined here:
https://wiki.lindenlab.com/wiki/Mercurial_Vendor_Branches
* Merge with the default branch
* Changes so far to the VENDOR branch are:
Windows:
* Settings in CMakelists.txt to change MSVC code generation
settings from /MT to /MD so that it is compatible with the
Second Life viewer. (only for Release - the Debug configuration
is not used)
Darwin:
* Settings in CMakelists.txt to remove the CEF sample applications
from tyhe build since they do not build with the minimal download
distribution.
* Settings in cmake/cef_settings.cmake to change the default
Standard Library to libc++ (-std=libc++) and turn on C++11 features
(-std=c++11)
<?xml version="1.0" ?>
<llsd>
<map>
<key>package_description</key>
<map>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
<string>LICENSES/cef.txt</string>
<key>name</key>
<string>cef-bin</string>
<key>copyright</key>
<string>Copyright (c) 2008-2014 Marshall A. Greenblatt. Portions Copyright (c) 2006-2009 Google Inc. All rights reserved</string>
<key>platforms</key>
<map>
<key>common</key>
<map>
<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>name</key>
<string>common</string>
</map>
<key>darwin64</key>
<map>
<key>build_directory</key>
<string>stage</string>
<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>bin/*</string>
<string>include/*</string>
<string>lib/*</string>
</array>
<key>name</key>
<string>darwin64</string>
</map>
<key>windows</key>
<map>
<key>build_directory</key>
<string>stage</string>
<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>bin/*</string>
<string>include/*</string>
<string>lib/*</string>
<string>resources/*</string>
</array>
<key>name</key>
<string>windows</string>
</map>
<key>linux</key>
<map>
<key>build_directory</key>
<string>stage</string>
<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>include/*</string>
<string>lib/*</string>
<string>resources/*</string>
</array>
<key>name</key>
<string>linux</string>
</map>
</map>
<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
# bleat on references to undefined shell variables
set -u
# Check autobuild is around or fail
if [ -z "$AUTOBUILD" ] ; then
exit 1
fi
if [ "$OSTYPE" = "cygwin" ] ; then
export AUTOBUILD="$(cygpath -u $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"
# URLs of the CEF bundle to download.
CEF_BUNDLE_URL_WINDOWS32="http://opensource.spotify.com/cefbuilds/cef_binary_3.3239.1700.g385b2d4_windows32.tar.bz2"
CEF_BUNDLE_URL_WINDOWS64="http://opensource.spotify.com/cefbuilds/cef_binary_3.3239.1700.g385b2d4_windows64.tar.bz2"
CEF_BUNDLE_URL_DARWIN64="http://opensource.spotify.com/cefbuilds/cef_binary_3.3239.1700.g385b2d4_macosx64.tar.bz2"
# file where the CEF bundle will be downloaded to before unpacking etc.
CEF_BUNDLE_DOWNLOAD_FILE_WINDOWS="${top}/stage/windows${AUTOBUILD_ADDRSIZE}.bz2"
CEF_BUNDLE_DOWNLOAD_FILE_DARWIN64="${top}/stage/darwin64.bz2"
# directories where the downloaded, unpacked, modified and ready to build CEF
# bundle will end up and where it will be built by Cmake
CEF_BUNDLE_SRC_DIR_WINDOWS="${top}/stage/windows${AUTOBUILD_ADDRSIZE}"
CEF_BUNDLE_SRC_DIR_DARWIN64="${top}/stage/darwin64"
# used in VERSION.txt but common to all bit-widths and platforms
build=${AUTOBUILD_BUILD_ID:=0}
case "$AUTOBUILD_PLATFORM" in
windows*)
# download bundle
CEF_BUNDLE_URL="CEF_BUNDLE_URL_WINDOWS${AUTOBUILD_ADDRSIZE}"
curl "${!CEF_BUNDLE_URL}" -o "${CEF_BUNDLE_DOWNLOAD_FILE_WINDOWS}"
# Create directory for it and untar, stripping off the complex CEF name
mkdir -p "${CEF_BUNDLE_SRC_DIR_WINDOWS}"
tar xvfj "${CEF_BUNDLE_DOWNLOAD_FILE_WINDOWS}" -C "${CEF_BUNDLE_SRC_DIR_WINDOWS}" --strip-components=1
# replace the Visual Studio C++ Run Time setting to ones that matches viewer
# Note: we don't build/use the debug version but it's included here for completeness
sed -i -e 's/\/MTd/\/MDd/g' "${CEF_BUNDLE_SRC_DIR_WINDOWS}/cmake/cef_variables.cmake"
sed -i -e 's/\/MT/\/MD/g' "${CEF_BUNDLE_SRC_DIR_WINDOWS}/cmake/cef_variables.cmake"
# create solution file cef.sln in build folder
cd "${CEF_BUNDLE_SRC_DIR_WINDOWS}"
rm -rf build
mkdir -p build
cd build
cmake -G "$AUTOBUILD_WIN_CMAKE_GEN" ..
# build release version of wrapper only
build_sln cef.sln "Release|$AUTOBUILD_WIN_VSPLATFORM" "libcef_dll_wrapper"
# create folders to stage files in
mkdir -p "$stage/bin/release"
mkdir -p "$stage/include/cef/include"
mkdir -p "$stage/lib/release"
mkdir -p "$stage/resources"
mkdir -p "$stage/LICENSES"
# binary files
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/chrome_elf.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/d3dcompiler_43.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/d3dcompiler_47.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/libcef.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/libEGL.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/libGLESv2.dll" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/natives_blob.bin" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/snapshot_blob.bin" "$stage/bin/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/widevinecdmadapter.dll" "$stage/bin/release/"
# include files
cp -r "${CEF_BUNDLE_SRC_DIR_WINDOWS}/include/." "$stage/include/cef/include/"
# resource files
cp -r "${CEF_BUNDLE_SRC_DIR_WINDOWS}/Resources/" "$stage/"
# library files
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/release/libcef.lib" "$stage/lib/release/"
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/build/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib" "$stage/lib/release/"
# license file
cp "${CEF_BUNDLE_SRC_DIR_WINDOWS}/LICENSE.txt" "$stage/LICENSES/cef.txt"
# populate version_file (after header files are copied to a well specified place that version.cpp can access)
cl \
/Fo"$(cygpath -w "$stage/version.obj")" \
/Fe"$(cygpath -w "$stage/version.exe")" \
/I "$(cygpath -w "$stage/include/cef/include")" \
/I "$(cygpath -w "$stage/include/cef")" \
/D "AUTOBUILD_BUILD=${build}" \
"$(cygpath -w "$top/version.cpp")"
"$stage/version.exe" > "$stage/version.txt"
rm "$stage"/version.{obj,exe}
;;
darwin64)
CEF_SOURCE_DIR="${CEF_BUNDLE_SRC_DIR_DARWIN64}"
# build version number and write to autobuild version file
VERSION_HEADER_FILE="$CEF_SOURCE_DIR/include/cef_version.h"
version=$(sed -n -E 's/#define CEF_VERSION "([a-z0-9.]+)"/\1/p' "${VERSION_HEADER_FILE}")
echo "${version}.${build}" > "${stage}/VERSION.txt"
BUILD_FOLDER="build"
cd "${CEF_SOURCE_DIR}"
rm -rf "${BUILD_FOLDER}"
mkdir -p "${BUILD_FOLDER}"
cd "${BUILD_FOLDER}"
cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
xcodebuild -project cef.xcodeproj -target libcef_dll_wrapper -configuration Release
# create folders to stage files in
mkdir -p "$stage/bin/release"
mkdir -p "$stage/include/cef/include"
mkdir -p "$stage/lib/release"
mkdir -p "$stage/LICENSES"
# include files
cp -r "${CEF_SOURCE_DIR}/include/." "$stage/include/cef/include/"
# library file
cp "${CEF_SOURCE_DIR}/${BUILD_FOLDER}/libcef_dll_wrapper/Release/libcef_dll_wrapper.a" "$stage/lib/release/"
# framework
cp -r "${CEF_SOURCE_DIR}/Release/Chromium Embedded Framework.framework" "$stage/bin/release/"
# include files
cp -r "${CEF_SOURCE_DIR}/include/." "$stage/include/cef/include/"
# license file
cp "${CEF_SOURCE_DIR}/LICENSE.txt" "$stage/LICENSES/cef.txt"
;;
linux*)
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1
;;
esac
/**
* @file version.cpp
* @author Callum Prentice via Nat Goodspeed
* @date 2017-02-13
* @brief Report library version number - C++ version
* For a library whose version number is tracked in a C++ header
* file, it's more robust to build a helper program to report it than
* to manually parse the header file. The library might change the
* syntax with which it defines the version number, but we can assume
* it will remain valid C / C++.
*
* $LicenseInfo:firstyear=2014&license=internal$
* Copyright (c) 2017, Linden Research, Inc.
* $/LicenseInfo$
*/
#include "cef_version.h"
#include <iostream>
int main(int argc, char* argv[])
{
std::cout << CEF_VERSION << "." << AUTOBUILD_BUILD;
return 0;
}
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