From f96582fc609f576bdf63ba94b2fe954f107b6c69 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Thu, 24 Sep 2015 09:31:43 +0000 Subject: [PATCH] mercurial: add package for crecord extension as optional dependency, include by default in mercurialFull --- .../version-management/mercurial/default.nix | 9 +++++- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 28 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 62f2cc80d6fd..5a44240fa769 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, python, makeWrapper, docutils, unzip, hg-git, dulwich -, guiSupport ? false, tk ? null, curses +, guiSupport ? false, tk ? null, hg-crecord ? null, curses , ApplicationServices }: let @@ -36,6 +36,13 @@ stdenv.mkDerivation { WRAP_TK=" --set TK_LIBRARY \"${tk}/lib/${tk.libPrefix}\" --set HG \"$out/bin/hg\" --prefix PATH : \"${tk}/bin\" " + '') + (stdenv.lib.optionalString (hg-crecord != null) + '' + mkdir -p $out/etc/mercurial + cat >> $out/etc/mercurial/hgrc << EOF + [extensions] + crecord=${hg-crecord}/${python.sitePackages}/crecord + EOF '') + '' for i in $(cd $out/bin && ls); do diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0607bc278519..b16c179c7c62 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11934,7 +11934,7 @@ let guiSupport = false; # use mercurialFull to get hgk GUI }; - mercurialFull = appendToName "full" (pkgs.mercurial.override { guiSupport = true; }); + mercurialFull = appendToName "full" (pkgs.mercurial.override { inherit (pythonPackages) hg-crecord; guiSupport = true; }); merkaartor = callPackage ../applications/misc/merkaartor { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b9e99efb3f64..5983ff67a3e5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5720,6 +5720,34 @@ let }; + hg-crecord = buildPythonPackage rec { + rev = "5cfaabfe9cb9f0a0d6837956d73127f290a213be"; + name = "hg-crecord-${rev}"; + disabled = isPy3k; + + src = pkgs.fetchurl { + url = "https://bitbucket.org/edgimar/crecord/get/${builtins.substring 0 12 rev}.tar.gz"; + sha256 = "02003fa5620ec40a5ad0d7cede2e65c2cb398a7fe4e1ee26bd3396a87d63ad35"; + }; + + # crecord comes as just a bare directory + configurePhase = " "; + buildPhase = "${python.executable} -m compileall crecord"; + installPhase = '' + mkdir -p $out/${python.sitePackages} + cp -Lr crecord $out/${python.sitePackages}/ + ''; + + # there ain't none + doCheck = false; + + meta = { + description = "Mercurial extension for selecting graphically which files/hunk/lines to commit"; + homepage = https://bitbucket.org/edgimar/crecord; + }; + }; + + docutils = buildPythonPackage rec { name = "docutils-0.12";