1{ fetchurl, stdenv, pkgconfig, libxml2, llvm }:
2
3stdenv.mkDerivation rec {
4 name = "sparse-0.5.0";
5
6 src = fetchurl {
7 url = "mirror://kernel/software/devel/sparse/dist/${name}.tar.xz";
8 sha256 = "1mc86jc5xdrdmv17nqj2cam2yqygnj6ar1iqkwsx2y37ij8wy7wj";
9 };
10
11 preConfigure = ''
12 sed -i Makefile -e "s|^PREFIX=.*$|PREFIX=$out|g"
13 '';
14
15 nativeBuildInputs = [ pkgconfig ];
16 buildInputs = [ libxml2 llvm ];
17 doCheck = true;
18
19 meta = {
20 description = "Semantic parser for C";
21 homepage = "https://git.kernel.org/cgit/devel/sparse/sparse.git/";
22 license = stdenv.lib.licenses.mit;
23 platforms = stdenv.lib.platforms.linux;
24 maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
25 };
26}