GNU bug report logs -
#54396
[PATCH] [WIP] gnu: python-notmuch2: Fix build.
Previous Next
Reported by: Tanguy Le Carrour <tanguy <at> bioneland.org>
Date: Tue, 15 Mar 2022 09:40:01 UTC
Severity: normal
Tags: patch
Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #47 received at 54396 <at> debbugs.gnu.org (full text, mbox):
Hi Liliana,
Sorry, but I didn't find time last week-end to migrate the package
definition to the new style! :-(
But, just in case in would make sense to fix the build before I found
some time to do my homework, here is the patch!
Cheers,
--
Tanguy
* gnu/packages/mail.scm (python-notmuch2):
(%standard-phases): Add 'create-notmuch-config' and 'patch-setup.py'
after 'enter-python-dir'.
---
gnu/packages/mail.scm | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index d253ca7011..1a11163be6 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -28,7 +28,7 @@
;;; Copyright © 2018 Alex Vong <alexvong1995 <at> gmail.com>
;;; Copyright © 2018 Gábor Boskovits <boskovits <at> gmail.com>
;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus <rekado <at> elephly.net>
-;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour <tanguy <at> bioneland.org>
+;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour <tanguy <at> bioneland.org>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> gmail.com>
;;; Copyright © 2020 Justus Winter <justus <at> sequoia-pgp.org>
;;; Copyright © 2020 Eric Brown <ecbrown <at> ericcbrown.com>
@@ -1493,7 +1493,27 @@ (define-public python-notmuch2
;; This python package lives in a subdirectory of the notmuch source
;; tree, so chdir into it before building.
(add-after 'unpack 'enter-python-dir
- (lambda _ (chdir "bindings/python-cffi"))))))
+ (lambda _ (chdir "bindings/python-cffi")))
+ ;; python-build-system does not invoke the configure script
+ ;; so _notmuch_config.py is missing
+ (add-after 'enter-python-dir 'create-notmuch-config
+ (lambda* (#:key inputs #:allow-other-keys)
+ (with-output-to-file "_notmuch_config.py"
+ (lambda _
+ (display
+ (string-append
+ "NOTMUCH_INCLUDE_DIR="
+ "'" (dirname (search-input-file inputs "include/notmuch.h")) "'\n"
+ "NOTMUCH_LIB_DIR="
+ "'" (dirname (search-input-file inputs "lib/libnotmuch.so")) "'"))))))
+ ;; version.txt is not included in notmuch, so we patch in the version number
+ (add-after 'create-notmuch-config 'patch-setup.py
+ (lambda _
+ (substitute* "setup.py"
+ (("NOTMUCH_VERSION_FILE")
+ "'/dev/null'")
+ (("version=VERSION,")
+ (string-append "version='" ,(package-version this-package) "',"))))))))
(synopsis "Pythonic bindings for the notmuch mail database using CFFI")
(license license:gpl3+)))
--
2.34.0
This bug report was last modified 3 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.