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
View this message in rfc822 format
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 <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>
@@ -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
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.