summaryrefslogtreecommitdiff
blob: c585a80d467643885c0615549883331d03e818e0 (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
47
48
49
50
51
52
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="True Type Font to Postscript Type 1 Converter"
HOMEPAGE="https://ttf2pt1.sourceforge.net/"
SRC_URI="https://downloads.sourceforge.net/ttf2pt1/${P}.tgz"

LICENSE="ttf2pt1"
SLOT="0"
KEYWORDS="amd64 ppc sparc x86"

DEPEND=">=media-libs/freetype-2.5.1:2"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}"/${P}-Makefile.patch
	"${FILESDIR}"/${P}-LDFLAGS.patch
	"${FILESDIR}"/${PN}-3.4.0-man-pages.diff
	"${FILESDIR}"/${P}-freetype.patch
	"${FILESDIR}"/${P}-clang16.patch
)

src_prepare() {
	default

	sed -i \
		-e "/^CC=/ { s:gcc:$(tc-getCC): }" \
		-e "/^CFLAGS_SYS=/ { s:-O.*$:${CFLAGS}: }" \
		-e "/^LIBS_FT=/ { s:-L/usr/lib:-L${ESYSROOT}/usr/$(get_libdir): }" \
		-e "s:-I/usr/include/freetype2 -I/usr/include:$($(tc-getPKG_CONFIG) --cflags freetype2):" \
		-e "s:-L/usr/lib -lfreetype:$($(tc-getPKG_CONFIG) --libs freetype2):" \
		-e "/^LIBXDIR =/ { s:libexec:$(get_libdir): }" \
		-e "/chown/d" \
		-e "/chgrp/d" \
		-e "/chmod/d" \
		Makefile || die
}

src_install() {
	emake INSTDIR="${ED}"/usr install
	dodir /usr/share/doc/${PF}

	pushd "${ED}"/usr/share/ttf2pt1 > /dev/null || die
	rm -r app other || die
	mv [A-Z]* ../doc/${PF} || die
	popd > /dev/null || die
}