cscope: make emacs support optional

Other nixpkgs offer cscope-emacs integration and they use package.el to
register the package. When using such package, only the cscope binary is
required.
This commit is contained in:
Nicolas Dudebout 2016-09-16 20:57:53 -04:00
parent 03ae8729d4
commit 2dc6e41147

View File

@ -1,4 +1,6 @@
{ fetchurl, stdenv, ncurses, pkgconfig, emacs}: { fetchurl, stdenv, ncurses, pkgconfig
, emacsSupport ? true, emacs
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cscope-15.8a"; name = "cscope-15.8a";
@ -11,10 +13,9 @@ stdenv.mkDerivation rec {
configureFlags = "--with-ncurses=${ncurses.dev}"; configureFlags = "--with-ncurses=${ncurses.dev}";
buildInputs = [ ncurses ]; buildInputs = [ ncurses ];
nativeBuildInputs = [ pkgconfig emacs ]; nativeBuildInputs = [ pkgconfig ] + stdenv.lib.optional emacsSupport emacs;
postInstall = '' postInstall = stdenv.lib.optionalString emacsSupport ''
# Install Emacs mode.
cd "contrib/xcscope" cd "contrib/xcscope"
sed -i "cscope-indexer" \ sed -i "cscope-indexer" \