-
Notifications
You must be signed in to change notification settings - Fork 8
/
conanfile.py
60 lines (49 loc) · 1.8 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import os
import shutil
from conan import ConanFile
from conan.tools.files import download, unzip, check_sha256
class AtlasSystemAgentConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = (
"abseil/20240116.2",
"asio/1.32.0",
"backward-cpp/1.6",
"fmt/11.0.2",
"gtest/1.15.0",
"libcurl/8.10.1",
"openssl/3.3.2",
"rapidjson/cci.20230929",
"spdlog/1.15.0",
"zlib/1.3.1",
)
tool_requires = ()
generators = "CMakeDeps", "CMakeToolchain"
def configure(self):
self.options["libcurl"].with_c_ares = True
self.options["libcurl"].with_ssl = "openssl"
@staticmethod
def maybe_remove_dir(path: str):
if os.path.isdir(path):
shutil.rmtree(path)
@staticmethod
def maybe_remove_file(path: str):
if os.path.isfile(path):
os.unlink(path)
def get_spectator_cpp(self):
repo = "Netflix/spectator-cpp"
commit = "5761837faf6911a5c8fe04646cb05649b68a8ae3"
zip_name = repo.replace("Netflix/", "") + f"-{commit}.zip"
self.maybe_remove_file(zip_name)
download(self, f"https://github.com/{repo}/archive/{commit}.zip", zip_name)
check_sha256(self, zip_name, "04cac036a9a1ad08ab381408578153c108b4e553db3bfb4148cf4a8fcbd7ba3a")
dir_name = repo.replace("Netflix/", "")
self.maybe_remove_dir(dir_name)
unzip(self, zip_name, destination=dir_name, strip_root=True)
self.maybe_remove_dir("lib/spectator")
shutil.move(f"{dir_name}/spectator", "lib/spectator")
self.maybe_remove_dir("lib/tools")
shutil.move(f"{dir_name}/tools", "lib/tools")
os.unlink(zip_name)
shutil.rmtree(dir_name)
def source(self):
self.get_spectator_cpp()