unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54396] [PATCH] [WIP] gnu: python-notmuch2: Fix build.
@ 2022-03-15  9:38 Tanguy Le Carrour
  2022-03-15 10:11 ` Liliana Marie Prikler
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Tanguy Le Carrour @ 2022-03-15  9:38 UTC (permalink / raw)
  To: 54396; +Cc: Tanguy Le Carrour

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@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>
@@ -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





^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-03-24  7:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15  9:38 [bug#54396] [PATCH] [WIP] gnu: python-notmuch2: Fix build Tanguy Le Carrour
2022-03-15 10:11 ` Liliana Marie Prikler
2022-03-15 10:58   ` Tanguy LE CARROUR
2022-03-15 16:04 ` Maxime Devos
2022-03-16  7:57   ` Tanguy LE CARROUR
2022-03-16 11:16 ` [bug#54396] [PATCH v2] " Tanguy Le Carrour
2022-03-16 11:28   ` Liliana Marie Prikler
2022-03-16 13:46     ` Tanguy LE CARROUR
2022-03-16 14:02       ` Liliana Marie Prikler
2022-03-16 16:48         ` Tanguy LE CARROUR
2022-03-17  6:59           ` Liliana Marie Prikler
2022-03-17  9:43             ` Tanguy LE CARROUR
2022-03-17  9:51               ` Liliana Marie Prikler
2022-03-17 17:32                 ` Tanguy LE CARROUR
2022-03-22 16:11 ` [bug#54396] [PATCH v6] " Tanguy Le Carrour
2022-03-23 20:15   ` bug#54396: " Liliana Marie Prikler
2022-03-24  7:11     ` [bug#54396] " Tanguy LE CARROUR

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).