1{ fetchurl, stdenv, ncurses
2, emacsSupport ? true, emacs
3}:
4
5stdenv.mkDerivation rec {
6 name = "cscope-15.9";
7
8 src = fetchurl {
9 url = "mirror://sourceforge/cscope/${name}.tar.gz";
10 sha256 = "0ngiv4aj3rr35k3q3wjx0y19gh7i1ydqa0cqip6sjwd8fph5ll65";
11 };
12
13 configureFlags = [ "--with-ncurses=${ncurses.dev}" ];
14
15 buildInputs = [ ncurses ];
16 nativeBuildInputs = stdenv.lib.optional emacsSupport emacs;
17
18 postInstall = stdenv.lib.optionalString emacsSupport ''
19 cd "contrib/xcscope"
20
21 sed -i "cscope-indexer" \
22 -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g"
23 sed -i "xcscope.el" \
24 -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g";
25
26 mkdir -p "$out/libexec/cscope"
27 cp "cscope-indexer" "$out/libexec/cscope"
28
29 mkdir -p "$out/share/emacs/site-lisp"
30 emacs --batch --eval '(byte-compile-file "xcscope.el")'
31 cp xcscope.el{,c} "$out/share/emacs/site-lisp"
32 '';
33
34 meta = {
35 description = "A developer's tool for browsing source code";
36
37 longDescription = ''
38 Cscope is a developer's tool for browsing source code. It has
39 an impeccable Unix pedigree, having been originally developed at
40 Bell Labs back in the days of the PDP-11. Cscope was part of
41 the official AT&T Unix distribution for many years, and has been
42 used to manage projects involving 20 million lines of code!
43 '';
44
45 license = "BSD-style";
46
47 homepage = "http://cscope.sourceforge.net/";
48
49 maintainers = with stdenv.lib.maintainers; [viric];
50
51 platforms = stdenv.lib.platforms.unix;
52 };
53}