how-to-use-pvs-studio-free.nix (1130B)
1 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake }: 2 3 stdenv.mkDerivation (finalAttrs: { 4 pname = "how-to-use-pvs-studio-free"; 5 version = "2.1"; 6 7 src = fetchFromGitHub { 8 owner = "viva64"; 9 repo = "how-to-use-pvs-studio-free"; 10 rev = finalAttrs.version; 11 hash = "sha256-aFqk0WsMylRQqvlb+M5IfDHVwMBuKNQpCiiGPrj+jEw="; 12 }; 13 14 patches = [ 15 (fetchpatch { 16 url = "https://github.com/viva64/how-to-use-pvs-studio-free/commit/5685a069d9538242a79d099fed3057de37a8d766.patch"; 17 hash = "sha256-xffOthjpBVP1aijdO6LTnHNQ3pvrO0/W3YJWIWLMuuQ="; 18 }) 19 ]; 20 21 postPatch = '' 22 sed -i '10i #include <cstdint>' comments.h 23 substituteInPlace CMakeLists.txt \ 24 --replace-fail "set(CMAKE_INSTALL_PREFIX \"/usr\")" "" 25 ''; 26 27 nativeBuildInputs = [ cmake ]; 28 29 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-error=unqualified-std-cast-call"; 30 31 meta = with lib; { 32 description = "How to use PVS-Studio for Free?"; 33 homepage = "https://pvs-studio.com/en/blog/posts/0457/"; 34 license = licenses.asl20; 35 maintainers = [ maintainers.sikmir ]; 36 platforms = platforms.unix; 37 }; 38 })