depot/third_party/nixpkgs/pkgs/tools/text/mb2md/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

38 lines
879 B
Nix

{ stdenv, fetchurl, makeWrapper, perlPackages }:
let
perlDeps = with perlPackages; [ TimeDate ];
in
stdenv.mkDerivation rec {
version = "3.20";
pname = "mb2md";
src = fetchurl {
url = "http://batleth.sapienti-sat.org/projects/mb2md/mb2md-${version}.pl.gz";
sha256 = "0bvkky3c90738h3skd2f1b2yy5xzhl25cbh9w2dy97rs86ssjidg";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perlPackages.perl ];
unpackPhase = ''
sourceRoot=.
gzip -d < $src > mb2md.pl
'';
installPhase = ''
install -D $sourceRoot/mb2md.pl $out/bin/mb2md
'';
postFixup = ''
wrapProgram $out/bin/mb2md \
--set PERL5LIB "${perlPackages.makePerlPath perlDeps}"
'';
meta = with stdenv.lib; {
description = "mbox to maildir tool";
license = licenses.publicDomain;
platforms = platforms.all;
maintainers = [ maintainers.jb55 ];
};
}