From 5d3efbba14b80b8b3b1d3e473b216e785fedba1b Mon Sep 17 00:00:00 2001 From: iarspider Date: Wed, 30 Nov 2022 16:17:22 +0100 Subject: 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 * remove unused imports * Update package.py Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/py-onnx-runtime/package.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-onnx-runtime/package.py b/var/spack/repos/builtin/packages/py-onnx-runtime/package.py index fa956086b8..14ce52b9bc 100644 --- a/var/spack/repos/builtin/packages/py-onnx-runtime/package.py +++ b/var/spack/repos/builtin/packages/py-onnx-runtime/package.py @@ -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 @@ class PyOnnxRuntime(CMakePackage, PythonExtension): @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) -- cgit v1.2.3-70-g09d2