Commit debd2fce authored by Julien Muchembled's avatar Julien Muchembled

fonts: cleanup, make msttcore-fonts shared

parent 22aa0b65
......@@ -13,16 +13,8 @@ parts =
[fonts-base]
# XXX download and unpack, with shared parts support
# we could make slapos.recipe.build:download-unpacked really support shared
# parts and use it here. Current version of slapos.recipe.build ( 0.44 ) looks
# for buildout:shared-parts , but this is not what shared parts are using.
recipe = slapos.recipe.cmmi
recipe = slapos.recipe.build:download-unpacked
shared = true
configure-command = :
make-binary = :
post-install = cp -ra . ${:location}
location = @@LOCATION@@
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
......@@ -77,27 +69,19 @@ md5sum = 62f02985bfef43a27dbdd17641fec210
# Microsoft's TrueType core fonts
# non-free so not enabled by default
[msttcore-fonts]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
recipe = slapos.recipe.build
shared = true
p7z = ${p7zip:location}/bin/7z
install =
import os, subprocess
from zc.buildout.download import Download
d = location
fonts = []
download = lambda x, dl=Download(self.buildout['buildout']): (
dl("http://downloads.sf.net/corefonts/%s32.exe" % name, md5sum=md5sum)
for md5sum, name in (x.split() for x in x.splitlines() if x))
extract = lambda x, d=d, p7z="${p7zip:location}/bin/7z": any(
subprocess.check_call((p7z, "x", "-ssc-", path, "*.ttf"), cwd=d)
for path, is_temp in x)
try:
fonts += download(options['fonts'])
os.makedirs(d)
extract(fonts)
finally:
for path, is_temp in fonts:
if is_temp:
os.remove(path)
os.makedirs(location)
cmd = [options['p7z'], "x", "-ssc-", None, "*.ttf"]
for x in options['fonts'].splitlines():
md5sum, name = x.split()
cmd[3] = self.download(
"http://downloads.sf.net/corefonts/%s32.exe" % name,
md5sum)
subprocess.check_call(cmd, cwd=location)
slapos_promise =
slapos_update_promise = ${:slapos_promise}
fonts =
......
  • @xavier_thompson This breaks Theia SR. I've just pushed slapos.recipe.build@a5a9dcee but I'd like to take a decision about slapos.recipe.build@8a9e3766 (@jerome) before making a new release.

    If you don't want to wait, note that this it's simpler to add strip-top-level-dir = false (in [jetbrains-mono-fonts]) than revert the switch to slapos.recipe.build.

    Edited by Julien Muchembled
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