Commit debd2fce authored by Julien Muchembled's avatar Julien Muchembled

fonts: cleanup, make msttcore-fonts shared

parent 22aa0b65
...@@ -13,16 +13,8 @@ parts = ...@@ -13,16 +13,8 @@ parts =
[fonts-base] [fonts-base]
# XXX download and unpack, with shared parts support recipe = slapos.recipe.build:download-unpacked
# 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
shared = true shared = true
configure-command = :
make-binary = :
post-install = cp -ra . ${:location}
location = @@LOCATION@@
environment = environment =
PATH=${xz-utils:location}/bin:%(PATH)s PATH=${xz-utils:location}/bin:%(PATH)s
...@@ -77,27 +69,19 @@ md5sum = 62f02985bfef43a27dbdd17641fec210 ...@@ -77,27 +69,19 @@ md5sum = 62f02985bfef43a27dbdd17641fec210
# Microsoft's TrueType core fonts # Microsoft's TrueType core fonts
# non-free so not enabled by default # non-free so not enabled by default
[msttcore-fonts] [msttcore-fonts]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
recipe = slapos.recipe.build recipe = slapos.recipe.build
shared = true
p7z = ${p7zip:location}/bin/7z
install = install =
import os, subprocess import os, subprocess
from zc.buildout.download import Download os.makedirs(location)
d = location cmd = [options['p7z'], "x", "-ssc-", None, "*.ttf"]
fonts = [] for x in options['fonts'].splitlines():
download = lambda x, dl=Download(self.buildout['buildout']): ( md5sum, name = x.split()
dl("http://downloads.sf.net/corefonts/%s32.exe" % name, md5sum=md5sum) cmd[3] = self.download(
for md5sum, name in (x.split() for x in x.splitlines() if x)) "http://downloads.sf.net/corefonts/%s32.exe" % name,
extract = lambda x, d=d, p7z="${p7zip:location}/bin/7z": any( md5sum)
subprocess.check_call((p7z, "x", "-ssc-", path, "*.ttf"), cwd=d) subprocess.check_call(cmd, cwd=location)
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)
slapos_promise = slapos_promise =
slapos_update_promise = ${:slapos_promise} slapos_update_promise = ${:slapos_promise}
fonts = fonts =
......
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