Merge pull request #223254 from cadkin/clazy

clazy: init at 1.11
This commit is contained in:
Sandro 2023-05-07 17:12:12 +02:00 committed by GitHub
commit 3a5de06a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 0 deletions

View file

@ -2406,6 +2406,12 @@
githubId = 51231053;
name = "Daniel";
};
cadkin = {
email = "cva@siliconslumber.net";
name = "Cameron Adkins";
github = "cadkin";
githubId = 34077838;
};
cafkafk = {
email = "christina@cafkafk.com";
matrix = "@cafkafk:matrix.cafkafk.com";

View file

@ -0,0 +1,56 @@
{
lib
, stdenv
, fetchFromGitHub
, llvmPackages
, cmake
, makeWrapper
}:
stdenv.mkDerivation rec {
pname = "clazy";
version = "1.11";
src = fetchFromGitHub {
owner = "KDE";
repo = "clazy";
rev = "v${version}";
sha256 = "sha256-kcl4dUg84fNdizKUS4kpvIKFfajtTRdz+MYUbKcMFvg=";
};
buildInputs = [
llvmPackages.llvm
llvmPackages.libclang
];
nativeBuildInputs = [
cmake
makeWrapper
];
postInstall = ''
wrapProgram $out/bin/clazy \
--suffix PATH : "${llvmPackages.clang}/bin/" \
--suffix CPATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)" \
--suffix CPATH : "${llvmPackages.clang}/resource-root/include" \
--suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libcxx-cxxflags)" \
--suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)" \
--suffix CPLUS_INCLUDE_PATH : "${llvmPackages.clang}/resource-root/include"
wrapProgram $out/bin/clazy-standalone \
--suffix CPATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)" \
--suffix CPATH : "${llvmPackages.clang}/resource-root/include" \
--suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libcxx-cxxflags)" \
--suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)" \
--suffix CPLUS_INCLUDE_PATH : "${llvmPackages.clang}/resource-root/include"
'';
meta = {
description = "Qt-oriented static code analyzer based on the Clang framework";
homepage = "https://github.com/KDE/clazy";
license = lib.licenses.lgpl2Plus;
maintainers = [ lib.maintainers.cadkin ];
platforms = lib.platforms.linux;
};
}

View file

@ -14622,6 +14622,11 @@ with pkgs;
inherit (llvmPackages_latest) clang;
};
clazy = callPackage ../development/tools/analysis/clazy {
llvmPackages = llvmPackages_latest;
stdenv = llvmPackages_latest.stdenv;
};
#Use this instead of stdenv to build with clang
clangStdenv = if stdenv.cc.isClang then stdenv else lowPrio llvmPackages.stdenv;
clang-sierraHack-stdenv = overrideCC stdenv buildPackages.clang-sierraHack;