summaryrefslogtreecommitdiffstats
path: root/korean/mplayer-fonts/Makefile
blob: db8c24cd39c742bdcbfa3f24d99a52fe323c4e6e (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
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
# New ports collection makefile for:	ko-mplayer-fonts
# Date created:		17 June 2002
# Whom:			Hye-Shik Chang
#
# $FreeBSD$

PORTNAME=	mplayer-fonts
PORTVERSION=	1.0
CATEGORIES=	korean multimedia
MASTER_SITES=	${MASTER_SITE_LOCAL} \
		http://people.freebsd.org/~perky/distfiles/ \
		http://www.yonsei.ac.kr/yu/intro/symbol/:yonsei
MASTER_SITE_SUBDIR=	perky
DISTFILES=	${SUBFONT_DISTNAME}.tar.bz2 \
		mplayer-fontmap-euc-kr.tar.bz2 \
		${YONSEI_TITLE_DISTNAME}:yonsei \
		${YONSEI_TEXT_DISTNAME}:yonsei
EXTRACT_ONLY=	${SUBFONT_DISTNAME}.tar.bz2 mplayer-fontmap-euc-kr.tar.bz2

MAINTAINER=	perky@FreeBSD.org
COMMENT=	Korean font pack for the mplayer OSD, SUB and SMI

BROKEN=		"Size mismatch"

BUILD_DEPENDS=	${LOCALBASE}/lib/libiconv.so.3:${PORTSDIR}/converters/libiconv \
		${FREETYPE_CONFIG}:${PORTSDIR}/print/freetype2 \
		${BAEKMUK_FONTDIR}/gulim.ttf:${PORTSDIR}/korean/baekmukfonts-ttf

USE_BZIP2=	yes
USE_REINPLACE=	yes
WRKSRC=		${WRKDIR}/${SUBFONT_DISTNAME}
PLIST_SUB+=	MF=${MPLAYER_FONTDIR:S,${LOCALBASE}/,,g}

SUBFONT_DISTNAME=	subfont-c-0.90pre6
MPLAYER_FONTDIR=	${LOCALBASE}/share/mplayer/fonts/korean
FREETYPE_CONFIG=	${LOCALBASE}/bin/freetype-config

BAEKMUK_FONTDIR=	${X11BASE}/lib/X11/fonts/TrueType
BAEKMUK_FONTS=		gulim dotum batang
YONSEI_TITLE_DISTNAME=	%BF%AC%BC%BC%C1%A6%B8%F1.TTF
YONSEI_TEXT_DISTNAME=	%BF%AC%BC%BC%BA%BB%B9%AE.TTF
YONSEI_TITLE_FONTNAME=	YonseiTitle
YONSEI_TEXT_FONTNAME=	YonseiText
ALL_FONTS=		${BAEKMUK_FONTS} ${YONSEI_TITLE_FONTNAME} \
			${YONSEI_TEXT_FONTNAME}
FONT_SIZES=		12 16 20 24

post-extract:
	@${LN} -sf ${DISTDIR}/${YONSEI_TITLE_DISTNAME} \
		${WRKSRC}/${YONSEI_TITLE_FONTNAME}.ttf
	@${LN} -sf ${DISTDIR}/${YONSEI_TEXT_DISTNAME} \
		${WRKSRC}/${YONSEI_TEXT_FONTNAME}.ttf
.for fn in ${BAEKMUK_FONTS}
	@${LN} -sf ${BAEKMUK_FONTDIR}/${fn}.ttf ${WRKSRC}/
.endfor
	@${LN} -sf ${WRKDIR}/euc-kr ${WRKSRC}/

post-patch:
	@${ECHO_CMD} -e 'LDFLAGS=-lm `${FREETYPE_CONFIG} --libs` -liconv \
		-L${LOCALBASE}/lib\nCFLAGS=`${FREETYPE_CONFIG} --cflags` \
		-I${LOCALBASE}/include\nPROG=subfont\nNOMAN=yes\
		\n.include <bsd.prog.mk>' > ${WRKSRC}/Makefile
	@${REINPLACE_CMD} -e 's,^encoding.*,encoding=euc-kr,;\
		s,^fontsize.*,fontsize=\$$3,;\
		s,^symbolssize.*,symbolssize=\$$((\$$fontsize-2)),' \
		${WRKSRC}/fontgen

post-build:
.for font in ${ALL_FONTS}
.for size in ${FONT_SIZES}
	cd ${WRKSRC} && ${SH} fontgen ${font}.ttf ${font}-${size} ${size} \
		2> /dev/null
.endfor
.endfor

do-install:
	@${MKDIR} ${MPLAYER_FONTDIR}
.for font in ${ALL_FONTS}
.for size in ${FONT_SIZES}
	@${TAR} -C ${WRKSRC} -cpf - ${font}-${size} | \
	 ${TAR} -C ${MPLAYER_FONTDIR} -xpf -
.endfor
.endfor

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud