mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 19:20:08 +02:00
cppcheck, bump version (#2712)
This commit is contained in:
committed by
waddlesplash
parent
99643e88c9
commit
9671519a7a
70
dev-util/cppcheck/cppcheck-1.84.recipe
Normal file
70
dev-util/cppcheck/cppcheck-1.84.recipe
Normal file
@@ -0,0 +1,70 @@
|
||||
SUMMARY="A static analysis tool for C/C++ code"
|
||||
DESCRIPTION="Cppcheck provides unique code analysis to detect bugs and focuses on \
|
||||
detecting undefined behaviour and dangerous coding constructs. The goal is \
|
||||
to detect only real errors in the code (i.e. have very few false positives).
|
||||
|
||||
Features:
|
||||
* Unique code analysis that detect various kinds of bugs in your code.
|
||||
* Both command line interface and graphical user interface are available.
|
||||
* Cppcheck has a strong focus on detecting undefined behaviour."
|
||||
HOMEPAGE="http://cppcheck.sourceforge.net/"
|
||||
COPYRIGHT="2007-2018 Cppcheck team"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/danmar/cppcheck/archive/$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="aaa6293d91505fc6caa6982ca3cd2d949fa1aac603cabad072b705fdda017fc5"
|
||||
SOURCE_FILENAME="cppcheck-$portVersion.tar.gz"
|
||||
PATCHES="cppcheck-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
cppcheck$secondaryArchSuffix = $portVersion
|
||||
cmd:cppcheck$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libpcre$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libpcre$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
defineDebugInfoPackage cppcheck$secondaryArchSuffix \
|
||||
$binDir/cppcheck
|
||||
|
||||
BUILD()
|
||||
{
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. \
|
||||
-DUSE_CLANG=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DHAVE_RULES=ON \
|
||||
$cmakeDirArgs
|
||||
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd build
|
||||
make install
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
cd build
|
||||
make test
|
||||
}
|
||||
76
dev-util/cppcheck/patches/cppcheck-1.84.patchset
Normal file
76
dev-util/cppcheck/patches/cppcheck-1.84.patchset
Normal file
@@ -0,0 +1,76 @@
|
||||
From b4973d8327b89e44c43fc696f5454821c0a665f6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Thu, 5 Apr 2018 17:55:26 +0200
|
||||
Subject: Haiku patches
|
||||
|
||||
|
||||
diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp
|
||||
index bfaa398..8a3cd8c 100644
|
||||
--- a/cli/cppcheckexecutor.cpp
|
||||
+++ b/cli/cppcheckexecutor.cpp
|
||||
@@ -52,7 +52,7 @@
|
||||
# include <ucontext.h>
|
||||
|
||||
# undef _XOPEN_SOURCE
|
||||
-#elif !defined(__OpenBSD__)
|
||||
+#elif !defined(__OpenBSD__) && !defined(__HAIKU__)
|
||||
# include <ucontext.h>
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
diff --git a/cli/filelister.cpp b/cli/filelister.cpp
|
||||
index ff2112b..86dfa0e 100644
|
||||
--- a/cli/filelister.cpp
|
||||
+++ b/cli/filelister.cpp
|
||||
@@ -204,6 +204,7 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
|
||||
|
||||
new_path = path + '/' + dir_result->d_name;
|
||||
|
||||
+#ifndef __HAIKU__
|
||||
if (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))) {
|
||||
if (recursive && !ignored.match(new_path)) {
|
||||
addFiles2(files, new_path, extra, recursive, ignored);
|
||||
@@ -213,6 +214,7 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
|
||||
files[new_path] = file_stat.st_size;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
closedir(dir);
|
||||
} else
|
||||
diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp
|
||||
index bc73870..fea5e25 100644
|
||||
--- a/cli/threadexecutor.cpp
|
||||
+++ b/cli/threadexecutor.cpp
|
||||
@@ -150,7 +150,7 @@ int ThreadExecutor::handleRead(int rpipe, unsigned int &result)
|
||||
|
||||
bool ThreadExecutor::checkLoadAverage(size_t nchildren)
|
||||
{
|
||||
-#if defined(__CYGWIN__) || defined(__QNX__) // getloadavg() is unsupported on Cygwin, Qnx.
|
||||
+#if defined(__CYGWIN__) || defined(__QNX__) || defined(__HAIKU__) // getloadavg() is unsupported on Cygwin, Qnx, Haiku.
|
||||
return true;
|
||||
#else
|
||||
if (!nchildren || !_settings.loadAverage) {
|
||||
diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake
|
||||
index 8f6e957..17b3d1c 100644
|
||||
--- a/cmake/compileroptions.cmake
|
||||
+++ b/cmake/compileroptions.cmake
|
||||
@@ -5,9 +5,13 @@ set(EXTRA_C_FLAGS_DEBUG "-DDEBUG -O0")
|
||||
if (USE_CLANG)
|
||||
set (CMAKE_C_COMPILER_ID "Clang")
|
||||
set (CMAKE_CXX_COMPILER_ID "Clang")
|
||||
- set (CMAKE_C_COMPILER "/usr/bin/clang")
|
||||
- set (CMAKE_CXX_COMPILER "/usr/bin/clang++")
|
||||
-
|
||||
+ if (NOT HAIKU)
|
||||
+ set (CMAKE_C_COMPILER "/usr/bin/clang")
|
||||
+ set (CMAKE_CXX_COMPILER "/usr/bin/clang++")
|
||||
+ else (NOT HAIKU)
|
||||
+ set (CMAKE_C_COMPILER "/bin/clang")
|
||||
+ set (CMAKE_CXX_COMPILER "/bin/clang++")
|
||||
+ endif (NOT HAIKU)
|
||||
set (CMAKE_C_FLAGS "-std=c99")
|
||||
set (CMAKE_C_FLAGS_DEBUG "-g")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O2")
|
||||
--
|
||||
2.16.2
|
||||
|
||||
Reference in New Issue
Block a user