Changeset View
Standalone View
Mk/bsd.port.mk
Show First 20 Lines • Show All 1,964 Lines • ▼ Show 20 Lines | |||||
DO_NADA?= ${TRUE} | DO_NADA?= ${TRUE} | ||||
# Use this as the first operand to always build dependency. | # Use this as the first operand to always build dependency. | ||||
NONEXISTENT?= /nonexistent | NONEXISTENT?= /nonexistent | ||||
CHECKSUM_ALGORITHMS?= sha256 | CHECKSUM_ALGORITHMS?= sha256 | ||||
DISTINFO_FILE?= ${MASTERDIR}/distinfo | DISTINFO_FILE?= ${MASTERDIR}/distinfo | ||||
TIMESTAMP= 1449231300 | |||||
emaste: 1449231300 is Fri 4 Dec 2015 12:15:00 UTC
Presumably will update if/when ready to commit. | |||||
Not Done Inline ActionsWe should also explain why there is a default value for TIMESTAMP in a comment, since the value seems strangely arbitrary. (I mean, it is arbitrary, but reasonably so.) emaste: We should also explain why there is a default value for `TIMESTAMP` in a comment, since the… | |||||
.if exists(${DISTINFO_FILE}) | |||||
TIMESTAMP!= ${AWK} -F= -v ts=${TIMESTAMP} '/^timestamp/ { ts=$$2 } END { print ts}' ${DISTINFO_FILE} | |||||
.endif | |||||
Not Done Inline ActionsThis will hurt dependency calculation for Poudriere. Please wrap in something like this to prevent running on depends targets and -V, unless looking at -V TIMESTAMP .if !make(*depends*) && empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*TIMESTAMP) bdrewery: This will hurt dependency calculation for Poudriere. Please wrap in something like this to… | |||||
Not Done Inline ActionsNo *, just :MTIMESTAMP bdrewery: No *, just :MTIMESTAMP | |||||
Not Done Inline ActionsWhat about: .if !make(*depends*) && empty(.MAKEFLAGS:M-V) && \ empty(.MAKEFLAGS:MTIMESTAMP) && exists(${DISTINFO_FILE}) TIMESTAMP!= ${AWK} -F' = ' -v ts=${TIMESTAMP} '/^TIMESTAMP/ { ts=$$2 } END { print ts}' ${DISTINFO_FILE} .endif emaste: What about:
```
.if !make(*depends*) && empty(.MAKEFLAGS:M-V) && \
empty(.MAKEFLAGS… | |||||
Not Done Inline ActionsThis is probably OK but can we just whitelist the target it is needed in instead? make package? bdrewery: This is probably OK but can we just whitelist the target it is needed in instead? `make… | |||||
Not Done Inline ActionsSome ports may wish to use it for the build (via SOURCE_DATE_EPOCH=` in the environment or similar approaches) emaste: Some ports may wish to use it for the build (via SOURCE_DATE_EPOCH=` in the environment or… | |||||
MAKE_FLAGS?= -f | MAKE_FLAGS?= -f | ||||
MAKEFILE?= Makefile | MAKEFILE?= Makefile | ||||
MAKE_CMD?= ${BSDMAKE} | MAKE_CMD?= ${BSDMAKE} | ||||
MAKE_ENV+= PREFIX=${PREFIX} \ | MAKE_ENV+= PREFIX=${PREFIX} \ | ||||
LOCALBASE=${LOCALBASE} \ | LOCALBASE=${LOCALBASE} \ | ||||
LIBDIR="${LIBDIR}" \ | LIBDIR="${LIBDIR}" \ | ||||
CC="${CC}" CFLAGS="${CFLAGS}" \ | CC="${CC}" CFLAGS="${CFLAGS}" \ | ||||
CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \ | CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \ | ||||
LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \ | LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \ | ||||
CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ | CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ | ||||
MANPREFIX="${MANPREFIX}" | MANPREFIX="${MANPREFIX}" \ | ||||
SOURCE_DATE_EPOCH=${TIMESTAMP} | |||||
PKG_ENV+= SOURCE_DATE_EPOCH=${TIMESTAMP} | |||||
Not Done Inline ActionsWhy the guard on USES=python? mat: Why the guard on `USES=python`? | |||||
Not Done Inline ActionsSee @antoine's comment above,
We have to somehow address python ports for reproducible builds but I hope we can apply to everything else at first at least. emaste: See @antoine's comment above,
> This causes problem with at least all python ports:
We have to… | |||||
# Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher. | # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher. | ||||
# gcc 4.x enable strict aliasing optimization with -O2 which is known to break | # gcc 4.x enable strict aliasing optimization with -O2 which is known to break | ||||
# a lot of ports. | # a lot of ports. | ||||
.if !defined(WITHOUT_NO_STRICT_ALIASING) | .if !defined(WITHOUT_NO_STRICT_ALIASING) | ||||
.if ${CC} != "icc" | .if ${CC} != "icc" | ||||
.if empty(CFLAGS:M-fno-strict-aliasing) | .if empty(CFLAGS:M-fno-strict-aliasing) | ||||
CFLAGS+= -fno-strict-aliasing | CFLAGS+= -fno-strict-aliasing | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | |||||
.if !defined(CONFIGURE_MAX_CMD_LEN) | .if !defined(CONFIGURE_MAX_CMD_LEN) | ||||
CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax | CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax | ||||
.endif | .endif | ||||
_EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN | _EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN | ||||
GNU_CONFIGURE_PREFIX?= ${PREFIX} | GNU_CONFIGURE_PREFIX?= ${PREFIX} | ||||
GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX} | GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX} | ||||
CONFIG_SITE?= ${PORTSDIR}/Templates/config.site | CONFIG_SITE?= ${PORTSDIR}/Templates/config.site | ||||
CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS} | CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS} | ||||
.if defined(X_BUILD_FOR) | .if defined(X_BUILD_FOR) || defined(CROSS_BUILD) | ||||
CONFIGURE_ARGS+= --host=${X_BUILD_FOR} | CONFIGURE_ARGS+= --host=${CROSS_BUILD:UX_BUILD_FOR} | ||||
.endif | .endif | ||||
CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN} | CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN} | ||||
HAS_CONFIGURE= yes | HAS_CONFIGURE= yes | ||||
SET_LATE_CONFIGURE_ARGS= \ | SET_LATE_CONFIGURE_ARGS= \ | ||||
_LATE_CONFIGURE_ARGS="" ; \ | _LATE_CONFIGURE_ARGS="" ; \ | ||||
if [ -z "${CONFIGURE_ARGS:M--localstatedir=*:Q}" ] && \ | if [ -z "${CONFIGURE_ARGS:M--localstatedir=*:Q}" ] && \ | ||||
./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- --localstatedir > /dev/null; then \ | ./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- --localstatedir > /dev/null; then \ | ||||
▲ Show 20 Lines • Show All 1,569 Lines • ▼ Show 20 Lines | |||||
checksum_init=\ | checksum_init=\ | ||||
SHA256=${SHA256}; | SHA256=${SHA256}; | ||||
.if !target(makesum) | .if !target(makesum) | ||||
makesum: check-checksum-algorithms | makesum: check-checksum-algorithms | ||||
@cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \ | @cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \ | ||||
DISABLE_SIZE=yes | DISABLE_SIZE=yes | ||||
@if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi | @if [ -f ${DISTINFO_FILE} ]; then \ | ||||
if ${GREP} -q "^timestamp" ${DISTINFO_FILE}; then \ | |||||
${GREP} -v "^timestamp" ${DISTINFO_FILE} > ${DISTINFO_FILE}.sav; \ | |||||
fi ; \ | |||||
fi | |||||
@( \ | @( \ | ||||
cd ${DISTDIR}; \ | cd ${DISTDIR}; \ | ||||
\ | \ | ||||
${checksum_init} \ | ${checksum_init} \ | ||||
\ | \ | ||||
for file in ${_CKSUMFILES}; do \ | for file in ${_CKSUMFILES}; do \ | ||||
for alg in ${CHECKSUM_ALGORITHMS:tu}; do \ | for alg in ${CHECKSUM_ALGORITHMS:tu}; do \ | ||||
eval alg_executable=\$$$$alg; \ | eval alg_executable=\$$$$alg; \ | ||||
\ | \ | ||||
if [ $$alg_executable != "NO" ]; then \ | if [ $$alg_executable != "NO" ]; then \ | ||||
$$alg_executable $$file >> ${DISTINFO_FILE}; \ | $$alg_executable $$file >> ${DISTINFO_FILE}.new; \ | ||||
fi; \ | fi; \ | ||||
done; \ | done; \ | ||||
${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \ | ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}.new; \ | ||||
done \ | done ; \ | ||||
if [ ! -f ${DISTINFO_FILE}.sav ] || ! cmp -s ${DISTINFO_FILE}.sav ${DISTINFO_FILE}.new ; then \ | |||||
${ECHO_CMD} "timestamp=`date '+%s'`" > ${DISTINFO_FILE} ; \ | |||||
Not Done Inline ActionsMaybe TIMESTAMP = ##### for consistency with other lines in the file? emaste: Maybe `TIMESTAMP = #####` for consistency with other lines in the file?
| |||||
${CAT} ${DISTINFO_FILE}.new >> ${DISTINFO_FILE} ; \ | |||||
fi ; \ | |||||
rm ${DISTINFO_FILE}.new ; \ | |||||
if [ -f ${DISTINFO_FILE}.sav ]; then \ | |||||
${RM} ${DISTINFO_FILE}.sav ; \ | |||||
Not Done Inline Actionsjust rm -f rather than testing first? emaste: just `rm -f` rather than testing first? | |||||
fi; \ | |||||
) | ) | ||||
.endif | .endif | ||||
.if !target(checksum) | .if !target(checksum) | ||||
checksum: fetch check-checksum-algorithms | checksum: fetch check-checksum-algorithms | ||||
@set -e ; \ | @set -e ; \ | ||||
${checksum_init} \ | ${checksum_init} \ | ||||
if [ -f ${DISTINFO_FILE} ]; then \ | if [ -f ${DISTINFO_FILE} ]; then \ | ||||
▲ Show 20 Lines • Show All 1,614 Lines • Show Last 20 Lines |
1449231300 is Fri 4 Dec 2015 12:15:00 UTC
Presumably will update if/when ready to commit.