summaryrefslogtreecommitdiff
path: root/emulators/suse100_fontconfig
diff options
context:
space:
mode:
authorjlam <jlam>2007-08-23 20:42:32 +0000
committerjlam <jlam>2007-08-23 20:42:32 +0000
commit2d3a88268a27df455e960dd5952dcee6f8e723c3 (patch)
treead6ebfe017ce69742aae6b9179f722144bf016d6 /emulators/suse100_fontconfig
parentc02848ff2f841e5d9fa7b8fc9a865e3903806692 (diff)
downloadpkgsrc-2d3a88268a27df455e960dd5952dcee6f8e723c3.tar.gz
Teach the suse*_fontconfig packages to install a /etc/fonts/local.conf
containing the paths to font directories for font packages installed through pkgsrc. This allows Linux packages that use fontconfig to locate fonts to actually find them when X11_TYPE != "native". This should fix PR pkg/35160 and PR pkg/35505. Bump the PKGREVISION.
Diffstat (limited to 'emulators/suse100_fontconfig')
-rw-r--r--emulators/suse100_fontconfig/Makefile14
-rw-r--r--emulators/suse100_fontconfig/files/generate.awk37
-rw-r--r--emulators/suse100_fontconfig/files/local.conf.in11
3 files changed, 60 insertions, 2 deletions
diff --git a/emulators/suse100_fontconfig/Makefile b/emulators/suse100_fontconfig/Makefile
index a631f735a3a..de13828a171 100644
--- a/emulators/suse100_fontconfig/Makefile
+++ b/emulators/suse100_fontconfig/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2007/07/29 05:18:42 jlam Exp $
+# $NetBSD: Makefile,v 1.7 2007/08/23 20:42:32 jlam Exp $
DISTNAME= suse_fontconfig-${SUSE_VERSION}
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= emulators
DISTFILES= fontconfig-2.3.2.20050721-10.2.${SUSE_ARCH}.rpm
@@ -11,4 +11,14 @@ COMMENT= Linux compatibility package for fontconfig
EMUL_MODULES.linux= expat freetype2
.include "../../emulators/suse100_linux/Makefile.common"
+
+do-build:
+ ${SETENV} LOCALBASE=${LOCALBASE:Q} X11PREFIX=${X11PREFIX:Q} \
+ ${AWK} -f ${FILESDIR}/generate.awk ${FILESDIR}/local.conf.in \
+ > ${WRKSRC}/local.conf
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/local.conf \
+ ${PREFIX}/${EMULSUBDIR}/etc/fonts/local.conf
+
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/suse100_fontconfig/files/generate.awk b/emulators/suse100_fontconfig/files/generate.awk
new file mode 100644
index 00000000000..2560cb1b323
--- /dev/null
+++ b/emulators/suse100_fontconfig/files/generate.awk
@@ -0,0 +1,37 @@
+# $NetBSD: generate.awk,v 1.1 2007/08/23 20:42:32 jlam Exp $
+#
+# AWK script to replace @FONTDIR_ENTRIES@ with a list of <dir></dir>
+# entries taken from the "entries" array. We do variable replacement
+# for ${LOCALBASE} and ${X11PREFIX} using the values of LOCALBASE and
+# X11PREFIX that are passed to the script.
+#
+
+BEGIN {
+ entries[0] = "${X11PREFIX}/lib/X11/fonts"
+ entries[1] = "${LOCALBASE}/OpenOffice.org1.1.5/share/fonts"
+ entries[2] = "${LOCALBASE}/openoffice.org2.2/share/fonts"
+ entries[3] = "${LOCALBASE}/java/blackdown-1.3.1/lib/fonts"
+ entries[4] = "${LOCALBASE}/java/scsl-1.5/lib/fonts"
+ entries[5] = "${LOCALBASE}/java/sun-1.3.1/lib/fonts"
+ entries[6] = "${LOCALBASE}/java/sun-1.4/lib/fonts"
+ entries[7] = "${LOCALBASE}/java/sun-1.5/lib/fonts"
+ entries[8] = "${LOCALBASE}/java/sun-6/lib/fonts"
+ entries[9] = "${LOCALBASE}/Acrobat4/Resource/CIDFont"
+ entries[10] = "${LOCALBASE}/Acrobat5/Resource/Font"
+ entries[11] = "${LOCALBASE}/Acrobat7/Resource/CIDFont"
+ num_entries = 12
+
+ LOCALBASE = ENVIRON["LOCALBASE"] ? ENVIRON["LOCALBASE"] : "/usr/pkg"
+ X11PREFIX = ENVIRON["X11PREFIX"] ? ENVIRON["X11PREFIX"] : "/usr/X11R6"
+}
+
+/^@FONTDIR_ENTRIES@/ {
+ for (i = 0; i < num_entries; i++) {
+ entry = entries[i]
+ sub("[$]{LOCALBASE}", LOCALBASE, entry)
+ sub("[$]{X11PREFIX}", X11PREFIX, entry)
+ print " <dir>" entry "</dir>"
+ }
+ next
+}
+{ print }
diff --git a/emulators/suse100_fontconfig/files/local.conf.in b/emulators/suse100_fontconfig/files/local.conf.in
new file mode 100644
index 00000000000..5eb84aa03f2
--- /dev/null
+++ b/emulators/suse100_fontconfig/files/local.conf.in
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- $NetBSD: local.conf.in,v 1.1 2007/08/23 20:42:32 jlam Exp $ -->
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+
+<!-- Local font directory list -->
+
+@FONTDIR_ENTRIES@
+
+</fontconfig>