diff --git a/scripts/install-chrome b/scripts/install-chrome index 597ec19..12d4b37 100755 --- a/scripts/install-chrome +++ b/scripts/install-chrome @@ -3,6 +3,14 @@ set -xeuo pipefail IFS=$'\n\t' +function download_noto() { + local NOTO_VERSION + # https://github.com/googlefonts/noto-emoji/releases/tag/v2.038 + NOTO_VERSION="v2.038" + curl --silent -O --location --fail "https://github.com/googlefonts/noto-emoji/raw/${NOTO_VERSION}/fonts/NotoColorEmoji.ttf" + echo "NotoColorEmoji.ttf" +} + function download_deb() { component=$1 @@ -17,14 +25,16 @@ function download_deb() { } function build_debian() { + apt-get update + echo "Installing browser" BROWSER_DEB="$(download_deb browser)" if [ "${ARCH}" == "arm64" ]; then COMMON_DEB=$(download_deb common) - apt install -y "$PWD/${COMMON_DEB}" "$PWD/${BROWSER_DEB}" + apt-get install -y "./${COMMON_DEB}" "./${BROWSER_DEB}" rm -rf "$COMMON_DEB" else - apt install -y "$PWD/${BROWSER_DEB}" + apt-get install -y "./${BROWSER_DEB}" fi rm -f "$BROWSER_DEB" @@ -38,10 +48,23 @@ function build_debian() { rm -f chromedriver_linux64.zip else DRIVER_DEB=$(download_deb driver) - apt install -y "$PWD/$DRIVER_DEB" + apt-get install -y "./$DRIVER_DEB" rm -f "$DRIVER_DEB" fi + # We have loads of tests rendering emoji, so let's ensure a proper emoji font is installed + echo "Installing Noto emoji font" + FONT_FILE=$(download_noto) + + mkdir -p /usr/local/share/fonts + mv "$FONT_FILE" /usr/local/share/fonts/ + chmod 644 "/usr/local/share/fonts/${FONT_FILE}" + ls -la /usr/local/share/fonts/ + + fc-cache -fv + fc-match -s noto + + # Cleanup apt-get autoremove -yq apt-get clean -yqq rm -rf /var/lib/apt/lists/* diff --git a/scripts/install-noto-emoji b/scripts/install-noto-emoji deleted file mode 100755 index d7c6f4f..0000000 --- a/scripts/install-noto-emoji +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# This script installs noto color emoji - -function build_debian() { - apt-get update - apt-get install unzip - - cat > ~/.fonts.conf << EOM - - - - - - Noto Color Emoji - - true - - - - chrome - - - Noto Color Emoji - - - -EOM - - mkdir setup_fonts - cd setup_fonts - curl https://noto-website-2.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip -LO - unzip NotoColorEmoji-unhinted.zip - - mkdir -p /usr/local/share/fonts - cp NotoColorEmoji.ttf /usr/local/share/fonts/ - ls -la /usr/local/share/fonts/ - chmod 644 /usr/local/share/fonts/NotoColorEmoji.ttf - - fc-cache -fv - - cd .. - rm -r setup_fonts - apt-get clean -yqq && rm -rf /var/lib/apt/lists/* -} - -BUILD_OS=${BUILD_OS:-debian} - -if [[ $BUILD_OS =~ debian ]]; then - build_debian "$@" -elif [[ $BUILD_OS =~ ubi ]]; then - build_ubi "$@" -fi