tcl.port.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # $OpenBSD: tcl.port.mk,v 1.16 2013/11/17 11:08:03 zhuk Exp $
  2. CATEGORIES += lang/tcl
  3. MODTCL_VERSION ?= 8.5
  4. .if ${MODTCL_VERSION} == 8.4
  5. _MODTCL_SPEC = tcl->=${MODTCL_VERSION},<8.5
  6. MODTCL_LIB ?= tcl84
  7. .elif ${MODTCL_VERSION} == 8.5
  8. _MODTCL_SPEC = tcl->=${MODTCL_VERSION},<8.6
  9. MODTCL_LIB ?= tcl85
  10. .elif ${MODTCL_VERSION} == 8.6
  11. _MODTCL_SPEC = tcl->=${MODTCL_VERSION},<8.7
  12. MODTCL_LIB ?= tcl86
  13. .endif
  14. MODTCL_BIN ?= ${LOCALBASE}/bin/tclsh${MODTCL_VERSION}
  15. MODTCL_INCDIR ?= ${LOCALBASE}/include/tcl${MODTCL_VERSION}
  16. MODTCL_TCLDIR ?= ${LOCALBASE}/lib/tcl
  17. MODTCL_MODDIR ?= ${LOCALBASE}/lib/tcl/modules
  18. MODTCL_LIBDIR ?= ${MODTCL_TCLDIR}/tcl${MODTCL_VERSION}
  19. MODTCL_CONFIG ?= ${MODTCL_LIBDIR}/tclConfig.sh
  20. MODTCL_BUILD_DEPENDS ?= ${_MODTCL_SPEC}:lang/tcl/${MODTCL_VERSION}
  21. MODTCL_RUN_DEPENDS ?= ${_MODTCL_SPEC}:lang/tcl/${MODTCL_VERSION}
  22. MODTCL_LIB_DEPENDS ?= ${_MODTCL_SPEC}:lang/tcl/${MODTCL_VERSION}
  23. MODTCL_WANTLIB ?= ${MODTCL_LIB}
  24. # Handle the two most commonly used methods
  25. # for starting up executable Tcl scripts.
  26. # See http://wiki.tcl.tk/812 for more information.
  27. # Set 'tclsh' for executable scripts (in-place modification).
  28. # Do not convert (tcl|wi)sh to (tclsh|wish), or the MODTCL_WISH_ADJ
  29. # macro below will be broken.
  30. MODTCL_TCLSH_ADJ = perl -pi \
  31. -e '$$. == 1 && s!/\S*(?:/env\s+|bin/)(?:tcl|wi)sh\S*(\s+.+)?$$!${MODTCL_BIN}$$1!;' \
  32. -e '$$. >= 3 && $$. <= 30 && s!exec\s+(?:tcl|wi)sh.*$$!exec ${MODTCL_BIN} "\$$0" \$${1+"\$$@"}!;' \
  33. -e 'close ARGV if eof;'
  34. # Same for 'wish'.
  35. MODTCL_WISH_ADJ = ${MODTCL_TCLSH_ADJ:S/tclsh/wish/}
  36. SUBST_VARS += MODTCL_VERSION MODTCL_BIN