Message ID | 20220315093814.25033-1-tanguy@bioneland.org |
---|---|
State | Accepted |
Headers | show |
Series | [bug#54396,WIP] gnu: python-notmuch2: Fix build. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
Hi Tanguy, Am Dienstag, dem 15.03.2022 um 10:38 +0100 schrieb 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. Instead of running configure, I suggest generating the _notmuch_config.py on your own. There are three variables you need to define at the moment: NOTMUCH_INCLUDE_DIR and NOTMUCH_LIB_DIR need to point to the already built notmuch, not the one being currently unpacked, and NOTMUCH_VERSION_FILE can also point to an installed file if possible; otherwise generate a dummy. > ``` > + #: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? Such cascading error chains typically happen when a package is malformed and the module it's in can't be compiled. I'm not sure if that's your fault or someone messed with the python module, but either way, you shouldn't use gcc-toolchain for package definitions regardless of whether it causes an error or not. It is solely meant for users to not complain that "gcc doesn't work!!!111!1!einself!" when installing it into their profiles. Cheers
Hi Liliana, Thanks for reviewing! Quoting Liliana Marie Prikler (2022-03-15 11:11:14) > Am Dienstag, dem 15.03.2022 um 10:38 +0100 schrieb Tanguy Le Carrour: > > 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. > Instead of running configure, I suggest generating the > _notmuch_config.py on your own. There are three variables you need to > define at the moment: NOTMUCH_INCLUDE_DIR and NOTMUCH_LIB_DIR need to > point to the already built notmuch, not the one being currently > unpacked, and NOTMUCH_VERSION_FILE can also point to an installed file > if possible; otherwise generate a dummy. Oh… oh… that's a brilliant idea, actually! How stupid of me not to have thought about it right away!! ^_^' Thaaaanks! I'll do that! > > ``` > > + #: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? > Such cascading error chains typically happen when a package is > malformed and the module it's in can't be compiled. I'm not sure if > that's your fault or someone messed with the python module, but either > way, you shouldn't use gcc-toolchain for package definitions regardless > of whether it causes an error or not. It is solely meant for users to > not complain that "gcc doesn't work!!!111!1!einself!" when installing > it into their profiles. Ok, good to know. Thanks! Regards,
Tanguy Le Carrour schreef op di 15-03-2022 om 10:38 [+0100]: > When I add `#:use-module (gnu packages commencement)` From (gnu packages commencement): > ;;; To avoid circular dependencies, this module should not be > imported > ;;; directly from anywhere. if it still needs to be used, you could look at how gnu-build-system sort-of imports it anyway, indirectly. Greetings, Maxime.
Hi Maxime, Quoting Maxime Devos (2022-03-15 17:04:19) > Tanguy Le Carrour schreef op di 15-03-2022 om 10:38 [+0100]: > > When I add `#:use-module (gnu packages commencement)` > > From (gnu packages commencement): > > > ;;; To avoid circular dependencies, this module should not be > > imported > > ;;; directly from anywhere. > > if it still needs to be used, you could look at how gnu-build-system > sort-of imports it anyway, indirectly. A well-deserved RT*M! :-) Thanks for pointing at! In my defence, I still haven't figured out how to configure "go to definition" in my Emacs (works for Python, though!), so navigating the code is still a bit painful. …Yeah, I know, it's a lame excuse! ^_^' Regards,
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+)))