2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, gettext, emacs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "cflow";
|
2022-02-20 05:27:41 +00:00
|
|
|
version = "1.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "mirror://gnu/${pname}/${pname}-${version}.tar.bz2";
|
2022-02-20 05:27:41 +00:00
|
|
|
sha256 = "sha256-0BFGyvkAHiZhM0F8KoJYpktfwW/LCCoU9lKCBNDJcIY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "src/cflow.h" \
|
|
|
|
--replace "/usr/bin/cpp" \
|
|
|
|
"$(cat ${stdenv.cc}/nix-support/orig-cc)/bin/cpp"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ gettext ] ++
|
|
|
|
# We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.optional
|
|
|
|
(! (lib.lists.any (x: stdenv.hostPlatform.system == x)
|
2020-04-24 23:36:52 +00:00
|
|
|
[ "i686-cygwin" ]))
|
|
|
|
emacs;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tool to analyze the control flow of C programs";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cflow";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GNU cflow analyzes a collection of C source files and prints a
|
|
|
|
graph, charting control flow within the program.
|
|
|
|
|
|
|
|
GNU cflow is able to produce both direct and inverted flowgraphs
|
|
|
|
for C sources. Optionally a cross-reference listing can be
|
|
|
|
generated. Two output formats are implemented: POSIX and GNU
|
|
|
|
(extended).
|
|
|
|
|
|
|
|
The package also provides Emacs major mode for examining the
|
|
|
|
produced flowcharts in Emacs.
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
|
|
|
|
homepage = "https://www.gnu.org/software/cflow/";
|
|
|
|
|
|
|
|
maintainers = [ maintainers.vrthra ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|