diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-30 11:31:40 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-30 11:31:40 +0900 |
commit | d74ee7280ba56a6abb8d3cf1ec1799db906c9171 (patch) | |
tree | 398b40c7c561032fa8e1bdaef027afa43c1f8179 /cppcheck/default.nix | |
parent | eb04d8c8cb4521bf611b8df46a96c4132af2520b (diff) | |
download | bux-d74ee7280ba56a6abb8d3cf1ec1799db906c9171.tar.gz |
Add md4c bug 107
References: https://github.com/mity/md4c/issues/107
Diffstat (limited to 'cppcheck/default.nix')
-rw-r--r-- | cppcheck/default.nix | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/cppcheck/default.nix b/cppcheck/default.nix new file mode 100644 index 0000000..60991a7 --- /dev/null +++ b/cppcheck/default.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; + }; +} |