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