diff --git a/recipes/kcov/all/conandata.yml b/recipes/kcov/all/conandata.yml index 3ef0bf1e4dfd17..fd53a60e569e98 100644 --- a/recipes/kcov/all/conandata.yml +++ b/recipes/kcov/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "41": + url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v41.tar.gz" + sha256: "13cddde0c6c97dc78ece23f7adcad7a8f2b5ae3c84193020e7edd9bf44e5997c" "40": url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v40.tar.gz" sha256: "6b1c11b066d57426d61375a31c3816f1fcd2610b447050c86d9920e22d5200b3" @@ -6,7 +9,6 @@ sources: url: "https://github.com/SimonKagstrom/kcov/archive/38.tar.gz" sha256: "b37af60d81a9b1e3b140f9473bdcb7975af12040feb24cc666f9bb2bb0be68b4" patches: - "40": [] "38": - patch_file: "patches/0001-fix-SOLIB-path.patch" - patch_file: "patches/0002-fix-missing-libssl-dependency.patch" diff --git a/recipes/kcov/all/conanfile.py b/recipes/kcov/all/conanfile.py index c1ac365667662c..63b9755262c17c 100644 --- a/recipes/kcov/all/conanfile.py +++ b/recipes/kcov/all/conanfile.py @@ -3,9 +3,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rm, replace_in_file -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class KcovConan(ConanFile): @@ -32,7 +32,9 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") self.requires("libiberty/9.1.0") self.requires("libcurl/[>=7.78 <9]") + self.requires("libelf/0.8.13") self.requires("elfutils/0.190") + self.requires("libdwarf/0.8.0") def package_id(self): del self.info.settings.compiler @@ -48,11 +50,18 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.set_property("libdwarf", "cmake_file_name", "Dwarfutils") + deps.set_property("elfutils", "cmake_file_name", "Elfutils") + deps.generate() def build(self): apply_conandata_patches(self) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake")) + src_cmakelists = os.path.join(self.source_folder, "src", "CMakeLists.txt") + replace_in_file(self, src_cmakelists, "find_package (LibElf)", "find_package (LIBELF REQUIRED CONFIG)") + replace_in_file(self, src_cmakelists, "ElfUtils", "Elfutils", strict=False) + replace_in_file(self, src_cmakelists, "${LIBELF_LIBRARIES}", "${LIBELF_LIBRARIES} ${Elfutils_LIBRARIES}") cmake = CMake(self) cmake.configure() cmake.build() @@ -71,5 +80,4 @@ def package_info(self): # TODO: to remove in conan v2 bindir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) diff --git a/recipes/kcov/all/test_package/conanfile.py b/recipes/kcov/all/test_package/conanfile.py index 698c29f674eeb2..694389e1c3e742 100644 --- a/recipes/kcov/all/test_package/conanfile.py +++ b/recipes/kcov/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.cmake import cmake_layout class TestPackageConan(ConanFile): @@ -9,5 +10,8 @@ class TestPackageConan(ConanFile): def build_requirements(self): self.tool_requires(self.tested_reference_str) + def layout(self): + cmake_layout(self) + def test(self): self.run("kcov --version") diff --git a/recipes/kcov/config.yml b/recipes/kcov/config.yml index b36ca0e497b009..15a60b30375b2a 100644 --- a/recipes/kcov/config.yml +++ b/recipes/kcov/config.yml @@ -1,4 +1,6 @@ versions: + "41": + folder: all "40": folder: all "38":