>From ecdb6dab3901e661544f4cd8aaf892f939b5e4ee Mon Sep 17 00:00:00 2001 From: Tanguy Le Carrour Date: Tue, 15 Mar 2022 10:38:14 +0100 Subject: [PATCH v5] gnu: python-notmuch2: Fix build. * gnu/packages/mail.scm (python-notmuch2): (%standard-phases): Add 'create-notmuch-config' and 'patch-setup.py' after 'enter-python-dir'. --- gnu/packages/mail.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index d253ca7011..2b44f84446 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -28,7 +28,7 @@ ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Justus Winter ;;; Copyright © 2020 Eric Brown @@ -1493,7 +1493,26 @@ (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_VERSION_FILE='/dev/null'\n" + "NOTMUCH_INCLUDE_DIR=" + "'" (assoc-ref inputs "notmuch") "/include/" "'\n" + "NOTMUCH_LIB_DIR=" + "'" (assoc-ref inputs "notmuch") "/lib/" "'")))))) + ;; 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" + (("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