guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54396] [PATCH v2] [WIP] gnu: python-notmuch2: Fix build.


From: Tanguy Le Carrour
Subject: [bug#54396] [PATCH v2] [WIP] gnu: python-notmuch2: Fix build.
Date: Wed, 16 Mar 2022 12:16:24 +0100

Hi Liliana,

Did you have something along these lines in mind?

I wanted to add the `create-notmuch-config` phase after the `enter-python-dir`,
but I don't know how to get the source folder from there. I suppose
there's a way to get the `../../` of the `cwd`, but I don't (yet) know how.

The generated contains the expected paths:

```
NOTMUCH_VERSION_FILE='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/version.txt'
NOTMUCH_INCLUDE_DIR='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/lib'
NOTMUCH_LIB_DIR='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/lib'
```

… but they **always** reference `drv-0`, even if it's not the first build!?
For instance:

```
$ cat 
/tmp/guix-build-python-notmuch2-0.35.drv-6/notmuch-0.35/bindings/python-cffi/_notmuch_config.py
                                                                                
                                      [profile] guix-dev
NOTMUCH_VERSION_FILE='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/version.txt'
NOTMUCH_INCLUDE_DIR='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/lib'
NOTMUCH_LIB_DIR='/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch-0.35/lib'
```

Does it matter?!

Regards,

--
Tanguy
---
 gnu/packages/mail.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index d253ca7011..f6769cad02 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -28,7 +28,7 @@
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus 
<rekado@elephly.net>
-;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
 ;;; Copyright © 2020 Eric Brown <ecbrown@ericcbrown.com>
@@ -1490,9 +1490,21 @@ (define-public python-notmuch2
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         ;; configure generates `bindings/python-cffi/_notmuch_config.py`
+         ;; 
https://git.notmuchmail.org/git?p=notmuch;a=commit;h=7b5921877e748338359a25dae578771f768183af
+         (add-after 'unpack 'create-notmuch-config
+           (lambda _
+             (let ((cwd (getcwd)))
+               (with-output-to-file "bindings/python-cffi/_notmuch_config.py"
+                 (lambda _
+                   (display
+                    (string-append
+                     "NOTMUCH_VERSION_FILE='" cwd "/version.txt'\n"
+                     "NOTMUCH_INCLUDE_DIR='" cwd "/lib'\n"
+                     "NOTMUCH_LIB_DIR='" cwd "/lib'")))))))
          ;; This python package lives in a subdirectory of the notmuch source
          ;; tree, so chdir into it before building.
-         (add-after 'unpack 'enter-python-dir
+         (add-after 'create-notmuch-config 'enter-python-dir
            (lambda _ (chdir "bindings/python-cffi"))))))
     (synopsis "Pythonic bindings for the notmuch mail database using CFFI")
     (license license:gpl3+)))
-- 
2.34.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]