2017-02-19 01:21:11 +00:00
|
|
|
{ stdenv, fetchurl, cmake, makeWrapper
|
2017-02-10 21:22:49 +00:00
|
|
|
, llvm, clang-unwrapped
|
|
|
|
, flex
|
|
|
|
, zlib
|
2018-12-15 03:50:31 +00:00
|
|
|
, perlPackages
|
2017-02-10 21:22:49 +00:00
|
|
|
, utillinux
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-06 04:12:10 +01:00
|
|
|
pname = "creduce";
|
|
|
|
version = "2.9.0";
|
2017-02-10 21:22:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-05-06 04:12:10 +01:00
|
|
|
url = "https://embed.cs.utah.edu/${pname}/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "1b833z0g1hich68kzbkpfc26xb8w2phfl5savy8c6ir9ihwy1a8w";
|
2017-02-10 21:22:49 +00:00
|
|
|
};
|
|
|
|
|
2018-07-15 05:54:21 +01:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
2017-02-10 21:22:49 +00:00
|
|
|
buildInputs = [
|
|
|
|
# Ensure stdenv's CC is on PATH before clang-unwrapped
|
|
|
|
stdenv.cc
|
|
|
|
# Actual deps:
|
|
|
|
llvm clang-unwrapped
|
|
|
|
flex zlib
|
2018-12-15 03:50:31 +00:00
|
|
|
] ++ (with perlPackages; [ perl ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey ]);
|
2017-02-10 21:22:49 +00:00
|
|
|
|
|
|
|
# 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:
|
2018-11-20 06:03:02 +00:00
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isLinux ''
|
2017-02-10 21:22:49 +00:00
|
|
|
substituteInPlace creduce/creduce_utils.pm --replace \
|
|
|
|
lscpu ${utillinux}/bin/lscpu
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-02-19 01:21:11 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB"
|
|
|
|
'';
|
|
|
|
|
2017-02-10 21:22:49 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A C program reducer";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://embed.cs.utah.edu/creduce;
|
2017-02-10 21:22:49 +00:00
|
|
|
# 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 = [ maintainers.dtzWill ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|