push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
{
callPackage,
fetchgit,
lib,
stdenv,
gtk3,
pkg-config,
libxml2,
llvm,
perl,
sqlite,
}:
let
GCC_BASE = "${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.uname.processor}-unknown-linux-gnu/${stdenv.cc.cc.version}";
in
stdenv.mkDerivation {
pname = "sparse";
version = "0.6.4-unstable-2024-02-03";
src = fetchgit {
url = "https://git.kernel.org/pub/scm/devel/sparse/sparse.git";
rev = "0196afe16a50c76302921b139d412e82e5be2349";
hash = "sha256-Fft3hm988Xw92WIwXEoVoX7xzzkDhKy+bn9YuQIOhSk=";
};
preConfigure = ''
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=${placeholder "out"}"
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gtk3
libxml2
llvm
perl
sqlite
];
doCheck = true;
buildFlags = [ "GCC_BASE:=${GCC_BASE}" ];
# Test failures with "fortify3" on, such as:
# +*** buffer overflow detected ***: terminated
# +Aborted (core dumped)
# error: Actual exit value does not match the expected one.
# error: expected 0, got 134.
# error: FAIL: test 'bool-float.c' failed
hardeningDisable = [ "fortify3" ];
passthru.tests = {
simple-execution = callPackage ./tests.nix { };
};
meta = with lib; {
description = "Semantic parser for C";
homepage = "https://git.kernel.org/pub/scm/devel/sparse/sparse.git/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [
thoughtpolice
jkarlson
];
};
}

View File

@@ -0,0 +1,36 @@
{
runCommand,
gcc,
sparse,
writeText,
}:
let
src = writeText "CODE.c" ''
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
return EXIT_SUCCESS;
}
'';
in
runCommand "${sparse.pname}-tests"
{
buildInputs = [
gcc
sparse
];
meta.timeout = 3;
}
''
set -eu
${sparse}/bin/cgcc ${src} > output 2>&1 || ret=$?
if [[ -z $(<output) ]]; then
mv output $out
else
echo "Test build returned $ret"
cat output
exit 1
fi
''