nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

how-to-use-pvs-studio-free.nix (873B)


      1 { lib, stdenv, fetchFromGitHub, cmake }:
      2 
      3 stdenv.mkDerivation rec {
      4   pname = "how-to-use-pvs-studio-free";
      5   version = "2.1";
      6 
      7   src = fetchFromGitHub {
      8     owner = "viva64";
      9     repo = pname;
     10     rev = version;
     11     hash = "sha256-aFqk0WsMylRQqvlb+M5IfDHVwMBuKNQpCiiGPrj+jEw=";
     12   };
     13 
     14   nativeBuildInputs = [ cmake ];
     15 
     16   postPatch = lib.optionalString (!stdenv.isDarwin) ''
     17     substituteInPlace CMakeLists.txt \
     18       --replace "set(CMAKE_INSTALL_PREFIX \"/usr\")" ""
     19   '' + lib.optionalString stdenv.cc.isClang ''
     20     substituteInPlace CMakeLists.txt \
     21       --replace "stdc++fs" "c++fs"
     22   '';
     23 
     24   meta = with lib; {
     25     description = "How to use PVS-Studio for Free?";
     26     homepage = "https://pvs-studio.com/en/blog/posts/0457/";
     27     license = licenses.asl20;
     28     maintainers = [ maintainers.sikmir ];
     29     platforms = platforms.unix;
     30     broken = stdenv.isDarwin;
     31   };
     32 }