[Nix-dev] [PATCH] Fix git-send-email.

David Brown nix at davidb.org
Sat May 15 08:54:34 CEST 2010


git-send-email depends on Net::SMTP and Net::SMTP::SSL.  Make
sendEmailSupport a config for git, and bring these libraries.  Wrap
the send-email script, or replace with a not supported script.
---
 .../version-management/git-and-tools/default.nix   |    8 +++
 .../git-and-tools/git/default.nix                  |   15 +++++-
 pkgs/top-level/perl-packages.nix                   |   54 ++++++++++++++++++++
 3 files changed, 76 insertions(+), 1 deletions(-)

diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index 699007b..f99de47 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -15,13 +15,21 @@ rec {
       cpio tcl tk makeWrapper subversion;
     svnSupport = config "svnSupport" false; # for git-svn support
     guiSupport = config "guiSupport" false;
+    sendEmailSupport = config "sendEmailSupport" false;
     perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey];
+    smtpPerlLibs = [
+      perlPackages.NetSMTP perlPackages.NetSMTPSSL
+      perlPackages.IOSocketSSL perlPackages.NetSSLeay
+      perlPackages.MIMEBase64 perlPackages.AuthenSASL
+      perlPackages.DigestHMAC
+    ];
   };
 
   # The full-featured Git.
   gitFull = git.override {
     svnSupport = true;
     guiSupport = true;
+    sendEmailSupport = true;
   };
 
   gitGit = import ./git/git-git.nix {
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index 00254c9..8b67530 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -1,9 +1,10 @@
 { fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio
 , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
 , libxslt, tcl, tk, makeWrapper
-, svnSupport, subversion, perlLibs
+, svnSupport, subversion, perlLibs, smtpPerlLibs
 , guiSupport
 , pythonSupport ? true
+, sendEmailSupport
 }:
 
 let
@@ -60,6 +61,18 @@ stdenv.mkDerivation rec {
         notSupported $out/bin/git-svn "reinstall with config git = { svnSupport = true } set"
        '')
 
+   + (if sendEmailSupport then
+      ''# wrap git-send-email
+        gitperllib=$out/lib/perl5/site_perl
+        for i in ${builtins.toString smtpPerlLibs}; do
+          gitperllib=$gitperllib:$i/lib/perl5/site_perl
+        done
+        wrapProgram "$out/libexec/git-core/git-send-email"     \
+                     --set GITPERLLIB "$gitperllib" ''
+       else '' # replace git-send-email by notification script
+        notSupported $out/bin/git-send-email "reinstall with config git = { sendEmailSupport = true } set"
+       '')
+
    + ''# Install man pages and Info manual
        make PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \
          -C Documentation ''
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 19ee6ac..e4a95bf 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -88,6 +88,15 @@ rec {
     };
   };
 
+  AuthenSASL = buildPerlPackage rec {
+    name = "Authen-SASL-2.1401";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/G/GB/GBARR/${name}.tar.gz";
+      sha256 = "1vx97xnqj5jqlh767l04jbqmsiqd5qcbw2jnbd3qh7fhh0slff6d";
+    };
+    propagatedBuildInputs = [DigestHMAC];
+  };
+
   Autobox = buildPerlPackage rec {
     name = "autobox-2.55";
     src = fetchurl {
@@ -1429,6 +1438,16 @@ rec {
     };
   };
 
+  IOSocketSSL = buildPerlPackage {
+    name = "IO-Socket-SSL-1.33";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/S/SU/SULLR/IO-Socket-SSL-1.33.tar.gz;
+      sha256 = "1lpp2cs794d989b9gfhssjv1bkcs9lmrkjcpnxsavj7822izs4xj";
+    };
+    propagatedBuildInputs = [NetSSLeay];
+    # TODO: IOSocketINET6
+  };
+
   IOString = buildPerlPackage rec {
     name = "IO-String-1.08";
     src = fetchurl {
@@ -1668,6 +1687,14 @@ rec {
     propagatedBuildInputs = [TimeDate TestPod];
   };
 
+  MIMEBase64 = buildPerlPackage rec {
+    name = "MIME-Base64-3.09";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/G/GA/GAAS/${name}.tar.gz";
+      sha256 = "1gi2zyxwkkmyng8jawfnbxpsybvybz6h6ryq0wfdljmmjpjbmzzc";
+    };
+  };
+
   MIMETypes = buildPerlPackage rec {
     name = "MIME-Types-1.27";
     src = fetchurl {
@@ -1846,6 +1873,33 @@ rec {
     doCheck = false; # seems to hang waiting for connections
   };
 
+  NetSMTP = buildPerlPackage {
+    name = "Net-SMTP-1.22";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/G/GB/GBARR/libnet-1.22.tar.gz;
+      sha256 = "113c36qilbvd69yhkm2i2ba20ajff7cdpgvlqx96j9bb1hfmhb1p";
+    };
+  };
+
+  NetSMTPSSL = buildPerlPackage {
+    name = "Net-SMTP-SSL-1.01";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/C/CW/CWEST/Net-SMTP-SSL-1.01.tar.gz;
+      sha256 = "12b2xvrd253ngvzwf81s9han4jr94l39vs5ca70pzr3wpi39qn8k";
+    };
+    propagatedBuildInputs = [IOSocketSSL];
+  };
+
+  NetSSLeay = buildPerlPackage {
+    name = "Net-SSLeay-1.36";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/F/FL/FLORA/Net-SSLeay-1.36.tar.gz;
+      sha256 = "1kjk5kdwsklchxrv21m4ii80akbxrg3i6y4zwfb91an5cdr8jqp2";
+    };
+    buildInputs = [pkgs.openssl];
+    OPENSSL_PREFIX = pkgs.openssl;
+  };
+
   NetTwitterLite = buildPerlPackage {
     name = "Net-Twitter-Lite-0.08003";
 
-- 
1.7.1




More information about the nix-dev mailing list