Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / tools / analysis / clazy / default.nix
blob10c61bf88881720ba1ac074e8faa5b80170b54de
2     lib
3   , stdenv
4   , fetchFromGitHub
5   , llvmPackages
6   , cmake
7   , makeWrapper
8 }:
10 stdenv.mkDerivation rec {
11   pname = "clazy";
12   version = "1.11";
14   src = fetchFromGitHub {
15     owner  = "KDE";
16     repo   = "clazy";
17     rev    = "v${version}";
18     sha256 = "sha256-kcl4dUg84fNdizKUS4kpvIKFfajtTRdz+MYUbKcMFvg=";
19   };
21   buildInputs = [
22     llvmPackages.llvm
23     llvmPackages.libclang
24   ];
26   nativeBuildInputs = [
27     cmake
28     makeWrapper
29   ];
31   postInstall = ''
32     wrapProgram $out/bin/clazy \
33       --suffix PATH               : "${llvmPackages.clang}/bin/"                            \
34       --suffix CPATH              : "$(<${llvmPackages.clang}/nix-support/libc-cflags)"     \
35       --suffix CPATH              : "${llvmPackages.clang}/resource-root/include"           \
36       --suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libcxx-cxxflags)" \
37       --suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)"     \
38       --suffix CPLUS_INCLUDE_PATH : "${llvmPackages.clang}/resource-root/include"
40     wrapProgram $out/bin/clazy-standalone \
41       --suffix CPATH              : "$(<${llvmPackages.clang}/nix-support/libc-cflags)"     \
42       --suffix CPATH              : "${llvmPackages.clang}/resource-root/include"           \
43       --suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libcxx-cxxflags)" \
44       --suffix CPLUS_INCLUDE_PATH : "$(<${llvmPackages.clang}/nix-support/libc-cflags)"     \
45       --suffix CPLUS_INCLUDE_PATH : "${llvmPackages.clang}/resource-root/include"
46   '';
48   meta = {
49     description = "Qt-oriented static code analyzer based on the Clang framework";
50     homepage = "https://github.com/KDE/clazy";
51     license = lib.licenses.lgpl2Plus;
52     maintainers = [ lib.maintainers.cadkin ];
53     platforms = lib.platforms.linux;
54   };