2006-04-06 08:21:32 +02:00
|
|
|
# $NetBSD: tex.buildlink3.mk,v 1.13 2006/04/06 06:23:06 reed Exp $
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
2005-11-20 19:14:49 +01:00
|
|
|
# A Makefile fragment for TeX and LaTeX packages
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
|
|
|
# * Determine the version of teTeX to be used.
|
2006-01-08 15:00:11 +01:00
|
|
|
# Modify TEX_DEFAULT to change the default version (default to teTeX3)
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
|
|
|
# * tex files are installed...
|
|
|
|
# teTeX[1-2]
|
|
|
|
# -> ${PREFIX}/share/texmf
|
2006-02-27 13:14:50 +01:00
|
|
|
# teTeX3
|
|
|
|
# -> ${PREFIX}/share/texmf-local
|
2005-11-08 18:32:51 +01:00
|
|
|
# The variables PKG_TEXMFPREFIX and PKG_LOCALTEXMFPREFIX defines the main
|
|
|
|
# texmf tree, where teTeX should install his own texmf tree, and the local
|
|
|
|
# texmf tree, which is the place where other packages should install their
|
|
|
|
# latex files, like additional styles.
|
2005-11-20 19:14:49 +01:00
|
|
|
# NOTE: before all TeX-related packages are converted to use these
|
2005-11-08 18:32:51 +01:00
|
|
|
# variables, we will keep
|
|
|
|
# PKG_TEXMFPREFIX=PKG_LOCALTEXMFPREFIX=${PREFIX}/share/texmf
|
|
|
|
#
|
|
|
|
# * Assume each package supports teTeX{2,3} by default.
|
2005-11-20 19:14:49 +01:00
|
|
|
# To change the supported TeX versions, define TEX_ACCEPTED
|
2005-11-15 18:22:40 +01:00
|
|
|
# explicitly before including mk/tex.buildlink3.mk. Note that the
|
2005-11-15 13:54:35 +01:00
|
|
|
# order is important.
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
# * Optionally set TEX_DEPMETHOD to "build" to only add a build-time
|
2005-11-20 19:14:49 +01:00
|
|
|
# dependency on TeX. That may be useful for creating documentation
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
|
|
|
# Variables for users:
|
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
# TEX_DEFAULT
|
2005-11-08 18:32:51 +01:00
|
|
|
# Description:
|
2005-11-20 19:14:49 +01:00
|
|
|
# The user's favorite TeX implementation
|
2005-11-08 18:32:51 +01:00
|
|
|
# Possible values:
|
|
|
|
# teTeX1, teTeX2, teTeX3
|
|
|
|
# Default value:
|
2006-01-08 15:00:11 +01:00
|
|
|
# teTeX3
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
|
|
|
# Variables tex packages can provide:
|
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
# TEX_DEPMETHOD
|
2005-11-08 18:32:51 +01:00
|
|
|
# Description:
|
2005-11-20 19:14:49 +01:00
|
|
|
# Set tex as DEPENDS or BUILD_DEPENDS
|
2005-11-08 18:32:51 +01:00
|
|
|
# Possible values:
|
|
|
|
# run, build
|
|
|
|
# Default value:
|
|
|
|
# run
|
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
# TEX_ACCEPTED
|
2005-11-08 18:32:51 +01:00
|
|
|
# Description:
|
|
|
|
# Versions the package accepts (supports).
|
|
|
|
# Possible values:
|
|
|
|
# teTeX1, teTeX2, teTeX3
|
|
|
|
# Default value:
|
|
|
|
# teTeX2, teTeX3
|
|
|
|
#
|
|
|
|
# Variables provided for tex packages:
|
|
|
|
#
|
|
|
|
# PKG_TEXMFPREFIX
|
|
|
|
# Description:
|
|
|
|
# Path to the directory the standard tex files can be found
|
|
|
|
# Possible values:
|
|
|
|
# ${PREFIX}/share/texmf
|
|
|
|
# ${PREFIX}/share/texmf-dist
|
|
|
|
#
|
|
|
|
# PKG_LOCALTEXMFPREFIX
|
|
|
|
# Description:
|
|
|
|
# Path to the directory the tex for extentions should be installed into
|
|
|
|
# Possible values:
|
|
|
|
# ${PREFIX}/share/texmf
|
|
|
|
# ${PREFIX}/share/texmf-local
|
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
# TEX_TYPE
|
2005-11-08 18:32:51 +01:00
|
|
|
# Description:
|
2005-11-20 19:14:49 +01:00
|
|
|
# The type of the used TeX package
|
2005-11-08 18:32:51 +01:00
|
|
|
# Possible values:
|
|
|
|
# teTeX1, teTeX2, teTeX3
|
|
|
|
|
|
|
|
.if !defined(TEX_BUILDLINK3_MK)
|
|
|
|
TEX_BUILDLINK3_MK= # defined
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2005-11-11 19:50:23 +01:00
|
|
|
TEX_DEPMETHOD?= run
|
2005-11-08 18:32:51 +01:00
|
|
|
|
|
|
|
# Assume only teTeX {2-3} are supported by default.
|
2005-11-11 19:50:23 +01:00
|
|
|
TEX_ACCEPTED?= teTeX2 teTeX3
|
2005-11-08 18:32:51 +01:00
|
|
|
|
|
|
|
# set up variables for buildlink or depends
|
|
|
|
#
|
2006-04-06 08:21:32 +02:00
|
|
|
BUILDLINK_API_DEPENDS.teTeX1= teTeX-bin-1.[0-9]*
|
2005-11-08 18:32:51 +01:00
|
|
|
BUILDLINK_PKGSRCDIR.teTeX1= ../../print/teTeX1-bin
|
2006-04-06 08:21:32 +02:00
|
|
|
BUILDLINK_API_DEPENDS.teTeX2= teTeX-bin-2.[0-9]*
|
2005-11-08 18:32:51 +01:00
|
|
|
BUILDLINK_PKGSRCDIR.teTeX2= ../../print/teTeX-bin
|
2006-04-06 08:21:32 +02:00
|
|
|
BUILDLINK_API_DEPENDS.teTeX3= teTeX-bin-3.[0-9]*
|
2005-11-08 18:32:51 +01:00
|
|
|
BUILDLINK_PKGSRCDIR.teTeX3= ../../print/teTeX3-bin
|
|
|
|
|
2005-11-20 19:14:49 +01:00
|
|
|
# Determine the TeX version to be used.
|
2005-11-08 18:32:51 +01:00
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
.if !defined(_TEX_TYPE)
|
|
|
|
_TEX_TYPE= ${TEX_DEFAULT}
|
2005-11-08 18:32:51 +01:00
|
|
|
.endif
|
|
|
|
|
2005-11-11 19:50:23 +01:00
|
|
|
.if !empty(TEX_ACCEPTED:M${_TEX_TYPE})
|
|
|
|
TEX_TYPE= ${_TEX_TYPE}
|
2005-11-08 18:32:51 +01:00
|
|
|
.else
|
2005-11-11 19:50:23 +01:00
|
|
|
TEX_TYPE= none
|
2005-11-08 18:32:51 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Set version specifics.
|
|
|
|
#
|
2005-11-11 19:50:23 +01:00
|
|
|
.if ${TEX_TYPE} == "teTeX3"
|
2006-04-06 08:21:32 +02:00
|
|
|
_TEX_DEPENDENCY= ${BUILDLINK_API_DEPENDS.teTeX3}
|
2005-11-11 19:50:23 +01:00
|
|
|
_TEX_PKGSRCDIR= ${BUILDLINK_PKGSRCDIR.teTeX3}
|
|
|
|
.elif ${TEX_TYPE} == "teTeX2"
|
2006-04-06 08:21:32 +02:00
|
|
|
_TEX_DEPENDENCY= ${BUILDLINK_API_DEPENDS.teTeX2}
|
2005-11-11 19:50:23 +01:00
|
|
|
_TEX_PKGSRCDIR= ${BUILDLINK_PKGSRCDIR.teTeX2}
|
|
|
|
.elif ${TEX_TYPE} == "teTeX1"
|
2006-04-06 08:21:32 +02:00
|
|
|
_TEX_DEPENDENCY= ${BUILDLINK_API_DEPENDS.teTeX1}
|
2005-11-11 19:50:23 +01:00
|
|
|
_TEX_PKGSRCDIR= ${BUILDLINK_PKGSRCDIR.teTeX1}
|
2005-11-08 18:32:51 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif # TEX_BUILDLINK3_MK
|
|
|
|
|
2005-11-11 19:50:23 +01:00
|
|
|
.if ${TEX_TYPE} == "none"
|
2005-11-08 18:32:51 +01:00
|
|
|
PKG_FAIL_REASON= \
|
2006-02-11 04:00:11 +01:00
|
|
|
"${_TEX_TYPE} is not an acceptable (${TEX_ACCEPTED})\
|
|
|
|
TeX version for ${PKGNAME}."
|
2005-11-08 18:32:51 +01:00
|
|
|
.else
|
2006-01-08 15:00:11 +01:00
|
|
|
PLIST_SUBST+= TEX_TYPE=${TEX_TYPE:Q}
|
2005-11-11 19:50:23 +01:00
|
|
|
.if (${TEX_DEPMETHOD} == "build")
|
|
|
|
BUILD_DEPENDS+= ${_TEX_DEPENDENCY}:${_TEX_PKGSRCDIR}
|
2005-11-08 18:32:51 +01:00
|
|
|
.else
|
2005-11-11 19:50:23 +01:00
|
|
|
TEX_DEPMETHOD:= run
|
|
|
|
. include "${_TEX_PKGSRCDIR}/buildlink3.mk"
|
2006-01-08 15:00:11 +01:00
|
|
|
|
2005-11-08 18:32:51 +01:00
|
|
|
.endif
|
|
|
|
.endif
|