summaryrefslogtreecommitdiff
blob: 3ef73bb04f5c0b89ffbf3da992d190c082f1b70b (plain)
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
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/font-ebdftopcf.eclass,v 1.5 2007/09/16 02:56:19 dirtyepic Exp $

# Author: Robin H. Johnson <robbat2@gentoo.org>

# font-ebdftopcf.eclass
# Eclass to make PCF font generator from BDF uniform and optimal
# The manpage for this eclass is in media-gfx/ebdftopcf.

# inherit this eclass after font.eclass

# if USE="-X", this eclass is basically a no-op, since bdftopcf requires Xorg.
IUSE="X"

# Variable declarations
DEPEND="X? ( media-gfx/ebdftopcf )"
RDEPEND=""

use X && FONT_SUFFIX="pcf.gz"
use X || FONT_SUFFIX="bdf"

#
# Public functions
#
ebdftopcf() {
	local bdffiles
	bdffiles="$@"
	[ -z "$bdffiles" ] && die "No BDF files specified."
	emake -f /usr/share/ebdftopcf/Makefile.ebdftopcf \
		BDFFILES="${bdffiles}" \
		BDFTOPCF_PARAMS="${BDFTOPCF_PARAMS}" \
		|| die "Failed to build PCF files"
}

#
# Public inheritable functions
#
font-ebdftopcf_src_compile() {
	if use X; then
		[ -z "${BDFFILES}" ] && BDFFILES="$(find . -name '*.bdf')"
		ebdftopcf ${BDFFILES}
	fi
}

EXPORT_FUNCTIONS src_compile