Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchFromGitHub 4, pkg-config 5, sqlite 6, openssl 7, buildllvmsparse ? false 8, buildc2xml ? false 9, libllvm 10, libxml2 11}: 12 13stdenv.mkDerivation rec { 14 pname = "smatch"; 15 version = "1.73"; 16 17 src = fetchFromGitHub { 18 owner = "error27"; 19 repo = "smatch"; 20 rev = version; 21 sha256 = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME="; 22 }; 23 24 nativeBuildInputs = [ pkg-config ]; 25 26 buildInputs = [ sqlite openssl ] 27 ++ lib.optionals buildllvmsparse [ libllvm ] 28 ++ lib.optionals buildc2xml [ libxml2.dev ]; 29 30 makeFlags = [ "PREFIX=${placeholder "out"}" "CXX=${stdenv.cc.targetPrefix}c++" ]; 31 32 meta = with lib; { 33 description = "A semantic analysis tool for C"; 34 homepage = "https://sparse.docs.kernel.org/"; 35 maintainers = with maintainers; [ marsam ]; 36 license = licenses.gpl2Plus; 37 platforms = platforms.all; 38 }; 39}