2021-05-31 01:58:14 +01:00
|
|
|
{ coreutils, fetchFromGitHub, fetchpatch, file, gawk, gnugrep, gnused
|
|
|
|
, installShellFiles, less, lib, libiconv, makeWrapper, nano, stdenv, ruby
|
|
|
|
}:
|
2018-01-06 14:59:36 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "mblaze";
|
2021-01-20 04:58:52 +00:00
|
|
|
version = "1.1";
|
2018-01-06 14:59:36 +00:00
|
|
|
|
2021-05-31 01:58:14 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-04-15 13:04:47 +01:00
|
|
|
buildInputs = [ ruby ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
|
2018-01-13 11:48:37 +00:00
|
|
|
|
2018-01-06 14:59:36 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-10-05 15:16:02 +01:00
|
|
|
owner = "leahneukirchen";
|
2018-01-06 14:59:36 +00:00
|
|
|
repo = "mblaze";
|
|
|
|
rev = "v${version}";
|
2021-01-20 04:58:52 +00:00
|
|
|
sha256 = "sha256-Ho2Qoxs93ig4yYUOaoqdYnLA8Y4+7CfRM0dju89JOa4=";
|
2018-01-06 14:59:36 +00:00
|
|
|
};
|
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2018-01-06 14:59:36 +00:00
|
|
|
|
2021-03-26 13:45:50 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-02-24 01:07:08 +00:00
|
|
|
postInstall = ''
|
2020-10-05 15:16:02 +01:00
|
|
|
installShellCompletion contrib/_mblaze
|
2020-04-15 13:04:47 +01:00
|
|
|
'' + lib.optionalString (ruby != null) ''
|
|
|
|
install -Dt $out/bin contrib/msuck contrib/mblow
|
2021-05-31 01:58:14 +01:00
|
|
|
|
|
|
|
# The following wrappings are used to preserve the executable
|
|
|
|
# names (the value of $0 in a script). The script mcom is
|
|
|
|
# designed to be run directly or via symlinks such as mrep. Using
|
|
|
|
# symlinks changes the value of $0 in the script, and makes it
|
|
|
|
# behave differently. When using the wrapProgram tool, the resulting
|
|
|
|
# wrapper breaks this behaviour. The following wrappers preserve it.
|
|
|
|
|
|
|
|
mkdir -p $out/wrapped
|
|
|
|
for x in mcom mbnc mfwd mrep; do
|
|
|
|
mv $out/bin/$x $out/wrapped
|
|
|
|
makeWrapper $out/wrapped/$x $out/bin/$x \
|
|
|
|
--argv0 $out/bin/$x \
|
|
|
|
--prefix PATH : $out/bin \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [
|
|
|
|
coreutils file gawk gnugrep gnused
|
|
|
|
]}
|
|
|
|
done
|
2019-02-24 01:07:08 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-15 13:04:47 +01:00
|
|
|
meta = with lib; {
|
2020-10-05 15:16:02 +01:00
|
|
|
homepage = "https://github.com/leahneukirchen/mblaze";
|
|
|
|
description = "Unix utilities for processing and interacting with mail messages which are stored in maildir folders";
|
2018-01-06 14:59:36 +00:00
|
|
|
license = licenses.cc0;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.ajgrf ];
|
|
|
|
};
|
|
|
|
}
|