1 { callPackage, fetchurl, lib, stdenv, gtk3, pkg-config, libxml2, llvm, perl, sqlite }:
4 GCC_BASE = "${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.uname.processor}-unknown-linux-gnu/${stdenv.cc.cc.version}";
5 in stdenv.mkDerivation rec {
10 url = "mirror://kernel/software/devel/sparse/dist/${pname}-${version}.tar.xz";
11 sha256 = "sha256-arKLSZG8au29c1UCkTYKpqs99B9ZIGqb3paQIIpuOHw=";
15 sed -i 's|"/usr/include"|"${stdenv.cc.libc.dev}/include"|' pre-process.c
16 sed -i 's|qx(\$ccom -print-file-name=)|"${GCC_BASE}"|' cgcc
17 makeFlags+=" PREFIX=$out"
20 nativeBuildInputs = [ pkg-config ];
21 buildInputs = [ gtk3 libxml2 llvm perl sqlite ];
23 buildFlags = [ "GCC_BASE:=${GCC_BASE}" ];
26 simple-execution = callPackage ./tests.nix { };
30 description = "Semantic parser for C";
31 homepage = "https://git.kernel.org/pub/scm/devel/sparse/sparse.git/";
32 license = licenses.mit;
33 platforms = platforms.linux;
34 maintainers = with maintainers; [ thoughtpolice jkarlson ];