Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cppcheck] Add version 2.9.1 #14149

Merged
merged 68 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9730f93
Merge pull request #1 from conan-io/master
Sneder89 Nov 10, 2022
066ae22
Merge branch 'conan-io:master' into master
Sneder89 Nov 10, 2022
5c4559a
Update conandata.yml
Sneder89 Nov 10, 2022
114d9da
Update config.yml
Sneder89 Nov 10, 2022
a50f637
Update conanfile.py
Sneder89 Nov 10, 2022
9b03147
Update conanfile.py
Sneder89 Nov 10, 2022
531c2cc
Merge branch 'conan-io:master' into add-new-cppcheck-versions
Sneder89 Nov 14, 2022
f67f5a9
Update conandata.yml
Sneder89 Nov 14, 2022
05a1f72
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 14, 2022
10f9d5e
Update conanfile.py
Sneder89 Nov 14, 2022
9676552
Update conandata.yml
Sneder89 Nov 14, 2022
4063067
Update conanfile.py
Sneder89 Nov 14, 2022
86b9e34
Update conandata.yml
Sneder89 Nov 14, 2022
0f2b2b3
Update conanfile.py
Sneder89 Nov 14, 2022
1dd7b53
Update config.yml
Sneder89 Nov 14, 2022
a452dcc
Delete recipes/cppcheck/all/patches directory
Sneder89 Nov 14, 2022
4339b8a
Update conanfile.py
Sneder89 Nov 14, 2022
5bbf062
Update conanfile.py
Sneder89 Nov 14, 2022
df72e43
Update recipes/cppcheck/all/test_package/conanfile.py
Sneder89 Nov 14, 2022
ec1e2ec
Update recipes/cppcheck/all/test_package/conanfile.py
Sneder89 Nov 14, 2022
72cd7cb
Update recipes/cppcheck/all/test_package/conanfile.py
Sneder89 Nov 14, 2022
ebc7804
Update conanfile.py
Sneder89 Nov 14, 2022
976c112
Update conanfile.py
Sneder89 Nov 14, 2022
b5a038f
Update conanfile.py
Sneder89 Nov 14, 2022
d77dd0d
Update conanfile.py
Sneder89 Nov 15, 2022
00bbc49
Merge branch 'conan-io:master' into add-new-cppcheck-versions
Sneder89 Nov 15, 2022
dd2acda
Update conanfile.py
Sneder89 Nov 15, 2022
65da535
Update conanfile.py
Sneder89 Nov 15, 2022
e2f9b32
Update conanfile.py
Sneder89 Nov 15, 2022
ea1e5e7
Update conanfile.py
Sneder89 Nov 15, 2022
e4c366b
Update config.yml
Sneder89 Nov 15, 2022
a24240a
Update conandata.yml
Sneder89 Nov 15, 2022
bcc3534
changes
Sneder89 Nov 15, 2022
f554350
changes
Sneder89 Nov 16, 2022
f37bbc1
Update conandata.yml
Sneder89 Nov 16, 2022
ad4c120
Update conanfile.py
Sneder89 Nov 16, 2022
b9505d0
Update conanfile.py
Sneder89 Nov 16, 2022
37302c6
Update conanfile.py
Sneder89 Nov 17, 2022
a66c5a1
Update conanfile.py
Sneder89 Nov 17, 2022
42952e5
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 17, 2022
99c3348
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 17, 2022
b9456c1
Update conanfile.py
Sneder89 Nov 17, 2022
25679b1
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 17, 2022
ca0d6d6
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 18, 2022
f5cc2d7
Update conanfile.py
Sneder89 Nov 21, 2022
bef7fb4
Update conanfile.py
Sneder89 Nov 21, 2022
ef656c1
Update conanfile.py
Sneder89 Nov 21, 2022
d6f5067
get test package working
Sneder89 Nov 23, 2022
d7a26a7
add v1 test package
Sneder89 Nov 23, 2022
9474cd8
moved changes from replace to file to patches
Sneder89 Nov 23, 2022
1e32c7f
Update conanfile.py
Sneder89 Nov 23, 2022
f4c12e0
Update conanfile.py
Sneder89 Nov 24, 2022
a09e6a5
Update conanfile.py
Sneder89 Nov 24, 2022
677a868
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
2e0c5bf
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
f4b5353
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
564733c
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
c582056
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
abd73fa
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
4727039
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
aca06fe
Update 0003-pcre-debuglib-name-2.7.patch
Sneder89 Nov 24, 2022
a6bb28e
Update conanfile.py
Sneder89 Nov 25, 2022
7a3131c
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 27, 2022
e71f6d0
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 27, 2022
bfabc97
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 27, 2022
bd67112
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 27, 2022
01fa00a
Update recipes/cppcheck/all/conanfile.py
Sneder89 Nov 27, 2022
3247619
use tool_requires in test package, add required fields in conandata.y…
Sneder89 Nov 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions recipes/cppcheck/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
sources:
"2.9.1":
url: "https://github.com/danmar/cppcheck/archive/2.9.1.tar.gz"
sha256: "fa4350f48df978dcc02d8769376ff5517d7f1e77d9f79f636c79912f4c0cff9c"
"2.8.2":
url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz"
sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45"
"2.7.5":
Sneder89 marked this conversation as resolved.
Show resolved Hide resolved
url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz"
sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78"
"2.7.4":
url: "https://github.com/danmar/cppcheck/archive/2.7.4.tar.gz"
sha256: "f0558c497b7807763325f3a821f1c72b743e5d888b037b8d32157dd07d6c26e1"
patches:
"2.9.1":
- patch_file: "patches/0001-cmake-source-dir-2.5.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-htmlreport-python3.patch"
base_path: "source_subfolder"
- patch_file: "patches/0003-handle-exename-on-macos.patch"
base_path: "source_subfolder"
Sneder89 marked this conversation as resolved.
Show resolved Hide resolved
"2.8.2":
- patch_file: "patches/0001-cmake-source-dir-2.5.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-htmlreport-python3.patch"
base_path: "source_subfolder"
- patch_file: "patches/0003-handle-exename-on-macos.patch"
base_path: "source_subfolder"
Sneder89 marked this conversation as resolved.
Show resolved Hide resolved
"2.7.5":
- patch_file: "patches/0001-cmake-source-dir-2.5.patch"
base_path: "source_subfolder"
Expand Down
70 changes: 32 additions & 38 deletions recipes/cppcheck/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conans import ConanFile, CMake, tools
import functools
from conan import ConanFile,
Sneder89 marked this conversation as resolved.
Show resolved Hide resolved
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir
import os

