-
-
Save jperras/54e38f195f641314414654ab64f3fed6 to your computer and use it in GitHub Desktop.
Adjusted mu.nix to allow for optional Guile linking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchFromGitHub, sqlite, pkgconfig, autoreconfHook, pmccabe | |
, xapian, glib, gmime3, texinfo , emacs, guile | |
, gtk3, webkitgtk, libsoup, icu | |
, withMug ? false | |
, batchSize ? null | |
, withGuile ? true }: | |
stdenv.mkDerivation rec { | |
pname = "mu"; | |
version = "1.4.3"; | |
src = fetchFromGitHub { | |
owner = "djcb"; | |
repo = "mu"; | |
rev = version; | |
sha256 = "1i9chd8ks1q4g5pyscsir6pw4kahkx3k8ckzbi8j3gr6jz1qzzsg"; | |
}; | |
postPatch = stdenv.lib.optionalString (batchSize != null) '' | |
sed -i lib/mu-store.cc --regexp-extended \ | |
-e 's@(constexpr auto BatchSize).*@\1 = ${toString batchSize};@' | |
''; | |
buildInputs = [ | |
sqlite xapian glib gmime3 texinfo emacs libsoup icu | |
] | |
++ stdenv.lib.optionals withMug [ gtk3 webkitgtk ] | |
++ stdenv.lib.optionals withGuile [ guile ]; | |
nativeBuildInputs = [ pkgconfig autoreconfHook pmccabe ]; | |
enableParallelBuilding = true; | |
preBuild = '' | |
# Fix mu4e-builddir (set it to $out) | |
substituteInPlace mu4e/mu4e-meta.el.in \ | |
--replace "@abs_top_builddir@" "$out" | |
''; | |
configureFlags = stdenv.lib.optional (!withGuile) [ "--disable-guile" ]; | |
# Install mug | |
postInstall = stdenv.lib.optionalString withMug '' | |
for f in mug ; do | |
install -m755 toys/$f/$f $out/bin/$f | |
done | |
''; | |
doCheck = true; | |
meta = with stdenv.lib; { | |
description = "A collection of utilties for indexing and searching Maildirs"; | |
license = licenses.gpl3Plus; | |
homepage = "https://www.djcbsoftware.nl/code/mu/"; | |
maintainers = with maintainers; [ antono peterhoeg ]; | |
platforms = platforms.mesaPlatforms; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When attempting to build via:
nix-build -A mu --arg withGuile false
The derivation still attempts to link against guile, meaning that
--disable-guile
is not passed as argument to./configure
. If I remove all the conditionals and simply setconfigureFlags = [ "--disable-guile" ];
, it builds correctly (without linking against guile).What am I doing wrong?