git: 57d4f61d2009 - main - science/py-tensorflow: Fix build
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 13 Sep 2026 19:47:31 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=57d4f61d20096849b602042ad3ce6432c5d4afbb
commit 57d4f61d20096849b602042ad3ce6432c5d4afbb
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-09-13 19:46:28 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-09-13 19:47:28 +0000
science/py-tensorflow: Fix build
It was broken since with the last update of jsoncpp
its headers were pushed into include/jsoncpp.
Reported by: fallout
---
science/py-tensorflow/Makefile | 14 +++++++++-----
science/py-tensorflow/distinfo | 1 -
science/py-tensorflow/files/bazelrc | 2 ++
.../py-tensorflow/files/freebsd/cc_toolchain_config.bzl | 11 ++++++++++-
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/science/py-tensorflow/Makefile b/science/py-tensorflow/Makefile
index de96a9bf5e95..75f50bb479a8 100644
--- a/science/py-tensorflow/Makefile
+++ b/science/py-tensorflow/Makefile
@@ -239,7 +239,7 @@ do-configure:
TF_DOWNLOAD_CLANG=0 \
TF_NEED_NCCL=0 \
TF_IGNORE_MAX_BAZEL_VERSION=1 \
- CC_OPT_FLAGS="${CPU_FLAG}=${CPU_TARGET} -I${LOCALBASE}/include" \
+ CC_OPT_FLAGS="${CPU_FLAG}=${CPU_TARGET} -I${LOCALBASE}/include -I${LOCALBASE}/include/jsoncpp" \
PREFIX="${LOCALBASE}" \
TF_SYSTEM_LIBS="astor_archive astunparse_archive boringssl com_github_googlecloudplatform_google_cloud_cpp \
com_googlesource_code_re2 curl cython dill_archive functools32_archive gast_archive \
@@ -287,8 +287,10 @@ do-build:
${ECHO_MSG} "WARNING: llvm config.bzl not found at $${LLVMCONF}; build may fail"; \
fi
@cd ${WRKSRC} && \
- bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} ${BAZEL_ARCH_DEFINES} --host_copt="-I${LOCALBASE}/include" \
- --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} --copt="-I${LOCALBASE}/include" \
+ bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} ${BAZEL_ARCH_DEFINES} \
+ --host_copt="-I${LOCALBASE}/include" --host_copt="-I${LOCALBASE}/include/jsoncpp" \
+ --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} \
+ --copt="-I${LOCALBASE}/include" --copt="-I${LOCALBASE}/include/jsoncpp" \
--verbose_failures -s \
--distdir=${WRKDIR}/bazel-dist \
//tensorflow/tools/pip_package:wheel
@@ -309,8 +311,10 @@ post-install: # autoplist: thousands of files, all under ${PYTHON_SITELIBDIR}
do-test:
@cd ${WRKSRC} && \
bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} test \
- --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \
- --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} --copt="-I${LOCALBASE}/include" \
+ --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} \
+ --host_copt="-I${LOCALBASE}/include" --host_copt="-I${LOCALBASE}/include/jsoncpp" \
+ --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} \
+ --copt="-I${LOCALBASE}/include" --copt="-I${LOCALBASE}/include/jsoncpp" \
--verbose_failures \
--distdir=${WRKDIR}/bazel-dist \
--test_output=errors \
diff --git a/science/py-tensorflow/distinfo b/science/py-tensorflow/distinfo
index 7c068e226d83..ee1e9d744651 100644
--- a/science/py-tensorflow/distinfo
+++ b/science/py-tensorflow/distinfo
@@ -147,7 +147,6 @@ SHA256 (tensorflow/libtinfo.so.5) = 12cffc7274190ca1693a52ccd8303e719407e707c855
SIZE (tensorflow/libtinfo.so.5) = 170784
SHA256 (tensorflow/copyright.txt) = 5e8ee902c8906ddb7779fd36dc9979cb08b51fbebf7c0b1a9aeb78af382af590
SIZE (tensorflow/copyright.txt) = 6366
-
SHA256 (tensorflow/v1.74.0.tar.gz) = dd6a2fa311ba8441bbefd2764c55b99136ff10f7ea42954be96006a2723d33fc
SIZE (tensorflow/v1.74.0.tar.gz) = 15014902
SHA256 (tensorflow/28e9d1f26771c6517c3b4be10254887673c940189.zip) = f253ca1a07262f8efde8328e4b2c68979e40ddfcfc001f70d1d5f612c7de2974
diff --git a/science/py-tensorflow/files/bazelrc b/science/py-tensorflow/files/bazelrc
index eead349e0876..8684ff8319a4 100644
--- a/science/py-tensorflow/files/bazelrc
+++ b/science/py-tensorflow/files/bazelrc
@@ -67,11 +67,13 @@ build --host_linkopt=-lhwloc
build --host_copt=-D_XOPEN_SOURCE=700
build --host_copt=-D__BSD_VISIBLE=1
build --host_copt=-isystem%%LOCALBASE%%/include
+build --host_copt=-isystem%%LOCALBASE%%/include/jsoncpp
build --host_copt=-isystem%%PYTHON_INCLUDEDIR%%
build --host_copt=-isystem%%NUMPY_INCLUDEDIR%%
build --copt=-D_XOPEN_SOURCE=700
build --copt=-D__BSD_VISIBLE=1
build --copt=-isystem%%LOCALBASE%%/include
+build --copt=-isystem%%LOCALBASE%%/include/jsoncpp
build --copt=-isystem%%PYTHON_INCLUDEDIR%%
build --copt=-isystem%%NUMPY_INCLUDEDIR%%
diff --git a/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl b/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl
index f4cf8ca8cfb8..aa0d2ec7f973 100644
--- a/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl
+++ b/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl
@@ -226,7 +226,16 @@ def _impl(ctx):
else:
features = [supports_dynamic_linker_feature, supports_pic_feature]
if (is_bsd):
- cxx_builtin_include_directories = ["/usr/lib/clang", "/usr/include/c++/v1", "/usr/local/include", "/usr/include", "%%NUMPY_INCLUDEDIR%%"]
+ cxx_builtin_include_directories = [
+ "/usr/lib/clang",
+ "/usr/include/c++/v1",
+ "%%LOCALBASE%%/include",
+ "%%LOCALBASE%%/include/jsoncpp",
+ "/usr/local/include",
+ "/usr/local/include/jsoncpp",
+ "/usr/include",
+ "%%NUMPY_INCLUDEDIR%%",
+ ]
else:
cxx_builtin_include_directories = []
if is_bsd: