Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/cabal.mk
Show All 22 Lines | |||||
# | # | ||||
# opt_USE_CABAL Variant of USE_CABAL to be used with options framework. | # opt_USE_CABAL Variant of USE_CABAL to be used with options framework. | ||||
# opt_CABAL_FLAGS Variant of CABAL_FLAGS to be used with options framework. | # opt_CABAL_FLAGS Variant of CABAL_FLAGS to be used with options framework. | ||||
# Note that it works a bit differently from CABAL_FLAGS: | # Note that it works a bit differently from CABAL_FLAGS: | ||||
# it appends "${opt_CABAL_FLAGS}" when the option is enabled | # it appends "${opt_CABAL_FLAGS}" when the option is enabled | ||||
# and "-${opt_CABAL_FLAGS}" otherwise. | # and "-${opt_CABAL_FLAGS}" otherwise. | ||||
# opt_EXECUTABLES Variant of EXECUTABLES to be used with options framework. | # opt_EXECUTABLES Variant of EXECUTABLES to be used with options framework. | ||||
# | # | ||||
# FOO_DATADIR_VARS Additional environment vars to add to FOO executable's | |||||
# wrapper script. | |||||
# | |||||
# MAINTAINER: haskell@FreeBSD.org | # MAINTAINER: haskell@FreeBSD.org | ||||
.if !defined(_INCLUDE_USES_CABAL_MK) | .if !defined(_INCLUDE_USES_CABAL_MK) | ||||
_INCLUDE_USES_CABAL_MK= yes | _INCLUDE_USES_CABAL_MK= yes | ||||
.if !empty(cabal_ARGS) | .if !empty(cabal_ARGS) | ||||
IGNORE= Incorrect 'USES= cabal:${cabal_ARGS}' cabal takes no arguments | IGNORE= Incorrect 'USES= cabal:${cabal_ARGS}' cabal takes no arguments | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
. if !target(do-build) | . if !target(do-build) | ||||
do-build: | do-build: | ||||
cd ${WRKSRC} && \ | cd ${WRKSRC} && \ | ||||
${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} cabal new-build --offline --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} | ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} cabal new-build --offline --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} | ||||
. endif | . endif | ||||
. if !target(do-install) | . if !target(do-install) | ||||
do-install: | do-install: | ||||
${MKDIR} ${STAGEDIR}${PREFIX}/libexec/cabal | |||||
. for exe in ${EXECUTABLES} | . for exe in ${EXECUTABLES} | ||||
${INSTALL_PROGRAM} \ | ${INSTALL_PROGRAM} \ | ||||
$$(find ${WRKSRC}/dist-newstyle -name ${exe} -type f -perm +111) \ | $$(find ${WRKSRC}/dist-newstyle -name ${exe} -type f -perm +111) \ | ||||
${STAGEDIR}${PREFIX}/bin | ${STAGEDIR}${PREFIX}/libexec/cabal/${exe} | ||||
${ECHO} '#!/bin/sh' > ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
${ECHO} '' >> ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
${ECHO} 'export ${exe:S/-/_/}_datadir=${DATADIR}' >> ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
. for dep in ${${exe}_DATADIR_VARS} | |||||
${ECHO} 'export ${dep:S/-/_/}_datadir=${DATADIR}' >> ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
. endfor | . endfor | ||||
${ECHO} '' >> ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
${ECHO} '${PREFIX}/libexec/cabal/${exe} $$*' >> ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/${exe} | |||||
. endfor | |||||
. endif | . endif | ||||
. if !defined(SKIP_CABAL_PLIST) | . if !defined(SKIP_CABAL_PLIST) | ||||
cabal-post-install-script: | cabal-post-install-script: | ||||
. for exe in ${EXECUTABLES} | . for exe in ${EXECUTABLES} | ||||
${ECHO_CMD} 'bin/${exe}' >> ${TMPPLIST} | ${ECHO_CMD} 'bin/${exe}' >> ${TMPPLIST} | ||||
${ECHO_CMD} 'libexec/cabal/${exe}' >> ${TMPPLIST} | |||||
. endfor | . endfor | ||||
. endif | . endif | ||||
. endif # !defined(CABAL_BOOTSTRAP) | . endif # !defined(CABAL_BOOTSTRAP) | ||||
.endif | .endif |