[Midnightbsd-cvs] mports [21404] trunk/Mk: add ghostscript extension from freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun May 22 16:56:25 EDT 2016
Revision: 21404
http://svnweb.midnightbsd.org/mports/?rev=21404
Author: laffer1
Date: 2016-05-22 16:56:25 -0400 (Sun, 22 May 2016)
Log Message:
-----------
add ghostscript extension from freebsd
Modified Paths:
--------------
trunk/Mk/components/default-versions.mk
Added Paths:
-----------
trunk/Mk/extensions/ghostscript.mk
Modified: trunk/Mk/components/default-versions.mk
===================================================================
--- trunk/Mk/components/default-versions.mk 2016-05-22 20:51:23 UTC (rev 21403)
+++ trunk/Mk/components/default-versions.mk 2016-05-22 20:56:25 UTC (rev 21404)
@@ -19,6 +19,7 @@
APACHE_DEFAULT?= 2.4
FPC_DEFAULT?= 2.6.4
GCC_DEFAULT?= 4.8
+GHOSTSCRIPT_DEFAULT?= 9
LUA_DEFAULT?= 5.2
MYSQL_DEFAULT?= 5.6
PERL5_DEFAULT?= 5.18
Added: trunk/Mk/extensions/ghostscript.mk
===================================================================
--- trunk/Mk/extensions/ghostscript.mk (rev 0)
+++ trunk/Mk/extensions/ghostscript.mk 2016-05-22 20:56:25 UTC (rev 21404)
@@ -0,0 +1,110 @@
+# $MidnightBSD$
+#
+# Provide support for ghostscript ports.
+#
+# Feature: ghostscript
+# Usage: USES=ghostscript or USES=ghostscript:args
+# Valid ARGS: <version>, build, run, x11
+#
+# version The chooseable versions are 7, 8 and 9. If no version is
+# specified version 9 is selected.
+#
+# USES=ghostscript:7 # Use Ghostscript 7
+# USES=ghostscript:run # Use the set default Ghostscript as a run dependancy
+# USES=ghostscript:8,build # Use ghostscript 8 as a build dependancy.
+#
+# x11 Indicate that X11 support is required.
+# build Indicates that Ghostscript is needed at build time and adds
+# it as BUILD_DEPENDS.
+# run Indicates that Ghostscript is needed at run time and adds
+# it as RUN_DEPENDS.
+#
+# If build and run are omitted, Ghostscript will be added as BUILD_DEPENDS and
+# RUN_DEPENDS.
+#
+
+.if !defined(_INCLUDE_USES_GHOSTSCRIPT_MK)
+_INCLUDE_USES_GHOSTSCRIPT_MK= yes
+
+# allowed versions
+_GS_VERSION= 7 8 9 agpl
+
+_GS_ARGS= ${ghostscript_ARGS}
+
+.if ${_GS_ARGS:N[789]:Nagpl:Nx11:Nbuild:Nrun}
+IGNORE?= Unknown ghostscript argument ${_GS_ARGS}
+.endif
+
+# Determine version number of Ghostscript to use
+.include "${PORTSDIR}/Mk/components/default-versions.mk"
+
+.if ${GHOSTSCRIPT_DEFAULT:N[789]:Nagpl}
+IGNORE?= Invalid GHOSTSCRIPT_DEFAULT value: ${GHOSTSCRIPT_DEFAULT}, please select one of ${_GS_VERSION}
+.endif
+
+# Make sure that no dependency or some other environment variable
+# pollutes the build/run dependency detection
+.undef _GS_BUILD_DEP
+.undef _GS_RUN_DEP
+.if ${_GS_ARGS:Mbuild}
+_GS_BUILD_DEP= yes
+.endif
+.if ${_GS_ARGS:Mrun}
+_GS_RUN_DEP= yes
+.endif
+
+# The port does not specify a build or run dependency, assume both are
+# required.
+.if !defined(_GS_BUILD_DEP) && !defined(_GS_RUN_DEP)
+_GS_BUILD_DEP= yes
+_GS_RUN_DEP= yes
+.endif
+
+.undef _GS_AGPL_SUFFIX
+.undef _GS_SELECTED
+.for V in ${_GS_ARGS} ${GHOSTSCRIPT_DEFAULT}
+_V=${V}
+.if ${_V:M9}
+_GS_SELECTED?= 9
+.elif ${_V:Magpl}
+_GS_AGPL_SUFFIX?= -agpl
+.if defined(_GS_SELECTED) && ${_GS_SELECTED:N9}
+IGNORE?= Ghostscript-agpl is only available in version 9
+.else
+_GS_SELECTED?= 9
+.endif
+.elif ${_V:M8}
+_GS_SELECTED?= 8
+.elif ${_V:M7}
+_GS_SELECTED?= 7
+.endif
+.endfor
+.if !defined(_GS_SELECTED)
+IGNORE?= Invalid ghostscript argument or GHOSTSCRIPT_DEFAULT
+.endif
+
+# Resolve minor version number for X11.so library.
+.if !empty(_GS_SELECTED:M9) && defined(_GS_AGPL_SUFFIX)
+_GS_VERSION_MINOR= 9.16_2
+.elif !empty(_GS_SELECTED:M9)
+_GS_VERSION_MINOR= 9.06_11
+.elif !empty(_GS_SELECTED:M8)
+_GS_VERSION_MINOR= 8.71_19
+.elif !empty(_GS_SELECTED:M7)
+_GS_VERSION_MINOR= 7.07_32
+.endif
+
+# dependencies
+_GS_PORT= ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}-base
+_GS_X11_PORT= ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}-x11
+
+.for type in BUILD RUN
+.if defined(_GS_${type}_DEP)
+${type}_DEPENDS+= ${_GS_PORT}>=${_GS_VERSION_MINOR}:${PORTSDIR}/print/${_GS_PORT}
+.if ${_GS_ARGS:Mx11}
+${type}_DEPENDS+= ${_GS_X11_PORT}>=${_GS_VERSION_MINOR}:${PORTSDIR}/print/${_GS_X11_PORT}
+.endif
+.endif
+.endfor
+
+.endif # _INCLUDE_USES_GHOSTSCRIPT_MK
Property changes on: trunk/Mk/extensions/ghostscript.mk
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list