Commit e6e5aa05 authored by Jérome Perrin's avatar Jérome Perrin

component/fonts: make fonts shareable

parent bc3e83da
......@@ -2,23 +2,45 @@
extends =
../xz-utils/buildout.cfg
../p7zip/buildout.cfg
buildout.hash.cfg
parts =
liberation-fonts
ipaex-fonts
ipa-fonts
ocrb-fonts
android-fonts
dejavu-fonts
fonts
[fonts]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
# Parts to install all fonts, in a way compatible with slapos.recipe.cmmi
# shared option.
# This can be configured in softwares, by setting the list of parts
# containing fonts as ${fonts:fonts}
fonts =
liberation-fonts ${liberation-fonts:location}
ipaex-fonts ${ipaex-fonts:location}
ipa-fonts ${ipa-fonts:location}
ocrb-fonts ${ocrb-fonts:location}
android-fonts ${android-fonts:location}
dejavu-fonts ${dejavu-fonts:location}
recipe = slapos.recipe.cmmi
shared = true
# XXX we need an URL so that recipe create directories.
url = ${:_profile_base_location_}/${empty.zip:filename}
md5sum = ${empty.zip:md5sum}
configure-command =:
make-binary = :
post-make-hook = ${:_profile_base_location_}/${fonts-copy-fonts:filename}#${fonts-copy-fonts:md5sum}:post_make_hook
[fonts-base]
destination = ${fonts:location}/${:_buildout_section_name_}
location = ${:destination}
recipe = slapos.recipe.build:download-unpacked
strip-top-level-dir = true
# download and unpack, with shared parts support
recipe = slapos.recipe.cmmi
shared = true
configure-command = :
make-binary = :
post-install = cp -ra . ${:location}
location = @@LOCATION@@
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
# Liberation(tm) Fonts - a font family which aims at metric
# compatibility with Arial, Times New Roman, and Courier New.
......@@ -61,7 +83,7 @@ md5sum = d0efec10b9f110a32e9b8f796e21782c
# Microsoft's TrueType core fonts
# non-free so not enabled by default
[msttcore-fonts]
location = ${fonts:location}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
recipe = slapos.recipe.build
script =
from zc.buildout.download import Download
......
[fonts-copy-fonts]
filename = fonts-copy-fonts.py
md5sum = c2fbe8f195d65aee9e1daa49544e2f68
[empty.zip]
filename = empty.zip
md5sum = 76cdb2bad9582d23c1f6f4d868218d6c
\ No newline at end of file
import os
import textwrap
import glob
import shutil
def post_make_hook(options, buildout, environment=None):
prefix = options['prefix']
for name, location in (line.split() for line in options['fonts'].splitlines()):
shutil.copytree(location, os.path.join(prefix, name))
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