From 03ae8729d469c2252f17ef7af2bff029f07f98ce Mon Sep 17 00:00:00 2001 From: Nicolas Dudebout Date: Fri, 16 Sep 2016 20:55:24 -0400 Subject: [PATCH 1/4] cscope: do all emacs mode creation in postInstall One part of the emacs mode creation was done in preConfigure, and one in postInstall, but both could be done together. --- pkgs/development/tools/misc/cscope/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index 4685787af5f7..924277c53ed4 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -8,13 +8,6 @@ stdenv.mkDerivation rec { sha256 = "07jdhxvp3dv7acvp0pwsdab1g2ncxjlcf838lj7vxgjs1p26lwzb"; }; - preConfigure = '' - sed -i "contrib/xcscope/cscope-indexer" \ - -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g" - sed -i "contrib/xcscope/xcscope.el" \ - -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g"; - ''; - configureFlags = "--with-ncurses=${ncurses.dev}"; buildInputs = [ ncurses ]; @@ -24,6 +17,11 @@ stdenv.mkDerivation rec { # Install Emacs mode. cd "contrib/xcscope" + sed -i "cscope-indexer" \ + -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g" + sed -i "xcscope.el" \ + -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g"; + mkdir -p "$out/libexec/cscope" cp "cscope-indexer" "$out/libexec/cscope" From 2dc6e411476462a3f22664fe256ce5b7fc1dcead Mon Sep 17 00:00:00 2001 From: Nicolas Dudebout Date: Fri, 16 Sep 2016 20:57:53 -0400 Subject: [PATCH 2/4] 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. --- pkgs/development/tools/misc/cscope/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index 924277c53ed4..c5578e10abf1 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -1,4 +1,6 @@ -{ fetchurl, stdenv, ncurses, pkgconfig, emacs}: +{ fetchurl, stdenv, ncurses, pkgconfig +, emacsSupport ? true, emacs +}: stdenv.mkDerivation rec { name = "cscope-15.8a"; @@ -11,10 +13,9 @@ stdenv.mkDerivation rec { configureFlags = "--with-ncurses=${ncurses.dev}"; buildInputs = [ ncurses ]; - nativeBuildInputs = [ pkgconfig emacs ]; + nativeBuildInputs = [ pkgconfig ] + stdenv.lib.optional emacsSupport emacs; - postInstall = '' - # Install Emacs mode. + postInstall = stdenv.lib.optionalString emacsSupport '' cd "contrib/xcscope" sed -i "cscope-indexer" \ From 718678bba8005b7828ee0f70dd5fd8378f668022 Mon Sep 17 00:00:00 2001 From: Nicolas Dudebout Date: Fri, 16 Sep 2016 21:06:01 -0400 Subject: [PATCH 3/4] cscope: remove unused dependency on pkgconfig --- pkgs/development/tools/misc/cscope/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index c5578e10abf1..b8b907fd1f74 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, ncurses, pkgconfig +{ fetchurl, stdenv, ncurses , emacsSupport ? true, emacs }: @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { configureFlags = "--with-ncurses=${ncurses.dev}"; buildInputs = [ ncurses ]; - nativeBuildInputs = [ pkgconfig ] + stdenv.lib.optional emacsSupport emacs; + nativeBuildInputs = stdenv.lib.optional emacsSupport emacs; postInstall = stdenv.lib.optionalString emacsSupport '' cd "contrib/xcscope" From 9cea84a08529ce0fd59da7331ee3e8b386952b85 Mon Sep 17 00:00:00 2001 From: Nicolas Dudebout Date: Fri, 16 Sep 2016 21:06:22 -0400 Subject: [PATCH 4/4] cscope: 15.8a -> 15.8b --- pkgs/development/tools/misc/cscope/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index b8b907fd1f74..2dff98a212d6 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -3,11 +3,11 @@ }: stdenv.mkDerivation rec { - name = "cscope-15.8a"; + name = "cscope-15.8b"; src = fetchurl { url = "mirror://sourceforge/cscope/${name}.tar.gz"; - sha256 = "07jdhxvp3dv7acvp0pwsdab1g2ncxjlcf838lj7vxgjs1p26lwzb"; + sha256 = "1byk29rcpyygrnr03h5j3y8j0aqxldd9dr5ihi9q982sy28x12a8"; }; configureFlags = "--with-ncurses=${ncurses.dev}";