1PORTNAME=		sourcehansans
2PORTVERSION=		2.001
3DISTVERSIONSUFFIX=	R
4CATEGORIES?=		japanese x11-fonts
5PKGNAMESUFFIX?=		-otf
6# Note: the following PKGNAMEPREFIX is here only for self-documenting purpose;
7#       actual prefixing is done by the `japanese' category itself.
8#PKGNAMEPREFIX?=	ja-
9
10MAINTAINER=		ports@MidnightBSD.org
11COMMENT?=		Japanese font by Adobe designed for user interfaces
12WWW=			https://github.com/adobe-fonts/source-han-sans
13
14LICENSE=		OFL11
15LICENSE_FILE=		${WRKSRC}/LICENSE.txt
16
17USES=			fonts
18USE_GITHUB=		yes
19GH_ACCOUNT=		adobe-fonts
20GH_PROJECT=		source-han-sans
21
22NO_ARCH=		yes
23NO_BUILD=		yes
24SUB_FILES=		pkg-message
25
26OPTIONS_DEFINE=		HW
27OPTIONS_SINGLE=		TYPE
28OPTIONS_SINGLE_TYPE=	FULL SUBSET
29OPTIONS_DEFAULT=	FULL
30OPTIONS_SUB=		yes
31
32HW_DESC=		Install the half-width font in addition to the full font
33FULL_DESC=		Install the full font (can display all CJK)
34SUBSET_DESC?=		Install the subset font (can display Japanese only)
35SUBSET_PREVENTS=	HW
36SUBSET_PREVENTS_MSG=	Half-width can only be installed in addition to the full font
37
38FULL_VARS?=		FONTNAME=SourceHanSans SRCFONTSDIR=OTF/Japanese
39SUBSET_VARS?=		FONTNAME=SourceHanSansJP SRCFONTSDIR=SubsetOTF/JP
40
41SHS_HW_LANG?=		Japanese
42
43# These are to maintain correct pkg description and file list for slave ports
44DESCR=			${.CURDIR}/pkg-descr
45PLIST=			${.CURDIR}/pkg-plist
46
47do-install:
48	@${MKDIR} ${FONTSDIR}
49	${INSTALL_DATA} ${WRKSRC}/${SRCFONTSDIR}/*.otf ${FONTSDIR}
50
51post-install-HW-on:
52	${INSTALL_DATA} ${WRKSRC}/OTF/${SHS_HW_LANG}HW/*.otf ${FAKE_DESTDIR}${FONTSDIR}
53
54.include <bsd.port.mk>
55