Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 2026 16:33:31 +0000
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 2a67e706adec - main - misc/py-paddlepaddle: fix build on non-amd64
Message-ID:  <6a43efdb.3f9ac.bdebb6e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2a67e706adecb702bd9ddab06a51218d56f63dcf

commit 2a67e706adecb702bd9ddab06a51218d56f63dcf
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-06-30 05:22:43 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-06-30 16:33:18 +0000

    misc/py-paddlepaddle: fix build on non-amd64
    
    1. powerpc64le needs -DNO_WARN_X86_INTRINSICS for x86 headers inclusion.
    2. powerpc* need glog patch, same as the one in ports.
    3. pkg-plist hardcodes filename for 15.1-STABLE on amd64, use a hack
    for that.
---
 misc/py-paddlepaddle/Makefile                                 |  9 ++++++++-
 .../patch-third__party_glog_src_stacktrace__powerpc-inl.h     | 11 +++++++++++
 misc/py-paddlepaddle/pkg-plist                                |  2 +-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/misc/py-paddlepaddle/Makefile b/misc/py-paddlepaddle/Makefile
index 2f1fa3246ff9..a172912e74a5 100644
--- a/misc/py-paddlepaddle/Makefile
+++ b/misc/py-paddlepaddle/Makefile
@@ -39,7 +39,8 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}httpx>=0:www/py-httpx@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pillow>=0:graphics/py-pillow@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}protobuf>=3.20.2:devel/py-protobuf@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}safetensors>=0.6.0:misc/py-safetensors@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}typing-extensions>=0:devel/py-typing-extensions@${PY_FLAVOR}
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=0:devel/py-typing-extensions@${PY_FLAVOR} \
+		gfortran${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT}
 
 USES=		cmake llvm:21 python
 USE_PYTHON=	autoplist
@@ -112,6 +113,12 @@ DO_MAKE_BUILD=	${SETENVI} ${WRK_ENV} ${MAKE_ENV:NDESTDIR=*} ${MAKE_CMD} ${MAKE_F
 # which triggers -Winvalid-specialization as an error. Suppress globally.
 CXXFLAGS+=	-Wno-invalid-specialization
 
+CFLAGS_powerpc64le=	-DNO_WARN_X86_INTRINSICS
+CXXFLAGS_powerpc64le=	-DNO_WARN_X86_INTRINSICS
+
+WHEEL_TAG=	${:!uname -rm | sed -e 's/[.-]/_/g' -e 's/ /_/g' -e 's/^/freebsd_/' | tr '[:upper:]' '[:lower:]'!}
+PLIST_SUB+=	WHEEL_TAG=${WHEEL_TAG}
+
 #MAKE_JOBS_UNSAFE= 	yes
 
 # The cmake build generates CMakeLists.txt files in the source tree (at configure
diff --git a/misc/py-paddlepaddle/files/patch-third__party_glog_src_stacktrace__powerpc-inl.h b/misc/py-paddlepaddle/files/patch-third__party_glog_src_stacktrace__powerpc-inl.h
new file mode 100644
index 000000000000..433a0c536c93
--- /dev/null
+++ b/misc/py-paddlepaddle/files/patch-third__party_glog_src_stacktrace__powerpc-inl.h
@@ -0,0 +1,11 @@
+--- third_party/glog/src/stacktrace_powerpc-inl.h.orig	2026-06-20 03:41:08 UTC
++++ third_party/glog/src/stacktrace_powerpc-inl.h
+@@ -117,6 +117,8 @@
+ #elif defined(__linux)
+       // This check is in case the compiler doesn't define _CALL_SYSV.
+       result[n++] = *(sp+1);
++#elif defined(_CALL_ELF)
++      result[n++] = *(sp+2);
+ #else
+ #error Need to specify the PPC ABI for your archiecture.
+ #endif
diff --git a/misc/py-paddlepaddle/pkg-plist b/misc/py-paddlepaddle/pkg-plist
index bac6c5e79c0e..49c5e6313a8b 100644
--- a/misc/py-paddlepaddle/pkg-plist
+++ b/misc/py-paddlepaddle/pkg-plist
@@ -4620,4 +4620,4 @@ bin/paddle
 %%PYTHON_SITELIBDIR%%/paddlepaddle-3.3.0.dev0-py%%PYTHON_VER%%.egg-info/entry_points.txt
 %%PYTHON_SITELIBDIR%%/paddlepaddle-3.3.0.dev0-py%%PYTHON_VER%%.egg-info/requires.txt
 %%PYTHON_SITELIBDIR%%/paddlepaddle-3.3.0.dev0-py%%PYTHON_VER%%.egg-info/top_level.txt
-opt/paddle/share/wheels/paddlepaddle-3.3.0.dev0-cp%%PYTHON_SUFFIX%%-cp%%PYTHON_SUFFIX%%-freebsd_15_1_stable_amd64.whl
+opt/paddle/share/wheels/paddlepaddle-3.3.0.dev0-cp%%PYTHON_SUFFIX%%-cp%%PYTHON_SUFFIX%%-%%WHEEL_TAG%%.whl


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a43efdb.3f9ac.bdebb6e>