This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfontconfig.cygport
More file actions
111 lines (96 loc) · 3.05 KB
/
Copy pathfontconfig.cygport
File metadata and controls
111 lines (96 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
NAME="fontconfig"
VERSION=2.13.1
RELEASE=1
CATEGORY="Libs"
SUMMARY="Font configuration library"
DESCRIPTION="Fontconfig is a library designed to provide system-wide font
configuration, customization and application access."
HOMEPAGE="http://www.freedesktop.org/wiki/Software/fontconfig"
SRC_URI="http://www.freedesktop.org/software/fontconfig/release/${NAME}-${VERSION}.tar.bz2"
PKG_NAMES="${NAME} ${NAME}-doc lib${NAME}1 lib${NAME}-common lib${NAME}-devel"
fontconfig_CATEGORY="X11"
fontconfig_SUMMARY="${SUMMARY% *} utilities"
fontconfig_CONTENTS="
usr/bin/fc-*
usr/share/man/man1/
"
fontconfig_doc_CATEGORY="Doc"
fontconfig_doc_SUMMARY="${SUMMARY} (API documentation)"
fontconfig_doc_CONTENTS="usr/share/doc/${NAME}/fontconfig-[du]* usr/share/man/man3/"
# at least one font is needed at runtime and dejavu seems to be the best choice
libfontconfig1_REQUIRES="dejavu-fonts libfontconfig-common"
libfontconfig1_CONTENTS="
etc/postinstall/zp_${NAME}_cache_1.sh
etc/preremove/${NAME}_cache_1.sh
usr/bin/cygfontconfig-1.dll
usr/libexec/fc-cache-1.exe
"
libfontconfig_common_CONTENTS="
--exclude=html --exclude=fontconfig-devel* --exclude=fontconfig-user*
etc/fonts/
etc/postinstall/${NAME}_dtd.sh
etc/preremove/${NAME}_dtd.sh
usr/share/doc/
usr/share/${NAME}
usr/share/locale/*/*/fontconfig*.mo
usr/share/man/man5/
usr/share/xml/
var/cache/${NAME}/
"
libfontconfig_devel_CONTENTS="
usr/include/fontconfig/
usr/lib/libfontconfig.dll.a
usr/lib/pkgconfig/fontconfig.pc
usr/share/gettext/its/fontconfig.*
"
DISTCLEANFILES="src/fcobjshash.gperf src/fcobjshash.h"
CYGCONF_ARGS="
--enable-docs
--with-docdir=/usr/share/doc/${NAME}
--with-default-fonts=/usr/share/fonts
--with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/share/ghostscript/fonts,/usr/local/share/fonts
"
src_install() {
local f cachesuf
local msfontsdir=/usr/share/fonts/microsoft
local dtddir=/usr/share/xml/fontconfig
cd ${B}
cyginstall
exeinto /usr/libexec
newexe ${D}/usr/bin/fc-cache.exe fc-cache-1.exe
cd ${S}
doman fc-*/fc-*.1
doman doc/*.3
doman doc/*.5
dodoc doc/*.txt
keepdir /var/cache/${NAME}
cachesuf=$(strings ${D}/usr/bin/cygfontconfig-1.dll | grep -F '.cache-')
dodir /etc/postinstall /etc/preremove
cat > ${D}/etc/postinstall/zp_fontconfig_cache_1.sh <<_EOF
mkdir -p $msfontsdir
# remove any broken links (-L -type l together)
/usr/bin/find -L $msfontsdir -type l -delete
/usr/bin/find "\`cygpath -W\`"/Fonts/ -name '*.ttf' -exec grep -FlZ 'Microsoft Corp' '{}' + | \
while read -d $'\0' f
do
if [ ! -e "$msfontsdir/\${f##*/}" ]
then
ln -s "\$f" $msfontsdir/
fi
done
/usr/libexec/fc-cache-1 -s || :
_EOF
cat > ${D}/etc/preremove/fontconfig_cache_1.sh <<_EOF
rm -f /var/cache/fontconfig/*${cachesuf}
_EOF
cat > ${D}/etc/postinstall/fontconfig_dtd.sh <<_EOF
if [ -x /usr/bin/xmlcatalog ] ; then
/usr/bin/xmlcatalog --noout --add "system" "fonts.dtd" ${dtddir}/fonts.dtd /etc/xml/catalog
fi
_EOF
cat > ${D}/etc/preremove/fontconfig_dtd.sh <<_EOF
if [ -x /usr/bin/xmlcatalog ] ; then
/usr/bin/xmlcatalog --noout --del ${dtddir}/fonts.dtd /etc/xml/catalog
fi
_EOF
}