Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171608324
D58860.id184757.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D58860.id184757.diff
View Options
diff --git a/misc/py-onnxruntime/Makefile b/misc/py-onnxruntime/Makefile
--- a/misc/py-onnxruntime/Makefile
+++ b/misc/py-onnxruntime/Makefile
@@ -1,7 +1,7 @@
PORTNAME= onnxruntime
DISTVERSIONPREFIX= v
DISTVERSION= 1.27.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= misc # machine-learning
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DIST_SUBDIR= ${PORTNAME}
@@ -27,9 +27,10 @@
USES= compiler:c++17-lang python
USE_PYTHON= pep517 autoplist concurrent
-# Build using the official build.py script; wheel is left in ${WRKDIR}/build/Release/dist.
+# Build using the official build.py script
PEP517_BUILD_DEPEND=
-PEP517_INSTALL_CMD= ${PYTHON_CMD} -m installer --destdir ${STAGEDIR} --prefix ${PREFIX} ${WRKDIR}/build/Release/dist/onnxruntime-${DISTVERSION}*.whl
+
+MAKE_ENV+= ORT_DIST_DIR=${WRKSRC}/dist
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
@@ -46,14 +47,6 @@
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF \
--cmake_extra_defines ONNXRUNTIME_NUMPY_INCLUDE_DIR=${PYTHONPREFIX_SITELIBDIR}/numpy/_core/include
-# The upstream wheel build does not include the native pybind extension, so
-# install it alongside the pure-Python files and add it to the autoplist.
-post-install:
- ${INSTALL_DATA} ${WRKDIR}/build/Release/onnxruntime/capi/onnxruntime_pybind11_state.so \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/onnxruntime/capi/
- @${ECHO_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/onnxruntime/capi/onnxruntime_pybind11_state.so \
- >> ${_PYTHONPKGLIST}
-
USE_GITHUB= yes
GH_ACCOUNT= microsoft
GH_TUPLE= emscripten-core:emsdk:0742117:emsdk/cmake/external/emsdk \
diff --git a/misc/py-onnxruntime/files/patch-setup.py b/misc/py-onnxruntime/files/patch-setup.py
new file mode 100644
--- /dev/null
+++ b/misc/py-onnxruntime/files/patch-setup.py
@@ -0,0 +1,15 @@
+--- setup.py.orig 2026-08-15 00:00:00 UTC
++++ setup.py
+@@ -434,6 +434,12 @@ elif platform.system() == "Darwin":
+ libs.extend(["libonnxruntime_providers_vitisai.dylib"])
+ if nightly_build:
+ libs.extend(["libonnxruntime_pywrapper.dylib"])
++elif platform.system() == "FreeBSD":
++ libs = [
++ "onnxruntime_pybind11_state.so",
++ "libonnxruntime_providers_shared.so",
++ "libonnxruntime.so*",
++ ]
+ else:
+ libs = [
+ "onnxruntime_pybind11_state.pyd",
diff --git a/misc/py-onnxruntime/files/patch-tools_ci__build_build.py b/misc/py-onnxruntime/files/patch-tools_ci__build_build.py
new file mode 100644
--- /dev/null
+++ b/misc/py-onnxruntime/files/patch-tools_ci__build_build.py
@@ -0,0 +1,11 @@
+--- tools/ci_build/build.py.orig 2026-08-15 00:00:00 UTC
++++ tools/ci_build/build.py
+@@ -1953,6 +1953,8 @@ def build_python_wheel(
+ cwd = os.path.join(cwd, config)
+
+ args = [sys.executable, os.path.join(source_dir, "setup.py"), "bdist_wheel"]
++ if os.environ.get("ORT_DIST_DIR"):
++ args.extend(["--dist-dir", os.environ["ORT_DIST_DIR"]])
+
+ # Any combination of the following arguments can be applied
+ if nightly_build:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 13, 3:19 AM (5 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38831250
Default Alt Text
D58860.id184757.diff (2 KB)
Attached To
Mode
D58860: misc/py-onnxruntime: Fix wheel missing the compiled pybind extension
Attached
Detach File
Event Timeline
Log In to Comment