Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to amazonlinux:2.0.20200722.0-with-sources to build Chrome 85 #258

Merged
merged 14 commits into from
Oct 4, 2020
2 changes: 1 addition & 1 deletion packages/lambda/builds/chromium/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# docker run -d --rm --name headless-chromium -p 9222:9222 adieuadieu/headless-chromium-for-aws-lambda
#

FROM amazonlinux:2017.03
FROM amazonlinux:2.0.20200722.0-with-sources

# ref: https://chromium.googlesource.com/chromium/src.git/+refs
ARG VERSION
Expand Down
39 changes: 15 additions & 24 deletions packages/lambda/builds/chromium/build/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Build Chromium for Amazon Linux.
# Assumes root privileges. Or, more likely, Docker—take a look at
# the corresponding Dockerfile in this directory.
#
# Requires
#
# Requires
#
# Usage: ./build.sh
#
Expand All @@ -21,19 +21,17 @@ VERSION=${VERSION:-master}
printf "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8" >> /etc/environment

# install dependencies
yum install epel-release -y
yum groupinstall -y "Development Tools"
yum install -y \
git redhat-lsb python bzip2 tar pkgconfig atk-devel \
alsa-lib-devel bison binutils brlapi-devel bluez-libs-devel \
bzip2-devel cairo-devel cups-devel dbus-devel dbus-glib-devel \
expat-devel fontconfig-devel freetype-devel gcc-c++ GConf2-devel \
glib2-devel glibc.i686 gperf glib2-devel gtk2-devel gtk3-devel \
java-1.*.0-openjdk-devel libatomic libcap-devel libffi-devel \
libgcc.i686 libgnome-keyring-devel libjpeg-devel libstdc++.i686 \
libX11-devel libXScrnSaver-devel libXtst-devel \
libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel \
pam-devel pango-devel pciutils-devel pulseaudio-libs-devel \
zlib.i686 httpd mod_ssl php php-cli python-psutil wdiff --enablerepo=epel
alsa-lib-devel atk-devel binutils bison bluez-libs-devel brlapi-devel \
bzip2 bzip2-devel cairo-devel cmake cups-devel dbus-devel dbus-glib-devel \
expat-devel fontconfig-devel freetype-devel gcc-c++ git glib2-devel glibc \
gperf gtk3-devel htop httpd java-1.*.0-openjdk-devel libatomic libcap-devel \
libffi-devel libgcc libgnome-keyring-devel libjpeg-devel libstdc++ libuuid-devel \
libX11-devel libxkbcommon-x11-devel libXScrnSaver-devel libXtst-devel mercurial \
mod_ssl ncurses-compat-libs nspr-devel nss-devel pam-devel pango-devel \
pciutils-devel php php-cli pkgconfig pulseaudio-libs-devel python \
tar zlib zlib-devel

mkdir -p build/chromium

Expand All @@ -48,17 +46,10 @@ cd chromium

# fetch chromium source code
# ref: https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches
git clone https://chromium.googlesource.com/chromium/src.git

(
cd src

# Do a pull because there are usually revisions pushed while we're cloning
git pull
# git shallow clone, much quicker than a full git clone; see https://stackoverflow.com/a/39067940/3145038 for more details

# checkout the release tag
git checkout -b build "$VERSION"
)
git clone --branch "$VERSION" --depth 1 https://chromium.googlesource.com/chromium/src.git

# Checkout all the submodules at their branch DEPS revisions
gclient sync --with_branch_heads --jobs 16
Expand Down Expand Up @@ -102,7 +93,7 @@ strip -o "$BUILD_BASE/bin/headless-chromium" build/chromium/src/out/Headless/hea

# Use UPX to package headless chromium
# this adds 1-1.5 seconds of startup time so generally
# not so great for use in AWS Lambda so we don't actually use it
# not so great for use in AWS Lambda so we don't actually use it
# but left here in case someone finds it useful
# yum install -y ucl ucl-devel --enablerepo=epel
# cd build
Expand Down