Skip to content

Commit

Permalink
vtd: Migrate vtd-2.2.0 package to Conan 2.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cassava committed Jan 29, 2024
1 parent b89bc75 commit 0eceaaf
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions optional/vtd/vendor/vtd-2.2.0/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
from pathlib import Path
from typing import List

from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.tools import files
from conan.errors import ConanInvalidConfiguration

required_conan_version = ">=1.52.0"


def patch_rpath(file: Path, rpath: List[str]):
Expand Down Expand Up @@ -96,7 +99,7 @@ def build(self):

def extract_archive(archive):
print(f"Extracting: {archive}")
tools.untargz(src / archive, dst)
files.untargz(src / archive, dst)

extract_archive(self._archive_base)
libdir.mkdir()
Expand Down Expand Up @@ -147,13 +150,15 @@ def package(self):
def package_info(self):
bindir = Path(self.package_folder) / "bin"
self.output.info(f"Appending PATH environment variable: {bindir}")
self.env_info.PATH.append(str(bindir))
self.env_info.VTD_ROOT = self.package_folder
self.runenv_info.append_path("PATH", str(bindir))
self.runenv_info.define("VTD_ROOT", self.package_folder)
self.buildenv_info.define("VTD_ROOT", self.package_folder)

if self.options.with_osi:
osi_path = (
Path(self.package_folder)
/ "Data/Setups/Standard.OSI3/Bin/libopen_simulation_interface.so"
)
if not osi_path.exists():
raise ConanInvalidConfiguration("VTD OSI library not found.")
self.env_info.VTD_EXTERNAL_MODELS.append(f"{osi_path}")
self.runenv_info.append_path("VTD_EXTERNAL_MODELS", f"{osi_path}")

0 comments on commit 0eceaaf

Please sign in to comment.