2008-10-28 08:43:44 +00:00
|
|
|
{ stdenv, fetchurl, gettext, emacs }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2009-07-13 15:54:01 +01:00
|
|
|
name = "cflow-1.3";
|
2008-10-28 08:43:44 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/cflow/${name}.tar.bz2";
|
2009-07-13 15:54:01 +01:00
|
|
|
sha256 = "1nlmgcjsy1rl5zpqz9f8mf74faq3rm725hhpf11b8w80sniqgnnk";
|
2008-10-28 08:43:44 +00:00
|
|
|
};
|
|
|
|
|
2008-10-28 10:25:10 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "src/cflow.h" \
|
|
|
|
--replace "/usr/bin/cpp" \
|
|
|
|
"$(cat ${stdenv.gcc}/nix-support/orig-gcc)/bin/cpp"
|
|
|
|
'';
|
|
|
|
|
2009-09-16 15:53:27 +01:00
|
|
|
buildInputs = [ gettext ] ++
|
|
|
|
|
|
|
|
# We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
|
|
|
|
stdenv.lib.optional
|
|
|
|
(! (stdenv.lib.lists.any (x: stdenv.system == x)
|
|
|
|
[ "i686-darwin" "i686-cygwin" ]))
|
|
|
|
emacs;
|
2008-10-28 08:43:44 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GNU cflow, a tool to analyze the control flow of C programs";
|
|
|
|
|
|
|
|
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 = "GPLv3+";
|
|
|
|
|
|
|
|
homepage = http://www.gnu.org/software/cflow/;
|
2009-07-13 15:54:01 +01:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
2009-09-16 16:09:58 +01:00
|
|
|
|
|
|
|
/* On Darwin, build fails with:
|
|
|
|
|
|
|
|
Undefined symbols:
|
|
|
|
"_argp_program_version", referenced from:
|
|
|
|
_argp_program_version$non_lazy_ptr in libcflow.a(argp-parse.o)
|
|
|
|
ld: symbol(s) not found
|
|
|
|
*/
|
|
|
|
platforms = stdenv.lib.platforms.allBut "i686-darwin";
|
2008-10-28 08:43:44 +00:00
|
|
|
};
|
|
|
|
}
|