Files
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
makeWrapper,
llvm,
libclang,
flex,
zlib,
perlPackages,
util-linux,
}:
stdenv.mkDerivation {
pname = "creduce";
version = "2.10.0-unstable-2024-06-01";
src = fetchFromGitHub {
owner = "csmith-project";
repo = "creduce";
rev = "31e855e290970cba0286e5032971509c0e7c0a80";
hash = "sha256-RbxFqZegsCxnUaIIA5OfTzx1wflCPeF+enQt90VwMgA=";
};
postPatch =
# On Linux, c-reduce's preferred way to reason about
# the cpu architecture/topology is to use 'lscpu',
# so let's make sure it knows where to find it:
lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace creduce/creduce_utils.pm --replace \
lscpu ${util-linux}/bin/lscpu
'';
nativeBuildInputs = [
cmake
makeWrapper
llvm.dev
];
buildInputs = [
# Ensure stdenv's CC is on PATH before clang-unwrapped
stdenv.cc
# Actual deps:
llvm
libclang
flex
zlib
]
++ (with perlPackages; [
perl
ExporterLite
FileWhich
GetoptTabular
RegexpCommon
TermReadKey
]);
postInstall = ''
wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB"
'';
meta = with lib; {
description = "C program reducer";
mainProgram = "creduce";
homepage = "https://embed.cs.utah.edu/creduce";
# Officially, the license is: https://github.com/csmith-project/creduce/blob/master/COPYING
license = licenses.ncsa;
longDescription = ''
C-Reduce is a tool that takes a large C or C++ program that has a
property of interest (such as triggering a compiler bug) and
automatically produces a much smaller C/C++ program that has the same
property. It is intended for use by people who discover and report
bugs in compilers and other tools that process C/C++ code.
'';
maintainers = [ ];
platforms = platforms.all;
};
}