Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.port.mk
Show First 20 Lines • Show All 1,055 Lines • ▼ Show 20 Lines | |||||
SRC_BASE?= /usr/src | SRC_BASE?= /usr/src | ||||
USESDIR?= ${PORTSDIR}/Mk/Uses | USESDIR?= ${PORTSDIR}/Mk/Uses | ||||
SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts | SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts | ||||
LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib | LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib | ||||
STAGEDIR?= ${WRKDIR}/stage | STAGEDIR?= ${WRKDIR}/stage | ||||
NOTPHONY?= | NOTPHONY?= | ||||
FLAVORS?= | FLAVORS?= | ||||
FLAVOR?= | FLAVOR?= | ||||
# XXX: We have no real FLAVORS support in ports or tools yet. | PORTS_FEATURES+= FLAVORS | ||||
#PORTS_FEATURES+= FLAVORS | |||||
MINIMAL_PKG_VERSION= 1.6.0 | MINIMAL_PKG_VERSION= 1.6.0 | ||||
_PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \ | _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \ | ||||
${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} | ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} | ||||
# Ensure .CURDIR contains an absolute path without a trailing slash. Failed | # Ensure .CURDIR contains an absolute path without a trailing slash. Failed | ||||
# builds can occur when PORTSDIR is a symbolic link, or with something like | # builds can occur when PORTSDIR is a symbolic link, or with something like | ||||
# make -C /usr/ports/category/port/. | # make -C /usr/ports/category/port/. | ||||
.CURDIR:= ${.CURDIR:tA} | .CURDIR:= ${.CURDIR:tA} | ||||
# make sure bmake treats -V as expected | # make sure bmake treats -V as expected | ||||
.MAKE.EXPAND_VARIABLES= yes | .MAKE.EXPAND_VARIABLES= yes | ||||
.include "${PORTSDIR}/Mk/bsd.commands.mk" | .include "${PORTSDIR}/Mk/bsd.commands.mk" | ||||
.if !empty(FLAVOR) | |||||
. if empty(FLAVORS) | |||||
IGNORE= FLAVOR is defined while this port does not have FLAVORS. | |||||
. elif ! ${FLAVORS:M${FLAVOR}} | |||||
IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}. | |||||
. endif | |||||
.endif | |||||
.if !empty(FLAVORS) && empty(FLAVOR) | |||||
FLAVOR= ${FLAVORS:[1]} | |||||
.endif | |||||
# Do not leak flavors to childs make | # Do not leak flavors to childs make | ||||
.MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*} | .MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*} | ||||
.if defined(CROSS_TOOLCHAIN) | .if defined(CROSS_TOOLCHAIN) | ||||
.if !defined(CROSS_SYSROOT) | .if !defined(CROSS_SYSROOT) | ||||
IGNORE= CROSS_SYSROOT should be defined | IGNORE= CROSS_SYSROOT should be defined | ||||
.endif | .endif | ||||
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | ||||
▲ Show 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | |||||
.if !defined(${_f}_ARGS) | .if !defined(${_f}_ARGS) | ||||
${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g} | ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g} | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.for f in ${USES} | .for f in ${USES} | ||||
.include "${USESDIR}/${f:C/\:.*//}.mk" | .include "${USESDIR}/${f:C/\:.*//}.mk" | ||||
.endfor | .endfor | ||||
.if !empty(FLAVOR) | |||||
. if empty(FLAVORS) | |||||
mat: So, this works just fine on FreeBSD 11.x, but does not work at all on FreeBSD 10.3.
Any ideas… | |||||
IGNORE= FLAVOR is defined while this port does not have FLAVORS. | |||||
Done Inline ActionsPerfect, thanks! bdrewery: Perfect, thanks! | |||||
. elif ! ${FLAVORS:M${FLAVOR}} | |||||
IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}. | |||||
. endif | |||||
.endif | |||||
.if !empty(FLAVORS) && empty(FLAVOR) | |||||
FLAVOR= ${FLAVORS:[1]} | |||||
.endif | |||||
EXTRACT_SUFX?= .tar.gz | EXTRACT_SUFX?= .tar.gz | ||||
.if defined(USE_LINUX_PREFIX) | .if defined(USE_LINUX_PREFIX) | ||||
PREFIX= ${LINUXBASE} | PREFIX= ${LINUXBASE} | ||||
DATADIR?= ${PREFIX}/usr/share/${PORTNAME} | DATADIR?= ${PREFIX}/usr/share/${PORTNAME} | ||||
DOCSDIR?= ${PREFIX}/usr/share/doc/${PORTNAME}-${PORTVERSION} | DOCSDIR?= ${PREFIX}/usr/share/doc/${PORTNAME}-${PORTVERSION} | ||||
NO_LICENSES_INSTALL= yes | NO_LICENSES_INSTALL= yes | ||||
NO_MTREE= yes | NO_MTREE= yes | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
.endif # defined(TMPDIR) | .endif # defined(TMPDIR) | ||||
QA_ENV+= STAGEDIR=${STAGEDIR} \ | QA_ENV+= STAGEDIR=${STAGEDIR} \ | ||||
PREFIX=${PREFIX} \ | PREFIX=${PREFIX} \ | ||||
LINUXBASE=${LINUXBASE} \ | LINUXBASE=${LINUXBASE} \ | ||||
LOCALBASE=${LOCALBASE} \ | LOCALBASE=${LOCALBASE} \ | ||||
"STRIP=${STRIP}" \ | "STRIP=${STRIP}" \ | ||||
TMPPLIST=${TMPPLIST} \ | TMPPLIST=${TMPPLIST} \ | ||||
CURDIR='${.CURDIR}' \ | |||||
FLAVOR=${FLAVOR} \ | |||||
FLAVORS='${FLAVORS}' \ | |||||
BUNDLE_LIBS=${BUNDLE_LIBS} \ | BUNDLE_LIBS=${BUNDLE_LIBS} \ | ||||
LDCONFIG_DIR="${LDCONFIG_DIR}" \ | LDCONFIG_DIR="${LDCONFIG_DIR}" \ | ||||
PKGORIGIN=${PKGORIGIN} \ | PKGORIGIN=${PKGORIGIN} \ | ||||
LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \ | LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \ | ||||
UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \ | UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \ | ||||
PKGBASE=${PKGBASE} \ | PKGBASE=${PKGBASE} \ | ||||
PORTNAME=${PORTNAME} \ | PORTNAME=${PORTNAME} \ | ||||
NO_ARCH=${NO_ARCH} \ | NO_ARCH=${NO_ARCH} \ | ||||
▲ Show 20 Lines • Show All 2,740 Lines • ▼ Show 20 Lines | |||||
. endif | . endif | ||||
. if defined(BUILDING_INDEX) && defined(INDEX_PORTS) | . if defined(BUILDING_INDEX) && defined(INDEX_PORTS) | ||||
INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr | INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr | ||||
. else | . else | ||||
INDEX_OUT=/dev/stdout | INDEX_OUT=/dev/stdout | ||||
. endif | . endif | ||||
. if empty(FLAVORS) || defined(DESCRIBE_FLAVORED) | |||||
Not Done Inline ActionsIs DESCRIBE_FLAVORED intended to be DESCRIBE_FLAVORS here and below? The phrase "describe flavored" doesn't make sense to me :) bdrewery: Is DESCRIBE_FLAVORED intended to be DESCRIBE_FLAVORS here and below? The phrase "describe… | |||||
Not Done Inline ActionsIt may be frenglish :-) mat: It may be frenglish :-)
Maybe it should have been FLAVORED_DESCRIBE. | |||||
Not Done Inline Actionsmaybe DESCRIBED_FLAVOR ? bdrewery: maybe DESCRIBED_FLAVOR ? | |||||
describe: | describe: | ||||
@(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \ | @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \ | ||||
${ECHO_CMD} -n ${COMMENT:Q}; \ | ${ECHO_CMD} -n ${COMMENT:Q}; \ | ||||
${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \ | ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \ | ||||
while read one two discard; do \ | while read one two discard; do \ | ||||
case "$$one" in \ | case "$$one" in \ | ||||
WWW:) case "$$two" in \ | WWW:) case "$$two" in \ | ||||
https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \ | https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \ | ||||
*) ${ECHO_CMD} -n "http://$$two" ;; \ | *) ${ECHO_CMD} -n "http://$$two" ;; \ | ||||
esac; \ | esac; \ | ||||
break; \ | break; \ | ||||
;; \ | ;; \ | ||||
esac; \ | esac; \ | ||||
done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT} | done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT} | ||||
. else # empty(FLAVORS) | |||||
describe: ${FLAVORS:S/^/describe-/} | |||||
. for f in ${FLAVORS} | |||||
describe-${f}: | |||||
@cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -DDESCRIBE_FLAVORED describe | |||||
Not Done Inline ActionsPass FLAVOR as a make argument please bdrewery: Pass FLAVOR as a make argument please | |||||
Not Done Inline ActionsIt is passed as a make argument, is it not ? mat: It is passed as a make argument, is it not ? | |||||
Not Done Inline Actionsoops bdrewery: oops | |||||
. endfor | |||||
. endif # empty(FLAVORS) | |||||
. endif | . endif | ||||
www-site: | www-site: | ||||
.if exists(${DESCR}) | .if exists(${DESCR}) | ||||
@${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1 | @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1 | ||||
.else | .else | ||||
@${ECHO_CMD} | @${ECHO_CMD} | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | |||||
.if !target(stage-qa) | .if !target(stage-qa) | ||||
stage-qa: | stage-qa: | ||||
@${ECHO_MSG} "====> Running Q/A tests (stage-qa)" | @${ECHO_MSG} "====> Running Q/A tests (stage-qa)" | ||||
@${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh | @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh | ||||
.if !defined(DEVELOPER) | .if !defined(DEVELOPER) | ||||
@${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\" | @${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\" | ||||
.endif | .endif | ||||
.endif | |||||
pretty-flavors-package-names: | |||||
Not Done Inline Actions.PHONY bdrewery: .PHONY | |||||
Not Done Inline ActionsI guess many many targets are missing .PHONY here, no ? mat: I guess many many targets are missing .PHONY here, no ? | |||||
.if empty(FLAVORS) | |||||
@${ECHO_CMD} "no flavor: ${PKGNAME}" | |||||
.else | |||||
.for f in ${FLAVORS} | |||||
@${ECHO_CMD} -n "${f}: " | |||||
@cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -V PKGNAME | |||||
Not Done Inline ActionsPass FLAVOR as a make argument please bdrewery: Pass FLAVOR as a make argument please
| |||||
Not Done Inline ActionsIt is a make argument, isn't it ? mat: It is a make argument, isn't it ? | |||||
.endfor | |||||
.endif | |||||
flavors-package-names: | |||||
Not Done Inline Actions.PHONY bdrewery: .PHONY | |||||
.if empty(FLAVORS) | |||||
@${ECHO_CMD} "${PKGNAME}" | |||||
.else | |||||
.for f in ${FLAVORS} | |||||
@cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -V PKGNAME | |||||
Not Done Inline ActionsPass FLAVOR as a make argument please bdrewery: Pass FLAVOR as a make argument please
| |||||
Not Done Inline Actionsit is, no ? mat: it is, no ? | |||||
.endfor | |||||
.endif | .endif | ||||
# Fake installation of package so that user can pkg delete it later. | # Fake installation of package so that user can pkg delete it later. | ||||
.if !target(fake-pkg) | .if !target(fake-pkg) | ||||
STAGE_ARGS= -i ${STAGEDIR} | STAGE_ARGS= -i ${STAGEDIR} | ||||
.if !defined(NO_PKG_REGISTER) | .if !defined(NO_PKG_REGISTER) | ||||
fake-pkg: create-manifest | fake-pkg: create-manifest | ||||
▲ Show 20 Lines • Show All 835 Lines • Show Last 20 Lines |
So, this works just fine on FreeBSD 11.x, but does not work at all on FreeBSD 10.3.
Any ideas on how I can make this work ?