GNU bug report logs - #54396
[PATCH] [WIP] gnu: python-notmuch2: Fix build.

Previous Next

Package: guix-patches;

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

From: Tanguy Le Carrour <tanguy <at> bioneland.org>
To: 54396 <at> debbugs.gnu.org
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>
Subject: [bug#54396] [PATCH] [WIP] gnu: python-notmuch2: Fix build.
Date: Tue, 15 Mar 2022 10:38:14 +0100
Hi Guix,

I'm (still) trying to fix a build failure I (unsuccessfully) reported
here: <https://lists.gnu.org/archive/html/guix-devel/2022-02/msg00302.html>.

I've tried and produced a patch, but, somehow, I cannot make it work! :-(

```
+               (setenv "SHELL" (which "sh"))
+               (setenv "CONFIG_SHELL" (which "sh"))
```

I'm not sure those lines are required, but at this point I've just
copied/pasted code I found in an other package definition.


```
+               ;(invoke "./configure" (string-append "--prefix=" out)))))
+               (invoke "bash" "./configure" (string-append "--prefix=" out)))))
```

If I "just" invoke `./configure` I get an error code, but no error
message. I had to prepend `bash` to get the error message telling me
that `cc` and `gcc` were missing.


```
+  #:use-module (gnu packages commencement)
; […]
+    (native-inputs (list gcc-toolchain))
```

When I add `#:use-module (gnu packages commencement)` I get the following error
message I cannot decipher:

```
error: tcc: unbound variable
hint: Did you forget a `use-modules' form?

error: googletest: unbound variable
hint: Did you forget a `use-modules' form?

; […]

Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (python (gnu packages python)) #f)'.
Backtrace:
In guix/store.scm:
   658:37 19 (thunk)
   1320:8 18 (call-with-build-handler #<procedure 7f3d04dabb70 at g…> …)
In guix/scripts/build.scm:
    499:2 17 (_)
In srfi/srfi-1.scm:
   673:15 16 (append-map _ _ . _)
   586:17 15 (map1 ((argument . "python-notmuch2") (build-mode . 0) …))
In guix/scripts/build.scm:
   519:31 14 (_ _)
In gnu/packages.scm:
    478:2 13 (%find-package "python-notmuch2" "python-notmuch2" #f)
    363:6 12 (find-best-packages-by-name _ _)
   293:56 11 (_ "python-notmuch2" _)
In unknown file:
          10 (force #<promise #<procedure 7f3d04634060 at gnu/packag…>)
In gnu/packages.scm:
   240:33  9 (fold-packages #<procedure 7f3d03cb34a8 at gnu/package…> …)
In guix/discovery.scm:
   159:11  8 (all-modules _ #:warn _)
In srfi/srfi-1.scm:
   460:18  7 (fold #<procedure 7f3d072f41e0 at guix/discovery.scm:1…> …)
In guix/discovery.scm:
   149:19  6 (_ _ ())
    116:5  5 (scheme-modules _ _ #:warn _)
In srfi/srfi-1.scm:
   691:23  4 (filter-map #<procedure 7f3d072f7f00 at guix/discove…> . #)
In guix/discovery.scm:
   124:24  3 (_ . _)
In guix/ui.scm:
    325:2  2 (report-unbound-variable-error _ #:frame _)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" (unbound-variable "resolve-interface" "no binding `~A' in module ~A" (python (gnu packages python)) #f))'.
```

Any advice welcome!

Regards,

-- 
Tanguy


---
 gnu/packages/mail.scm | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index d253ca7011..e7cf07944d 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>
@@ -75,6 +75,7 @@ (define-module (gnu packages mail)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages calendar)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
@@ -1486,14 +1487,24 @@ (define-public python-notmuch2
   (package
     (inherit python-notmuch)
     (name "python-notmuch2")
-    (propagated-inputs (list python-cffi))
     (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 'run-configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "SHELL" (which "sh"))
+               (setenv "CONFIG_SHELL" (which "sh"))
+               ;(invoke "./configure" (string-append "--prefix=" out)))))
+               (invoke "bash" "./configure" (string-append "--prefix=" out)))))
          ;; 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 'run-configure 'enter-python-dir
            (lambda _ (chdir "bindings/python-cffi"))))))
+    (native-inputs (list gcc-toolchain))
+    (propagated-inputs (list 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.