-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Which is a neat little resource monitor tool for Unix Contributes to NP-31
- Loading branch information
1 parent
bf9d76f
commit c546481
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sources: | ||
"cci.20220429": | ||
url: | ||
- "https://github.com/scaidermern/audria/archive/18963ec93571387c330e0fde677425097c280671.zip" | ||
sha256: "9418f94c6b75f03dcb39e2e6447f413af7978146b852a2eeb15449aaf7f3b26f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
from conan import ConanFile | ||
from conan.errors import ConanInvalidConfiguration | ||
from conan.tools.build import check_min_cppstd | ||
from conan.tools.files import apply_conandata_patches, copy, get | ||
from conan.tools.layout import basic_layout | ||
from conan.tools.scm import Version | ||
import os | ||
|
||
|
||
required_conan_version = ">=1.54.0" | ||
|
||
|
||
class PackageConan(ConanFile): | ||
name = "audria" | ||
description = "A Utility for Detailed Ressource Inspection of Applications" | ||
license = " AGPL-3.0-or-later" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://github.com/scaidermern/audria" | ||
topics = ("statistics", "cpu", "monitor", "monitoring", "profiler", "memory", "resources", "analyzer", "io", "load", "throughput", "inspection", "profiling", "threads", "cpu-monitoring", "resource-measurement", "memory-usage", "cpu-usage", "memory-monitoring") | ||
package_type = "application" | ||
settings = "os", "arch", "compiler", "build_type" | ||
|
||
@property | ||
def _min_cppstd(self): | ||
return 14 | ||
|
||
@property | ||
def _compilers_minimum_version(self): | ||
return { | ||
"apple-clang": "10", | ||
"clang": "7", | ||
"gcc": "7", | ||
} | ||
|
||
@property | ||
def _settings_build(self): | ||
return getattr(self, "settings_build", self.settings) | ||
|
||
def layout(self): | ||
basic_layout(self, src_folder="src") | ||
|
||
def validate(self): | ||
if self.settings.compiler.get_safe("cppstd"): | ||
check_min_cppstd(self, self._min_cppstd) | ||
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) | ||
if minimum_version and Version(self.settings.compiler.version) < minimum_version: | ||
raise ConanInvalidConfiguration( | ||
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." | ||
) | ||
if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: | ||
raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") | ||
|
||
def source(self): | ||
get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
|
||
def generate(self): | ||
copy(self, "*", src=self.source_folder, dst=self.build_folder) | ||
|
||
def build(self): | ||
apply_conandata_patches(self) | ||
self.run("make") | ||
|
||
def package(self): | ||
copy(self, "audria", src=self.build_folder, dst=os.path.join(self.package_folder, "bin")) | ||
|
||
def package_info(self): | ||
self.cpp_info.bins = ["audria"] | ||
|
||
bindir = os.path.join(self.package_folder, "bin") | ||
self.output.info(f"Appending PATH environment variable: {bindir}") | ||
self.env_info.PATH.append(bindir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def test(self): | ||
if can_run(self): | ||
bin_path = os.path.join("audria") | ||
self.run(f"{bin_path} -h", env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"cci.20220429": | ||
folder: all |