From ee9738c3f5603ed55271641fd741b22ec880eb5a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 6 Apr 2023 23:59:04 -0700 Subject: [PATCH 1/3] notmuch: fix cross Adapted from Void Linux commit 81c3c1884be1959337b55cd88d4748d17ac6c3de. --- .../mailreaders/notmuch/default.nix | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index 743f8eaa9f20e..d8f36eb8d8227 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -1,4 +1,9 @@ -{ fetchurl, lib, stdenv, makeWrapper +{ lib +, stdenv +, buildPackages +, fetchurl +, fetchpatch +, makeWrapper , pkg-config, gnupg , xapian, gmime3, sfsexp, talloc, zlib , doxygen, perl, texinfo @@ -28,6 +33,8 @@ stdenv.mkDerivation rec { pythonPackages.sphinx # (optional) documentation -> doc/INSTALL texinfo # (optional) documentation -> doc/INSTALL pythonPackages.cffi + gnupg + perl ] ++ lib.optional withEmacs emacs ++ lib.optional withRuby ruby ++ lib.optional withSfsexp makeWrapper; @@ -40,6 +47,19 @@ stdenv.mkDerivation rec { ] ++ lib.optional withRuby ruby ++ lib.optional withSfsexp sfsexp; + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/notmuch/patches/0001-configure-detect-version-by-compiler-for-build.patch"; + hash = "sha256-Xs4hw3BPXBh8jGmx6UZsnuiosBCtjo8MWQlWAAgqKgg="; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/notmuch/patches/0005-configure-drop-gmime-session-key-extraction-support-.patch"; + hash = "sha256-FXnNtkTqV7ZSIObQSwGu6THX0Rgvj4WeJySTIcJea1Y="; + }) + ]; + + XAPIAN_CONFIG = "${xapian}/bin/xapian-config"; + postPatch = '' patchShebangs configure test/ @@ -49,12 +69,20 @@ stdenv.mkDerivation rec { # do not override CFLAGS of the Makefile created by mkmf substituteInPlace bindings/Makefile.local \ --replace 'CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC"' "" + substituteInPlace configure \ + --replace 'pkg-config' "${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" + substituteInPlace configure \ + --replace './_check_x509_validity' 'true' + substituteInPlace configure \ + --replace './_check_session_keys' 'true' + '' + lib.optionalString withEmacs '' substituteInPlace emacs/notmuch-emacs-mua \ --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \ --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient' ''; + CC_FOR_BUILD="${buildPackages.stdenv.cc}/bin/cc"; configureFlags = [ "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" "--bashcompletiondir=${placeholder "out"}/share/bash-completion/completions" @@ -124,6 +152,8 @@ stdenv.mkDerivation rec { + lib.optionalString withSfsexp '' cp notmuch-git $out/bin/notmuch-git wrapProgram $out/bin/notmuch-git --prefix PATH : $out/bin:${lib.getBin git}/bin + '' + '' + mkdir -p $info ''; passthru = { From 5e6f02fe0eced3986888a62ecfd05902a1310fc0 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 7 Apr 2023 00:42:46 -0700 Subject: [PATCH 2/3] https://github.com/NixOS/nixpkgs/pull/225111#discussion_r1160513273 --- pkgs/applications/networking/mailreaders/notmuch/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index d8f36eb8d8227..a39a762d631f6 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -49,11 +49,11 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { - url = "https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/notmuch/patches/0001-configure-detect-version-by-compiler-for-build.patch"; + url = "https://raw.githubusercontent.com/void-linux/void-packages/8c1f637c706483577a22c8d4f2d06d5f041c9093/srcpkgs/notmuch/patches/0001-configure-detect-version-by-compiler-for-build.patch"; hash = "sha256-Xs4hw3BPXBh8jGmx6UZsnuiosBCtjo8MWQlWAAgqKgg="; }) (fetchpatch { - url = "https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/notmuch/patches/0005-configure-drop-gmime-session-key-extraction-support-.patch"; + url = "https://raw.githubusercontent.com/void-linux/void-packages/8c1f637c706483577a22c8d4f2d06d5f041c9093/srcpkgs/notmuch/patches/0005-configure-drop-gmime-session-key-extraction-support-.patch"; hash = "sha256-FXnNtkTqV7ZSIObQSwGu6THX0Rgvj4WeJySTIcJea1Y="; }) ]; From 226fb5e40377e00528ff482c562d9145a4684045 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 7 Apr 2023 00:44:14 -0700 Subject: [PATCH 3/3] default withEmacs to !emacs.meta.broken --- pkgs/applications/networking/mailreaders/notmuch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index a39a762d631f6..4ec3d2bb4bfe1 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -13,7 +13,7 @@ , ruby , testers , which, dtach, openssl, bash, gdb, man, git -, withEmacs ? true +, withEmacs ? !emacs.meta.broken , withRuby ? true , withSfsexp ? true # also installs notmuch-git, which requires sexp-support }: