Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notmuch: fix cross #225111

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions pkgs/applications/networking/mailreaders/notmuch/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,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
}:
Expand All @@ -28,6 +33,8 @@ stdenv.mkDerivation rec {
pythonPackages.sphinx # (optional) documentation -> doc/INSTALL
texinfo # (optional) documentation -> doc/INSTALL
pythonPackages.cffi
gnupg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure the gnupg and perl in buildInputs are still needed?

perl
] ++ lib.optional withEmacs emacs
++ lib.optional withRuby ruby
++ lib.optional withSfsexp makeWrapper;
Expand All @@ -40,6 +47,19 @@ stdenv.mkDerivation rec {
] ++ lib.optional withRuby ruby
++ lib.optional withSfsexp sfsexp;

patches = [
(fetchpatch {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too bad upstream uses mailing lists for tracking development... I know its a lot to ask, but are you aware of any attempts to tell them about these issues? It'd be nice to add some comment just in case.

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/8c1f637c706483577a22c8d4f2d06d5f041c9093/srcpkgs/notmuch/patches/0005-configure-drop-gmime-session-key-extraction-support-.patch";
hash = "sha256-FXnNtkTqV7ZSIObQSwGu6THX0Rgvj4WeJySTIcJea1Y=";
})
];

XAPIAN_CONFIG = "${xapian}/bin/xapian-config";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like it would behave well in a cross compilation...


postPatch = ''
patchShebangs configure test/

Expand All @@ -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'
Comment on lines +72 to +77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You can do it all in a single substituteInPlace command.


'' + 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"
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed all of a sudden?

'';

passthru = {
Expand Down