nixpkgs/pkgs/by-name/mb/mblaze/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

63 lines
2.0 KiB
Nix

{ coreutils, fetchFromGitHub, fetchpatch, file, gawk, gnugrep, gnused
, installShellFiles, lib, libiconv, makeWrapper, stdenv, ruby
}:
stdenv.mkDerivation rec {
pname = "mblaze";
version = "1.2";
nativeBuildInputs = [ installShellFiles makeWrapper ];
buildInputs = [ libiconv ruby ];
src = fetchFromGitHub {
owner = "leahneukirchen";
repo = "mblaze";
rev = "v${version}";
sha256 = "sha256-LCyw3xGsYjsbExueRHVRqoJYluji9MmZq5zGclvSSDk=";
};
patches = [
(fetchpatch {
name = "LFS64.patch";
url = "https://github.com/leahneukirchen/mblaze/commit/1babebc12c3ea8d3395f00c9607e863866c190fc.patch";
hash = "sha256-0zTMM9Ay4mo7ATqCQRJPiR7Z53MsMLeup7Fa7lsdWo8=";
})
];
makeFlags = [ "PREFIX=$(out)" ];
enableParallelBuilding = true;
postInstall = ''
installShellCompletion contrib/_mblaze
'' + lib.optionalString (ruby != null) ''
install -Dt $out/bin contrib/msuck contrib/mblow
# 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
'';
meta = with lib; {
homepage = "https://github.com/leahneukirchen/mblaze";
description = "Unix utilities for processing and interacting with mail messages which are stored in maildir folders";
license = licenses.cc0;
platforms = platforms.all;
maintainers = [ maintainers.ajgrf ];
};
}