157 lines
6.0 KiB
Nix
157 lines
6.0 KiB
Nix
{
|
|
description = "mu and mu4e email package for emacs";
|
|
|
|
inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
|
|
|
|
outputs = { self, nixpkgs }:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs { inherit system; };
|
|
lib = pkgs.lib;
|
|
|
|
# One entry per .wrap file. `sha256`/patch `sha256` are the
|
|
# source_hash/patch_hash values from the .wrap, as-is (hex sha256 --
|
|
# Nix's `sha256 =` attr accepts hex directly).
|
|
subprojects = {
|
|
cli11 = {
|
|
dir = "CLI11-2.7.2";
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.7.2.tar.gz";
|
|
sha256 = "46eef3101da70852ec7af026e09d485ccee81813331c8c6052d39344443b83da";
|
|
};
|
|
};
|
|
fmt = {
|
|
dir = "fmt-12.0.0";
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/fmtlib/fmt/archive/12.0.0.tar.gz";
|
|
sha256 = "aa3e8fbb6a0066c03454434add1f1fc23299e85758ceec0d7d2d974431481e40";
|
|
};
|
|
patch = pkgs.fetchurl {
|
|
url = "https://wrapdb.mesonbuild.com/v2/fmt_12.0.0-1/get_patch";
|
|
sha256 = "307f288ebf3850abf2f0c50ac1fb07de97df9538d39146d802f3c0d6cada8998";
|
|
};
|
|
};
|
|
tabulate = {
|
|
dir = "tabulate-1.5";
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/p-ranav/tabulate/archive/refs/tags/v1.5.tar.gz";
|
|
sha256 = "16b289f46306283544bb593f4601e80d6ea51248fde52e910cc569ef08eba3fb";
|
|
};
|
|
patch = pkgs.fetchurl {
|
|
url = "https://wrapdb.mesonbuild.com/v2/tabulate_1.5-1/get_patch";
|
|
sha256 = "3c7c5f90b320d9096bc4335ff2c1f0c5b8e0c869d25c92eb4fce519609fb22f7";
|
|
};
|
|
};
|
|
tl-expected = {
|
|
dir = "expected-1.3.1";
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/TartanLlama/expected/archive/v1.3.1.tar.gz";
|
|
sha256 = "9a04f4f472fbb5c30bf60402f1ca626c4a76987f867978d0b8a35d7ab3fb8fe7";
|
|
};
|
|
patch = pkgs.fetchurl {
|
|
url = "https://wrapdb.mesonbuild.com/v2/tl-expected_1.3.1-1/get_patch";
|
|
sha256 = "91cfeae04ba6ea05792e68a37781236a7045b9e2e4e0c8b7093fd8c3e43b0bad";
|
|
};
|
|
};
|
|
tl-optional = {
|
|
dir = "optional-1.1.0";
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/TartanLlama/optional/archive/refs/tags/v1.1.0.tar.gz";
|
|
sha256 = "88ece79f3de5ccaec4191951a222f95cc80c4381dafd3163bdb1ff87cedf3118";
|
|
};
|
|
patch = pkgs.fetchurl {
|
|
url = "https://wrapdb.mesonbuild.com/v2/tl-optional_1.1.0-1/get_patch";
|
|
sha256 = "b64e2a89e44279074d845de4fce85151a27ce65298849e87f6069a77967d4eb7";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Build the shell commands that stage each subproject's source (and,
|
|
# if present, unzip its wrapdb "patch" overlay on top) into
|
|
# subprojects/<dir>, exactly like `meson subprojects download` would.
|
|
stageSubprojects = lib.concatStrings (lib.mapAttrsToList
|
|
(name: sp: ''
|
|
mkdir -p "subprojects/${sp.dir}"
|
|
tar xf ${sp.src} -C subprojects --strip-components=0
|
|
${lib.optionalString (sp ? patch) ''
|
|
unzip -o -q ${sp.patch} -d "subprojects/${sp.dir}"
|
|
''}
|
|
'') subprojects);
|
|
in {
|
|
packages.${system}.default =
|
|
with pkgs;
|
|
stdenv.mkDerivation {
|
|
name = "mu4e";
|
|
src = self;
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
meson
|
|
ninja
|
|
texinfo
|
|
emacs
|
|
python3
|
|
cmake
|
|
cld2
|
|
unzip
|
|
];
|
|
|
|
buildInputs = [ glib gmime3 xapian ];
|
|
|
|
postPatch = stageSubprojects + ''
|
|
# Scripts vendored via fetchurl (e.g. CLI11's scripts/ExtractVersion.py)
|
|
# keep their original #!/usr/bin/env python3 shebang, which doesn't
|
|
# resolve inside the Nix build sandbox. patchShebangs rewrites them
|
|
# to point at the python3 in nativeBuildInputs.
|
|
patchShebangs subprojects
|
|
'';
|
|
|
|
mesonFlags = [
|
|
# "--debug"
|
|
"-Dscm=disabled"
|
|
"-Dreadline=disabled"
|
|
"-Demacs=${emacs}/bin/emacs"
|
|
# CLI11's own meson.build pulls in a catch2 subproject for its
|
|
# test suite. We only consume CLI11 as a library, so disable its
|
|
# tests option to avoid needing to vendor catch2 as well.
|
|
"-Dcli11:tests=disabled"
|
|
];
|
|
|
|
# preConfigure = ''
|
|
# echo "=== DEBUG: Environment before meson configure ==="
|
|
# echo "PWD: $(pwd)"
|
|
# echo "Python version:"
|
|
# python3 --version || echo "python3 not available"
|
|
# echo "Python path:"
|
|
# #which python3 || echo "python3 not in PATH"
|
|
# echo "PATH: $PATH"
|
|
# echo "Meson version:"
|
|
# meson --version
|
|
# echo "Available files in current directory:"
|
|
# ls -la
|
|
# echo "Checking for Python scripts:"
|
|
# find . -name "*.py" -type f | head -10
|
|
# echo "=============================================="
|
|
# '';
|
|
|
|
meta = with lib; {
|
|
description = "Email indexer and Emacs client (mu4e)";
|
|
longDescription = ''
|
|
mu is a tool for dealing with email messages stored in the
|
|
Maildir-format. mu's purpose in life is to help you to quickly find the
|
|
messages you need; in addition, it allows you to view messages, extract
|
|
attachments, create new maildirs, and so on.
|
|
|
|
mu4e is an Emacs-based e-mail client that uses mu as its back-end.
|
|
'';
|
|
license = licenses.gpl3Plus;
|
|
homepage = "https://www.djcbsoftware.nl/code/mu/";
|
|
changelog = "https://github.com/djcb/mu/blob/v${version}/NEWS.org";
|
|
maintainers = with maintainers; [ antono chvp peterhoeg ];
|
|
platforms = platforms.unix;
|
|
mainProgram = "mu";
|
|
};
|
|
};
|
|
};
|
|
}
|