Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/ghostscript.mk
Show All 28 Lines | |||||
# allowed versions | # allowed versions | ||||
# When adding a version, please keep the comment in | # When adding a version, please keep the comment in | ||||
# Mk/bsd.default-versions.mk in sync. | # Mk/bsd.default-versions.mk in sync. | ||||
_GS_VERSION= 7 8 9 agpl | _GS_VERSION= 7 8 9 agpl | ||||
_GS_ARGS= ${ghostscript_ARGS} | _GS_ARGS= ${ghostscript_ARGS} | ||||
.if ${_GS_ARGS:N[789]:Nagpl:Nx11:Nbuild:Nrun:Ntest} | . if ${_GS_ARGS:N[789]:Nagpl:Nx11:Nbuild:Nrun:Ntest} | ||||
IGNORE?= Unknown ghostscript argument ${_GS_ARGS} | IGNORE?= Unknown ghostscript argument ${_GS_ARGS} | ||||
.endif | . endif | ||||
.if ${GHOSTSCRIPT_DEFAULT:N[789]:Nagpl} | . if ${GHOSTSCRIPT_DEFAULT:N[789]:Nagpl} | ||||
IGNORE?= Invalid GHOSTSCRIPT_DEFAULT value: ${GHOSTSCRIPT_DEFAULT}, please select one of ${_GS_VERSION} | IGNORE?= Invalid GHOSTSCRIPT_DEFAULT value: ${GHOSTSCRIPT_DEFAULT}, please select one of ${_GS_VERSION} | ||||
.endif | . endif | ||||
# Make sure that no dependency or some other environment variable | # Make sure that no dependency or some other environment variable | ||||
# pollutes the build/run dependency detection | # pollutes the build/run dependency detection | ||||
.undef _GS_BUILD_DEP | .undef _GS_BUILD_DEP | ||||
.undef _GS_RUN_DEP | .undef _GS_RUN_DEP | ||||
.undef _GS_TEST_DEP | .undef _GS_TEST_DEP | ||||
.if ${_GS_ARGS:Mbuild} | . if ${_GS_ARGS:Mbuild} | ||||
_GS_BUILD_DEP= yes | _GS_BUILD_DEP= yes | ||||
.endif | . endif | ||||
.if ${_GS_ARGS:Mrun} | . if ${_GS_ARGS:Mrun} | ||||
_GS_RUN_DEP= yes | _GS_RUN_DEP= yes | ||||
.endif | . endif | ||||
.if ${_GS_ARGS:Mtest} | . if ${_GS_ARGS:Mtest} | ||||
_GS_TEST_DEP= yes | _GS_TEST_DEP= yes | ||||
.endif | . endif | ||||
# The port does not specify a build, run, or test dependency, assume that | # The port does not specify a build, run, or test dependency, assume that | ||||
# a build and run dependency is required. | # a build and run dependency is required. | ||||
.if !defined(_GS_BUILD_DEP) && !defined(_GS_RUN_DEP) && !defined(_GS_TEST_DEP) | . if !defined(_GS_BUILD_DEP) && !defined(_GS_RUN_DEP) && !defined(_GS_TEST_DEP) | ||||
_GS_BUILD_DEP= yes | _GS_BUILD_DEP= yes | ||||
_GS_RUN_DEP= yes | _GS_RUN_DEP= yes | ||||
.endif | . endif | ||||
.undef _GS_SELECTED | .undef _GS_SELECTED | ||||
.for V in ${_GS_ARGS} ${GHOSTSCRIPT_DEFAULT} | . for V in ${_GS_ARGS} ${GHOSTSCRIPT_DEFAULT} | ||||
_V=${V} | _V=${V} | ||||
.if ${_V:M9} | . if ${_V:M9} | ||||
_GS_SELECTED?= 9 | _GS_SELECTED?= 9 | ||||
.elif ${_V:Magpl} | . elif ${_V:Magpl} | ||||
_GS_SELECTED?= 9-agpl | _GS_SELECTED?= 9-agpl | ||||
.elif ${_V:M8} | . elif ${_V:M8} | ||||
_GS_SELECTED?= 8 | _GS_SELECTED?= 8 | ||||
.elif ${_V:M7} | . elif ${_V:M7} | ||||
_GS_SELECTED?= 7 | _GS_SELECTED?= 7 | ||||
.endif | . endif | ||||
.endfor | . endfor | ||||
# Resolve minor version number for X11.so library. | # Resolve minor version number for X11.so library. | ||||
.if !empty(_GS_SELECTED:M9-agpl) | . if !empty(_GS_SELECTED:M9-agpl) | ||||
_GS_VERSION_MINOR= 9.16_2 | _GS_VERSION_MINOR= 9.16_2 | ||||
.elif !empty(_GS_SELECTED:M9) | . elif !empty(_GS_SELECTED:M9) | ||||
_GS_VERSION_MINOR= 9.06_11 | _GS_VERSION_MINOR= 9.06_11 | ||||
.elif !empty(_GS_SELECTED:M8) | . elif !empty(_GS_SELECTED:M8) | ||||
_GS_VERSION_MINOR= 8.71_19 | _GS_VERSION_MINOR= 8.71_19 | ||||
.elif !empty(_GS_SELECTED:M7) | . elif !empty(_GS_SELECTED:M7) | ||||
_GS_VERSION_MINOR= 7.07_32 | _GS_VERSION_MINOR= 7.07_32 | ||||
.endif | . endif | ||||
# dependencies | # dependencies | ||||
_GS_PORT= ghostscript${_GS_SELECTED}-base | _GS_PORT= ghostscript${_GS_SELECTED}-base | ||||
_GS_X11_PORT= ghostscript${_GS_SELECTED}-x11 | _GS_X11_PORT= ghostscript${_GS_SELECTED}-x11 | ||||
.for type in BUILD RUN TEST | . for type in BUILD RUN TEST | ||||
.if defined(_GS_${type}_DEP) | . if defined(_GS_${type}_DEP) | ||||
${type}_DEPENDS+= ${_GS_PORT}>=${_GS_VERSION_MINOR}:print/${_GS_PORT} | ${type}_DEPENDS+= ${_GS_PORT}>=${_GS_VERSION_MINOR}:print/${_GS_PORT} | ||||
.if ${_GS_ARGS:Mx11} | . if ${_GS_ARGS:Mx11} | ||||
${type}_DEPENDS+= ${_GS_X11_PORT}>=${_GS_VERSION_MINOR}:print/${_GS_X11_PORT} | ${type}_DEPENDS+= ${_GS_X11_PORT}>=${_GS_VERSION_MINOR}:print/${_GS_X11_PORT} | ||||
.endif | . endif | ||||
.endif | . endif | ||||
.endfor | . endfor | ||||
.endif # _INCLUDE_USES_GHOSTSCRIPT_MK | .endif # _INCLUDE_USES_GHOSTSCRIPT_MK |