|
9 | 9 | from pathlib import Path
|
10 | 10 | from typing import List
|
11 | 11 |
|
12 |
| -from conans import CMake, ConanFile, tools |
13 |
| -from conans.errors import ConanInvalidConfiguration |
| 12 | +from conan import ConanFile |
| 13 | +from conan.tools import files |
| 14 | +from conans.error import ConanInvalidConfiguration |
| 15 | + |
| 16 | +required_conan_version = ">=1.52.0" |
14 | 17 |
|
15 | 18 |
|
16 | 19 | def patch_rpath(file: Path, rpath: List[str]):
|
@@ -109,7 +112,7 @@ def build(self):
|
109 | 112 |
|
110 | 113 | def extract_archive(archive):
|
111 | 114 | print(f"Extracting: {archive}")
|
112 |
| - tools.untargz(src / archive, dst) |
| 115 | + files.untargz(src / archive, dst) |
113 | 116 |
|
114 | 117 | extract_archive(self._archive_base)
|
115 | 118 | libdir.mkdir()
|
@@ -216,13 +219,15 @@ def package(self):
|
216 | 219 | def package_info(self):
|
217 | 220 | bindir = Path(self.package_folder) / "bin"
|
218 | 221 | self.output.info(f"Appending PATH environment variable: {bindir}")
|
219 |
| - self.env_info.PATH.append(str(bindir)) |
220 |
| - self.env_info.VTD_ROOT = self.package_folder |
| 222 | + self.runenv_info.append_path("PATH", str(bindir)) |
| 223 | + self.runenv_info.define("VTD_ROOT", self.package_folder) |
| 224 | + self.buildenv_info.define("VTD_ROOT", self.package_folder) |
| 225 | + |
221 | 226 | if self.options.with_osi:
|
222 | 227 | osi_path = (
|
223 | 228 | Path(self.package_folder)
|
224 | 229 | / "Data/Setups/Standard.OSI3/Bin/libopen_simulation_interface.so"
|
225 | 230 | )
|
226 | 231 | if not osi_path.exists():
|
227 | 232 | raise ConanInvalidConfiguration("VTD OSI library not found.")
|
228 |
| - self.env_info.VTD_EXTERNAL_MODELS.append(f"{osi_path}") |
| 233 | + self.runenv_info.append("VTD_EXTERNAL_MODELS", f"{osi_path}") |
0 commit comments