Fix recipe for py-onnx-runtime (#34130)

* Fix recipe

* Update package.py

* Update recipe following review

* Update var/spack/repos/builtin/packages/py-onnx-runtime/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* remove unused imports

* Update package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
iarspider 2022-11-30 16:17:22 +01:00 committed by GitHub
parent 7423f52cd3
commit 5d3efbba14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ class PyOnnxRuntime(CMakePackage, PythonExtension):
depends_on("cmake@3.1:", type="build")
depends_on("ninja", type="build")
depends_on("python", type=("build", "run"))
depends_on("py-pip", type="build")
depends_on("protobuf")
# https://github.com/microsoft/onnxruntime/pull/11639
depends_on("protobuf@:3.19", when="@:1.11")
@ -54,8 +55,9 @@ class PyOnnxRuntime(CMakePackage, PythonExtension):
# https://github.com/cms-externals/onnxruntime/compare/0d9030e...7a6355a
patch("cms_1_10.patch", whe="@1.10")
# https://github.com/microsoft/onnxruntime/issues/4234#issuecomment-698077636
patch("libiconv.patch", level=0, when="@1.7.2")
patch("libiconv-1.10.patch", level=0, when="@1.10.0")
# only needed when iconv is provided by libiconv
patch("libiconv.patch", level=0, when="@1.7.2 ^libiconv")
patch("libiconv-1.10.patch", level=0, when="@1.10.0 ^libiconv")
# https://github.com/microsoft/onnxruntime/commit/de4089f8cbe0baffe56a363cc3a41595cc8f0809.patch
patch("gcc11.patch", level=1, when="@1.7.2")
@ -126,4 +128,7 @@ def cmake_args(self):
@run_after("install")
def install_python(self):
PythonPackage.install(self, self.spec, self.prefix)
"""Install everything from build directory."""
args = std_pip_args + ["--prefix=" + prefix, "."]
with working_dir(self.build_directory):
pip(*args)