--- Makefile.orig 2021-07-09 11:41:34.859561000 +0100 +++ Makefile 2021-07-09 14:09:29.818251000 +0100 @@ -61,12 +61,16 @@ PLIST_SUB= TF_PORT_VERSION=${PORTVERSION} -OPTIONS_DEFINE= CPU_OPTS +OPTIONS_DEFINE= CPU_OPTS PARALLEL_JOBS CPU_OPTS_DESC= Enable optimisations using features available on your CPU CPU_OPTS_VARS= CPU_TARGET=native BAZEL_COPT="-c opt --copt=-march=native --copt=-mfpmath=sse" CPU_OPTS_VARS_OFF= CPU_TARGET=x86-64 +PARALLEL_JOBS_DESC= Enable parallel building +PARALLEL_JOBS_VARS= BAZEL_JOBS="--jobs $$(sysctl -n hw.ncpu)" +PARALLEL_JOBS_VARS_OFF= BAZEL_JOBS="--jobs 1" + .include "Makefile.MASTER_SITES" post-patch: @@ -134,7 +138,7 @@ do-build: @cd ${WRKSRC} && \ - bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build --jobs 16 ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \ + bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build ${BAZEL_JOBS} ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \ --host_linkopt="-L${LOCALBASE}/lib" --linkopt="-L${LOCALBASE}/lib" --config=c++17 --copt="-I${LOCALBASE}/include" \ --cxxopt="--std=c++1z" --verbose_failures -s \ --distdir=${WORKDIR}/bazel-dist \