Skip to content

Commit

Permalink
kcov: bump versions, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 16, 2023
1 parent a37c79e commit cf92a36
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 3 additions & 1 deletion recipes/kcov/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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"
"38":
url: "https://github.com/SimonKagstrom/kcov/archive/38.tar.gz"
sha256: "b37af60d81a9b1e3b140f9473bdcb7975af12040feb24cc666f9bb2bb0be68b4"
patches:
"40": []
"38":
- patch_file: "patches/0001-fix-SOLIB-path.patch"

Check warning on line 13 in recipes/kcov/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0001-fix ... ^ (line: 13)
- patch_file: "patches/0002-fix-missing-libssl-dependency.patch"

Check warning on line 14 in recipes/kcov/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0002-fix ... ^ (line: 14)
18 changes: 13 additions & 5 deletions recipes/kcov/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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)
4 changes: 4 additions & 0 deletions recipes/kcov/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class TestPackageConan(ConanFile):
Expand All @@ -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")
2 changes: 2 additions & 0 deletions recipes/kcov/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"41":
folder: all
"40":
folder: all
"38":
Expand Down

0 comments on commit cf92a36

Please sign in to comment.