summaryrefslogtreecommitdiff
path: root/mk/tex.buildlink3.mk
blob: b502d2be50abff3ba41d5bbb0225ced05121042c (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# $NetBSD: tex.buildlink3.mk,v 1.18 2016/04/11 04:22:34 dbj Exp $
#
# This file is included by packages that need a TeX package to work.
#
# The following variables may be set by the pkgsrc user in mk.conf:
#
# TEX_DEFAULT
#	The user's favorite TeX implementation.
#
#	Possible values: teTeX3
#	Default value: teTeX3
#
# The following variables may be set by a package:
#
# TEX_DEPMETHOD
#	Select whether TeX is a runtime dependency or only needed
#	when building the package.
#
#	Possible values: build run
#	Default value: run
#
# TEX_ACCEPTED
#	List of TeX implementations that the package supports.
#
#	Possible values: teTeX3
#	Default value: teTeX3
#
# After including this file, the following variables may be used, but not
# in directives like .if, .for, etc.
#
# PKG_TEXMFPREFIX
#	Absolute pathname of the directory where the standard TeX files
#	can be found.
#
#	Typical values: ${PREFIX}/share/texmf ${PREFIX}/share/texmf-dist
#
# PKG_LOCALTEXMFPREFIX
#	Absolute pathname of the directory where extensions for TeX can
#	be found.
#
#	Typical values: ${PREFIX}/share/texmf ${PREFIX}/share/texmf-local
#
# TEX_TYPE
#	The TeX implementation that has been selected based on the
#	package's and the user's preferences.
#
#	Typical values: teTeX3
#

# NOTE: before all TeX-related packages are converted to use these
# variables, we will keep PKG_TEXMFPREFIX = PKG_LOCALTEXMFPREFIX =
# ${PREFIX}/share/texmf

.if !defined(TEX_BUILDLINK3_MK)
TEX_BUILDLINK3_MK=	# defined

.include "../../mk/bsd.prefs.mk"

TEX_DEPMETHOD?= run

# Assume only teTeX 3 is supported by default.
TEX_ACCEPTED?=	teTeX3

# set up variables for buildlink or depends
#
BUILDLINK_API_DEPENDS.teTeX3=	teTeX-bin-3.[0-9]*
BUILDLINK_PKGSRCDIR.teTeX3=	../../print/teTeX3-bin

# Determine the TeX version to be used.
#
.if !defined(_TEX_TYPE)
_TEX_TYPE=	${TEX_DEFAULT}
.endif

.if !empty(TEX_ACCEPTED:M${_TEX_TYPE})
TEX_TYPE=	${_TEX_TYPE}
.else
TEX_TYPE=	none
.endif

# Set version specifics.
#
.if ${TEX_TYPE} == "teTeX3"
_TEX_DEPENDENCY=	${BUILDLINK_API_DEPENDS.teTeX3}
_TEX_PKGSRCDIR=	${BUILDLINK_PKGSRCDIR.teTeX3}
.endif

.endif	# TEX_BUILDLINK3_MK

.if ${TEX_TYPE} == "none"
PKG_FAIL_REASON+=	\
	"${_TEX_TYPE} is not an acceptable (${TEX_ACCEPTED})\
	    TeX version for ${PKGNAME}."
.else
PLIST_SUBST+=	TEX_TYPE=${TEX_TYPE:Q}
.if (${TEX_DEPMETHOD} == "build")
BUILD_DEPENDS+=	${_TEX_DEPENDENCY}:${_TEX_PKGSRCDIR}
.else
TEX_DEPMETHOD:= run
.  include "${_TEX_PKGSRCDIR}/buildlink3.mk"

.endif
.endif