required_conan_version = ">=1.33.0"
Expand All @@ -12,26 +13,13 @@ class CppcheckConan(ConanFile):
topics = ("Cpp Check", "static analyzer")
description = "Cppcheck is an analysis tool for C/C++ code."
license = "GPL-3.0-or-later"
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
options = {"with_z3": [True, False], "have_rules": [True, False]}
default_options = {"with_z3": True, "have_rules": True}
exports_sources = ["CMakeLists.txt", "patches/**"]

@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def _patch_sources(self):
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
tools.replace_in_file(os.path.join(self._source_subfolder, "cli", "CMakeLists.txt"),
"RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}",
"DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}")
def layout(self):
cmake_layout(self)

def requirements(self):
if self.options.with_z3:
Expand All @@ -40,35 +28,41 @@ def requirements(self):
self.requires("pcre/8.45")

def source(self):
tools.get(**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)
get(**self.conan_data["sources"][self.version], strip_root=True)

@functools.lru_cache(1)
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["USE_Z3"] = self.options.with_z3
cmake.definitions["HAVE_RULES"] = self.options.have_rules
cmake.definitions["USE_MATCHCOMPILER"] = "Auto"
cmake.definitions["ENABLE_OSS_FUZZ"] = False
cmake.configure(build_folder=self._build_subfolder)
return cmake
def generate(self):
tc = CMakeToolchain(self)
tc.variables["USE_Z3"] = self.options.with_z3
tc.variables["HAVE_RULES"] = self.options.have_rules
tc.variables["USE_MATCHCOMPILER"] = "Auto"
tc.variables["ENABLE_OSS_FUZZ"] = False
tc.generate()

deps = CMakeDeps(self)
deps.generate()

def build(self):
self._patch_sources()
cmake = self._configure_cmake()
cmake = CMake(self)
apply_conandata_patches(self)
Sneder89 marked this conversation as resolved.
Show resolved Hide resolved
replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"),
"RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}",
"DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}")
cmake.configure()
cmake.build()

def package(self):
self.copy("COPYING", dst="licenses", src=self._source_subfolder)
self.copy("*", dst=os.path.join("bin","cfg"), src=os.path.join(self._source_subfolder,"cfg"))
self.copy("cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self._source_subfolder,"htmlreport"))
cmake = self._configure_cmake()
copy(self, "COPYING", dst="licenses", src=self.source_folder)
copy(self, "*", dst=os.path.join("bin", "cfg"), src=os.path.join(self.source_folder, "cfg"))
copy(self, "cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self.source_folder, "htmlreport"))
cmake = CMake(self)
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "share"))
rmdir(self, os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.includedirs = []
self.cpp_info.libdirs = []

bin_folder = os.path.join(self.package_folder, "bin")
self.output.info("Append %s to environment variable PATH" % bin_folder)
self.env_info.PATH.append(bin_folder)
# This is required to run the python script on windows, as we cannot simply add it to the PATH
self.env_info.CPPCHECK_HTMLREPORT = os.path.join(bin_folder, "cppcheck-htmlreport")
self.buildenv_info.prepend_path("PATH", self.package_folder)
self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", os.path.join(bin_folder, "cppcheck-htmlreport"))
4 changes: 4 additions & 0 deletions recipes/cppcheck/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
versions:
"2.9.1":
folder: all
"2.8.2":
folder: all
"2.7.5":
folder: all
"2.7.4":
Expand Down