Commit 7b512a88 authored by Eric Zheng's avatar Eric Zheng

component/headless-chromium: remove dedfault fontconfig

The font configuration is now the responsibility of
software/headless-chromium, and any other software releases that wish
to use component/headless-chromium.
parent 46b7bbe9
......@@ -8,8 +8,6 @@ extends =
../gperf/buildout.cfg
../pkgconfig/buildout.cfg
# Runtime dependencies:
../fonts/buildout.cfg
../fontconfig/buildout.cfg
../nspr/buildout.cfg
../nss/buildout.cfg
......@@ -69,7 +67,7 @@ configure-command =
gn gen ${:location}
# You can run the headless Chromium shell using
# ${:location}/headless-chromium --remote-debugging-port=1234
# ${:location}/headless_shell --remote-debugging-port=1234
make-binary =
autoninja -C ${:location} headless_shell
environment =
......@@ -83,39 +81,8 @@ runtime-libraries =
promises =
${:location}/headless_shell
# A default font configuration to fall back on, same as the Firefox one.
[default-font-config]
recipe = slapos.recipe.template:jinja2
template = ${template-fonts-conf:output}
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/fonts.conf
context =
key cachedir :cache-dir
key fonts :fonts
key includes :includes
fonts =
${liberation-fonts:location}
includes =
${fontconfig:location}/etc/fonts/conf.d
cache-dir =
~/.fontconfig-chromium/
# Create a wrapper around the headless Chromium shell. The wrapper sets some default values for environment variables and is based on the Firefox one.
# Place a wrapper script at bin/headless-chromium
[chromium-wrapper]
wrapper-name = headless-chromium
part = ${chromium:location}
recipe = slapos.recipe.build
location = ${buildout:bin-directory}/${:wrapper-name}
install =
import os
chromium = options['part']
part = self.buildout[os.path.basename(chromium)]
with open(location, 'w') as f:
f.write("""#!/bin/sh -e
[ -z $FONTCONFIG_FILE ] && export FONTCONFIG_FILE=${default-font-config:rendered}
exec ${chromium:path}/out/headless/headless_shell "$@"
""".format(
chromium,
))
os.fchmod(f.fileno(), 0o755)
recipe = slapos.cookbook:wrapper
command-line = ${chromium:path}/out/headless/headless_shell
wrapper-path = ${buildout:bin-directory}/headless-chromium
[template-cfg]
filename = instance.cfg.in
md5sum = 6f7839ca86234df72f7685bf329b7fd6
md5sum = 7dee90f9586279de6f6473a74fee8b45
[instance-headless-chromium]
_update_hash_filename_ = instance_headless-chromium.cfg.in
md5sum = 511ae700572956dcfba8b61a7c5fc5a0
md5sum = af71b16acc64457c74aa6103763dba62
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
......
......@@ -8,8 +8,11 @@ offline = true
[profile-common]
nginx-location = {{ nginx_location }}
liberation-fonts-location = {{ liberation_fonts_location }}
fontconfig-location = {{ fontconfig_location }}
chromium-wrapper = {{ chromium_wrapper }}
template-nginx-config = {{ template_nginx_config_target }}
template-fonts-conf = {{ template_fonts_conf_target }}
[instance-headless-chromium]
recipe = slapos.recipe.template:jinja2
......
......@@ -9,13 +9,14 @@ eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
# Create necessary directories.
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
tmp = ${:home}/tmp
log = ${:home}/log
etc = ${:home}/etc
service = ${:etc}/service
log = ${:home}/log
[headless-chromium]
ip = {{ partition_ipv6 }}
......@@ -34,7 +35,7 @@ nginx-access-log = ${directory:log}/nginx-access.log
# Create a launcher script for the headless shell executable.
[chromium-launcher]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=:: --remote-debugging-port=${headless-chromium:remote-debugging-port} ${headless-chromium:url}
command-line = FONTCONFIG_FILE=${font-config:rendered} && {{ parameter_list['chromium-wrapper'] }} --remote-debugging-address=:: --remote-debugging-port=${headless-chromium:remote-debugging-port} ${headless-chromium:url}
wrapper-path = ${directory:service}/chromium
# Create a configuration file for the proxy server.
......@@ -52,6 +53,20 @@ recipe = slapos.cookbook:wrapper
command-line = {{ parameter_list['nginx-location'] }}/sbin/nginx -c ${headless-chromium:nginx-config-target}
wrapper-path = ${directory:service}/nginx
# Generate a fonts.conf file.
[font-config]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template-fonts-conf'] }}
rendered = ${directory:etc}/fonts.conf
context =
key cachedir ${directory:etc}/.fontconfig.cache
key fonts :fonts
key includes :includes
fonts =
{{ parameter_list['liberation-fonts-location'] }}
includes =
{{ parameter_list['fontconfig-location'] }}/etc/fonts/conf.d
[publish-connection-information]
recipe = slapos.cookbook:publish
remote-debug-url = ${headless-chromium:remote-debug-url}
......
......@@ -4,6 +4,8 @@ extends =
../../stack/slapos.cfg
../../component/headless-chromium/buildout.cfg
../../component/nginx/buildout.cfg
../../component/fonts/buildout.cfg
../../component/fontconfig/buildout.cfg
parts =
slapos-cookbook
......@@ -17,8 +19,11 @@ mode = 0644
context =
section buildout buildout
key nginx_location nginx:location
key liberation_fonts_location liberation-fonts:location
key fontconfig_location fontconfig:location
key chromium_wrapper chromium-wrapper:location
key template_nginx_config_target template-nginx-conf:target
key template_fonts_conf_target template-fonts-conf:output
key template_instance_headless_chromium_target instance-headless-chromium:target
[download-base]
......@@ -29,11 +34,5 @@ mode = 0644
[instance-headless-chromium]
<= download-base
[template-chromium-launcher]
<= download-base
[template-nginx-conf]
<= download-base
[template-nginx-launcher]
<= download-base
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