summaryrefslogtreecommitdiff
path: root/mk/ghostscript.mk
diff options
context:
space:
mode:
authorjlam <jlam>2002-09-13 06:37:11 +0000
committerjlam <jlam>2002-09-13 06:37:11 +0000
commit66cf6063675f249e27856cd95baeb40f026a1511 (patch)
treeaf52014b9611a4588b872e42f55adadd6d0b132c /mk/ghostscript.mk
parentb0dca60868b1a43b3df6b8836dc6cbed320e1123 (diff)
downloadpkgsrc-66cf6063675f249e27856cd95baeb40f026a1511.tar.gz
Add a ghostscript.mk file that may be included by packages that want a
dependency on ghostscript. This handles the dependency patterns that will match either ghostscript{,-nox11} and ghostscript-gnu{,-nox11} depending on which version number of ghostscript is required. From the comments at the top of the file: To use this Makefile fragment, simply: (1) Optionally set GHOSTSCRIPT_REQD to the minimum version number of Ghostscript required by the package, (2) Optionally set USE_GHOSTSCRIPT to "build" to only add a build-time dependency on Ghostscript, (3) And include this Makefile fragment in the package Makefile,
Diffstat (limited to 'mk/ghostscript.mk')
-rw-r--r--mk/ghostscript.mk70
1 files changed, 70 insertions, 0 deletions
diff --git a/mk/ghostscript.mk b/mk/ghostscript.mk
new file mode 100644
index 00000000000..cd1a1257475
--- /dev/null
+++ b/mk/ghostscript.mk
@@ -0,0 +1,70 @@
+# $NetBSD: ghostscript.mk,v 1.1 2002/09/13 06:37:11 jlam Exp $
+#
+# This Makefile fragment is included by packages that require a run-time
+# dependency on a ghostscript Postscript interpreter.
+#
+# To use this Makefile fragment, simply:
+#
+# (1) Optionally set GHOSTSCRIPT_REQD to the minimum version number of
+# Ghostscript required by the package,
+# (2) Optionally set USE_GHOSTSCRIPT to "build" to only add a build-time
+# dependency on Ghostscript,
+# (3) And include this Makefile fragment in the package Makefile,
+
+.include "../../mk/bsd.prefs.mk"
+
+GHOSTSCRIPT_REQD?= 6.0
+USE_GHOSTSCRIPT?= run
+
+.if defined(NO_X11)
+_GS_PKGSRCDIR?= ../../print/ghostscript-gnu-nox11
+.else
+_GS_PKGSRCDIR?= ../../print/ghostscript-gnu
+.endif
+
+_VALID_GS= # empty
+
+# ghostscript-gnu{,-nox11} satisfies ${GS_REQD}<=7.05
+#
+.for _gs_pattern_ in [0-6].* 7.0 7.0nb* 7.0[0-5]
+. if !empty(GS_REQD:M${_gs_pattern_})
+. if defined(USE_X11) || defined(USE_X11BASE) || defined(USE_IMAKE)
+_VALID_GS+= ghostscript-gnu>=${GS_REQD}
+. else
+_VALID_GS+= ghostscript-gnu>=${GS_REQD}
+_VALID_GS+= ghostscript-gnu-no11>=${GS_REQD}
+. endif
+. endif
+.endfor
+
+# ghostscript{,-nox11} satisfies ${GS_REQD}<=6.01nb4.
+#
+.for _gs_pattern_ in [0-5].* 6.0 6.0nb* 6.01 6.01nb[1-4]
+. if !empty(GS_REQD:M${_gs_pattern_})
+. if defined(USE_X11) || defined(USE_X11BASE) || defined(USE_IMAKE)
+_VALID_GS+= ghostscript>=${GS_REQD}
+. else
+_VALID_GS+= ghostscript>=${GS_REQD}
+_VALID_GS+= ghostscript-no11>=${GS_REQD}
+. endif
+. endif
+.endfor
+
+.if !defined(GHOSTSCRIPT_DEPENDS) && !empty(_VALID_GS)
+_GS_DEPENDS!= ${ECHO} "${_VALID_GS}" | ${SED} -e "s:^ *::" -e "s: :,:g"
+. if !empty(_GS_DEPENDS:M*,*)
+GHOSTSCRIPT_DEPENDS= {${_GS_DEPENDS}}:${_GS_PKGSRCDIR}
+. else
+GHOSTSCRIPT_DEPENDS= ${_GS_DEPENDS}:${_GS_PKGSRCDIR}
+. endif
+MAKEFLAGS+= GHOSTSCRIPT_DEPENDS="${GHOSTSCRIPT_DEPENDS}"
+.endif
+
+.if (${USE_GHOSTSCRIPT} == "build")
+_GS_DEPMETHOD= BUILD_DEPENDS
+.else
+USE_GHOSTSCRIPT:= run
+_GS_DEPMETHOD= DEPENDS
+.endif
+
+${_GS_DEPMETHOD}+= ${GHOSTSCRIPT_DEPENDS}