diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-29 13:50:24 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-29 15:18:22 +0900 |
| commit | eb04d8c8cb4521bf611b8df46a96c4132af2520b (patch) | |
| tree | 2425c9000f9baade3140df28f5b4055585f57809 /cppcheck.nix | |
| parent | a9f9aef0d323e424e56f3849a48a3b2f4cf7af62 (diff) | |
| download | bux-eb04d8c8cb4521bf611b8df46a96c4132af2520b.tar.gz | |
Add cppcheck bug 9261
Diffstat (limited to 'cppcheck.nix')
| -rw-r--r-- | cppcheck.nix | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/cppcheck.nix b/cppcheck.nix new file mode 100644 index 0000000..60991a7 --- /dev/null +++ b/cppcheck.nix @@ -0,0 +1,74 @@ +# Recipe for building cppcheck at specific revision +# +# SPDX-FileCopyrightText: 2012, 2014, 2016 Peter Simons +# SPDX-FileCopyrightText: 2013 Bjørn Forsman +# SPDX-FileCopyrightText: 2014 Linquize +# SPDX-FileCopyrightText: 2014 Moritz Ulrich +# SPDX-FileCopyrightText: 2014 Pascal Wittmann +# SPDX-FileCopyrightText: 2014 Peter Simons +# SPDX-FileCopyrightText: 2015-2017 Joachim Fasting +# SPDX-FileCopyrightText: 2015 koral +# SPDX-FileCopyrightText: 2016 Nikolay Amiantov +# SPDX-FileCopyrightText: 2017 Guillaume Maudoux +# SPDX-FileCopyrightText: 2018 Ignat Loskutov +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: 2023 Nguyễn Gia Phong +# SPDX-License-Identifier: AGPL-3.0-or-later + +{ lib, stdenv, fetchFromGitHub, fetchpatch, version, commit, hash, binRenameHook +, docbook_xsl, docbook_xml_dtd_45, libxslt, python3, which, pcre }: + +stdenv.mkDerivation rec { + pname = "cppcheck"; + inherit version; + + src = fetchFromGitHub { + owner = "danmar"; + repo = pname; + rev = commit; + inherit hash; + }; + + patches = [ + (fetchpatch { + name = "glibc-2.34-compat.patch"; + url = "https://github.com/danmar/cppcheck/commit/8869ee3554f19ce63892891a697378d8b745414b.patch"; + hash = "sha256-K9+/2VIb5OFz+es8ZrprCBx8nkKZZycagw6ripWavPw="; + }) + ]; + + # strictDeps = true; + nativeBuildInputs = [ + binRenameHook docbook_xsl docbook_xml_dtd_45 libxslt python3 which + ]; + buildInputs = [ pcre ]; + + makeFlags = [ + "PREFIX=$(out)" + "MATCHCOMPILER=yes" + "FILESDIR=$(out)/cfg" + "HAVE_RULES=yes" + ]; + + enableParallelBuilding = true; + + outputs = [ "out" "man" ]; + + postInstall = '' + make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man + mkdir -p $man/share/man/man1 + cp cppcheck.1 $man/share/man/man1/cppcheck.1 + ''; + + meta = with lib; { + description = "A static analysis tool for C/C++ code"; + longDescription = '' + Check C/C++ code for memory leaks, mismatching allocation-deallocation, + buffer overruns and more. + ''; + homepage = "https://cppcheck.sourceforge.net"; + license = licenses.gpl3Plus; + platforms = platforms.unix; + }; +} |
