wok-next view ttf-dejavu/receipt @ rev 20674
Up putty (0.70)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat May 12 05:17:48 2018 +0300 (2018-05-12) |
parents | 4ca71b0ef823 |
children | cd7906120828 |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="ttf-dejavu"
4 VERSION="2.37"
5 CATEGORY="fonts"
6 SHORT_DESC="DejaVu TrueType fonts"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="other"
9 WEB_SITE="https://dejavu-fonts.github.io/"
11 TARBALL="dejavu-fonts-ttf-$VERSION.tar.bz2"
12 WGET_URL="$SF_MIRROR/dejavu/$TARBALL"
14 BUILD_DEPENDS="shared-mime-info fontforge"
15 SPLIT="ttf-dejavu-extra"
17 compile_rules() {
18 # Install/repack fonts
20 f=$install/usr/share/fonts/truetype/ttf-dejavu
21 mkdir -p $f
22 for font in $src/ttf/*.ttf; do
23 size1=$(ls -l $font | awk '{print $5}')
24 a="$a\n$(printf "%-32s" $(basename $font .ttf)): $size1 B -> "
25 echo "Processing $(basename $font):"
26 # About FontForge scripting and this command, see:
27 # https://fontforge.github.io/scripting-alpha.html#Generate
28 fontforge -quiet -lang=ff -c 'Open($1); Generate($2,"",0x90)' \
29 $font $f/$(basename $font)
30 size2=$(ls -l $f/$(basename $font) | awk '{print $5}')
31 a="$a$size2 B ($(( $size2 - $size1 )) B)"
32 echo
33 done
34 echo -e "\nResults:\n========\n$a"
36 # Install available configurations
38 f=$install/usr/share/fontconfig/conf.avail
39 mkdir -p $f
40 cp $src/fontconfig/*.conf $f
42 tmp=$(mktemp)
44 # Strip *.conf files
45 for i in $install/usr/share/fontconfig/conf.avail/*; do
46 # <?xml version="1.0" encoding="UTF-8"?>
47 sed -i 's| encoding="UTF-8"||' $i # remove needless encoding
48 # <!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
49 sed -i 's|\.\./||' $i # remove "../"
51 tr -d '\n' < $i | sed 's|[ \t][ \t]*| |g' | \
52 sed 's|<!--|\n&|g; s|-->|&\n|g' | sed '/<!--/d' | \
53 tr -d '\n' | sed 's|> *<|><|g' > $tmp
54 cat $tmp > $i
55 done
57 rm $tmp
59 # Use the configurations
60 f=$install/etc/fonts/conf.d
61 mkdir -p $f
62 for i in $src/fontconfig/*.conf; do
63 ln -s /usr/share/fontconfig/conf.avail/$(basename $i) $f/$(basename $i)
64 done
65 }
67 genpkg_rules() {
68 case $PACKAGE in
69 ttf-dejavu)
70 copy DejaVuSans.ttf DejaVuSans-Bold.ttf DejaVuSansMono.ttf \
71 *sans.conf *mono.conf
72 TAGS="font"
73 ;;
74 ttf-dejavu-extra)
75 copy @std @rm
76 CAT="fonts|extra font styles"
77 TAGS="font"
78 ;;
79 esac
80 }