2021-09-23 15:35:13 +00:00
|
|
|
{ callPackage, fetchurl, lib, stdenv, gtk3, pkg-config, libxml2, llvm, perl, sqlite }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
let
|
|
|
|
GCC_BASE = "${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.uname.processor}-unknown-linux-gnu/${stdenv.cc.cc.version}";
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "sparse";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.6.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "mirror://kernel/software/devel/sparse/dist/${pname}-${version}.tar.xz";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-arKLSZG8au29c1UCkTYKpqs99B9ZIGqb3paQIIpuOHw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
2021-09-23 15:35:13 +00:00
|
|
|
sed -i 's|"/usr/include"|"${stdenv.cc.libc.dev}/include"|' pre-process.c
|
|
|
|
sed -i 's|qx(\$ccom -print-file-name=)|"${GCC_BASE}"|' cgcc
|
|
|
|
makeFlags+=" PREFIX=$out"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-09-23 15:35:13 +00:00
|
|
|
buildInputs = [ gtk3 libxml2 llvm perl sqlite ];
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = true;
|
2022-10-30 15:09:59 +00:00
|
|
|
buildFlags = [ "GCC_BASE:=${GCC_BASE}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
passthru.tests = {
|
|
|
|
simple-execution = callPackage ./tests.nix { };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Semantic parser for C";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/devel/sparse/sparse.git/";
|
2021-09-23 15:35:13 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice jkarlson ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|