nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at fix-function-merge 44 lines 1.5 kB view raw
1{ callPackage, fetchurl, lib, stdenv, gtk3, pkg-config, libxml2, llvm, perl, sqlite }: 2 3let 4 GCC_BASE = "${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.uname.processor}-unknown-linux-gnu/${stdenv.cc.cc.version}"; 5in stdenv.mkDerivation rec { 6 pname = "sparse"; 7 version = "0.6.4"; 8 9 src = fetchurl { 10 url = "mirror://kernel/software/devel/sparse/dist/${pname}-${version}.tar.xz"; 11 sha256 = "sha256-arKLSZG8au29c1UCkTYKpqs99B9ZIGqb3paQIIpuOHw="; 12 }; 13 14 preConfigure = '' 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" 18 ''; 19 20 nativeBuildInputs = [ pkg-config ]; 21 buildInputs = [ gtk3 libxml2 llvm perl sqlite ]; 22 doCheck = true; 23 buildFlags = [ "GCC_BASE:=${GCC_BASE}" ]; 24 25 # Test failures with "fortify3" on, such as: 26 # +*** buffer overflow detected ***: terminated 27 # +Aborted (core dumped) 28 # error: Actual exit value does not match the expected one. 29 # error: expected 0, got 134. 30 # error: FAIL: test 'bool-float.c' failed 31 hardeningDisable = [ "fortify3" ]; 32 33 passthru.tests = { 34 simple-execution = callPackage ./tests.nix { }; 35 }; 36 37 meta = with lib; { 38 description = "Semantic parser for C"; 39 homepage = "https://git.kernel.org/pub/scm/devel/sparse/sparse.git/"; 40 license = licenses.mit; 41 platforms = platforms.linux; 42 maintainers = with maintainers; [ thoughtpolice jkarlson ]; 43 }; 44}