From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 05:39:04 2022 Received: (at submit) by debbugs.gnu.org; 15 Mar 2022 09:39:04 +0000 Received: from localhost ([127.0.0.1]:47583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU3dq-000879-LV for submit@debbugs.gnu.org; Tue, 15 Mar 2022 05:39:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:42298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU3do-000871-Hn for submit@debbugs.gnu.org; Tue, 15 Mar 2022 05:38:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU3do-0006UC-AU for guix-patches@gnu.org; Tue, 15 Mar 2022 05:38:56 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:44557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU3dm-0005Qv-3V for guix-patches@gnu.org; Tue, 15 Mar 2022 05:38:56 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 1B968240009; Tue, 15 Mar 2022 09:38:45 +0000 (UTC) From: Tanguy Le Carrour To: guix-patches@gnu.org Subject: [PATCH] [WIP] gnu: python-notmuch2: Fix build. Date: Tue, 15 Mar 2022 10:38:14 +0100 Message-Id: <20220315093814.25033-1-tanguy@bioneland.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=217.70.183.193; envelope-from=tanguy@bioneland.org; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Tanguy Le Carrour X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Guix, I'm (still) trying to fix a build failure I (unsuccessfully) reported here: . 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 # …) 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 #) In gnu/packages.scm: 240:33 9 (fold-packages # …) In guix/discovery.scm: 159:11 8 (all-modules _ #:warn _) In srfi/srfi-1.scm: 460:18 7 (fold # …) In guix/discovery.scm: 149:19 6 (_ _ ()) 116:5 5 (scheme-modules _ _ #:warn _) In srfi/srfi-1.scm: 691:23 4 (filter-map # . #) 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 ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Justus Winter ;;; Copyright © 2020 Eric Brown @@ -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 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 06:11:24 2022 Received: (at 54396) by debbugs.gnu.org; 15 Mar 2022 10:11:24 +0000 Received: from localhost ([127.0.0.1]:47604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU49E-0000aI-08 for submit@debbugs.gnu.org; Tue, 15 Mar 2022 06:11:24 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:3629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU49B-0000a8-Ol for 54396@debbugs.gnu.org; Tue, 15 Mar 2022 06:11:22 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KHq1b0CGYz1LLyW; Tue, 15 Mar 2022 11:11:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4KHq1b0CGYz1LLyW DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1647339075; bh=AmB9J+wwuWdIco5dUjPk7tW+YTPiIrph7WpS0qHQk50=; h=Subject:From:To:Date:In-Reply-To:References:From; b=lb/tr+n+KVBbAez9eRTE+Zbr5fuiGL4a0rnJhriUWnS5b9NQzRC9VRxvaVzL9AQPn dVwxDPMSTjtfXZsFvSmp+wKCmrrqi8V4u98sqSJOf0+Wk+t3uQLl+ctUyxWAxO0K1z Foe2otb0RQR/GQGR69a7KAa+414zdoqbmQSkt4YM= Message-ID: <97379de8137ad4430b239b9325f578b9d6219240.camel@ist.tugraz.at> Subject: Re: [PATCH] [WIP] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy Le Carrour , 54396@debbugs.gnu.org Date: Tue, 15 Mar 2022 11:11:14 +0100 In-Reply-To: <20220315093814.25033-1-tanguy@bioneland.org> References: <20220315093814.25033-1-tanguy@bioneland.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54396 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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: > > . > > 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 06:58:46 2022 Received: (at 54396) by debbugs.gnu.org; 15 Mar 2022 10:58:46 +0000 Received: from localhost ([127.0.0.1]:47733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU4t4-00026Z-Di for submit@debbugs.gnu.org; Tue, 15 Mar 2022 06:58:46 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:33605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU4t3-00026H-7k for 54396@debbugs.gnu.org; Tue, 15 Mar 2022 06:58:45 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 44692E0010; Tue, 15 Mar 2022 10:58:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20220315093814.25033-1-tanguy@bioneland.org> <97379de8137ad4430b239b9325f578b9d6219240.camel@ist.tugraz.at> Subject: Re: [PATCH] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: 54396@debbugs.gnu.org, Liliana Marie Prikler In-Reply-To: <97379de8137ad4430b239b9325f578b9d6219240.camel@ist.tugraz.at> Date: Tue, 15 Mar 2022 11:58:37 +0100 Message-ID: <164734191721.3943.14425181671520502632@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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: > > > > . > >=20 > > I've tried and produced a patch, but, somehow, I cannot make it work! > > :-( > >=20 > > ``` > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (setenv "SHELL" (which "sh")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (setenv "CONFIG_SHELL" (which "sh")) > > ``` > >=20 > > 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. > >=20 > >=20 > > ``` > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ;(invoke "./configure" (string-append "--prefix=3D" > > out))))) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (invoke "bash" "./configure" (string-append "-- > > prefix=3D" out))))) > > ``` > >=20 > > 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=E2=80=A6 oh=E2=80=A6 that's a brilliant idea, actually! How stupid of me= not to have thought about it right away!! ^_^' Thaaaanks! I'll do that! > > ``` > > +=C2=A0 #:use-module (gnu packages commencement) > > ; [=E2=80=A6] > > +=C2=A0=C2=A0=C2=A0 (native-inputs (list gcc-toolchain)) > > ``` > >=20 > > When I add `#:use-module (gnu packages commencement)` I get the > > following error > > message I cannot decipher: > >=20 > > ``` > > error: tcc: unbound variable > > hint: Did you forget a `use-modules' form? > >=20 > > 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, --=20 Tanguy From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 12:04:23 2022 Received: (at 54396) by debbugs.gnu.org; 15 Mar 2022 16:04:23 +0000 Received: from localhost ([127.0.0.1]:49404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU9ep-00030D-Mz for submit@debbugs.gnu.org; Tue, 15 Mar 2022 12:04:23 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:49656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU9en-000301-HS for 54396@debbugs.gnu.org; Tue, 15 Mar 2022 12:04:22 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id 6g4K2700N4UW6Th01g4KYZ; Tue, 15 Mar 2022 17:04:20 +0100 Message-ID: Subject: Re: [bug#54396] [PATCH] [WIP] gnu: python-notmuch2: Fix build. From: Maxime Devos To: Tanguy Le Carrour , 54396@debbugs.gnu.org Date: Tue, 15 Mar 2022 17:04:19 +0100 In-Reply-To: <20220315093814.25033-1-tanguy@bioneland.org> References: <20220315093814.25033-1-tanguy@bioneland.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-JJHwUcSX7jVnXN5o2HRw" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1647360260; bh=6T28Lelpi0ZDHKFa+D00GfN5l87xtNyc8zVgLNzGmjo=; h=Subject:From:To:Date:In-Reply-To:References; b=Si19QJCF+eqe5efe3LqIb2bvSk5FIcaUZv5vBeXmf9+oy1i+4pOj3xGnfS4s0isIn KQVovnl+lcpF0xgZMHn4khB3QIWbYEG2eXM2GfH2oUInHM8Lk/GUWzWMSWnu+vGcAJ 4rt1XZyc8hnh+mFzRdpRM+OyyfwCDisR1uFr+pObjGUmkcw1yN0EW/KRBlZbDQ3BjU H/r0+MnrOsD0b34YRdqNJJ7+gO1QlIIJVn0/jk8UOA2e4MgPfRcXg4DJWkQsjeacpZ 1rvyo/M53BVxFUaUw8bvpLiexvlCV6eXFTM3y0PLY+4dVW2wniSl0ITv3np+Nvtvro rj3wqRfl4FP6A== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-JJHwUcSX7jVnXN5o2HRw Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Tanguy Le Carrour schreef op di 15-03-2022 om 10:38 [+0100]: > When I add `#:use-module (gnu packages commencement)` =46rom (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. --=-JJHwUcSX7jVnXN5o2HRw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjC5AxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nrcAQDfJdJj1oOG0QivWOEoVkWgj0Pg Y3Z5gNdB700QpCHVUAD/aiIBD4Fx17DcVRONEDJhnRckKOOU0eAKuQQkPV72+gw= =whaQ -----END PGP SIGNATURE----- --=-JJHwUcSX7jVnXN5o2HRw-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 03:57:50 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 07:57:50 +0000 Received: from localhost ([127.0.0.1]:50137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUOXW-0003n6-7J for submit@debbugs.gnu.org; Wed, 16 Mar 2022 03:57:50 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:45601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUOXV-0003mp-1w for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 03:57:49 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id EEB7E100002; Wed, 16 Mar 2022 07:57:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20220315093814.25033-1-tanguy@bioneland.org> Subject: Re: [bug#54396] [PATCH] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: 54396@debbugs.gnu.org, Maxime Devos In-Reply-To: Date: Wed, 16 Mar 2022 08:57:40 +0100 Message-ID: <164741746032.1836.17244156629690727263@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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)` >=20 > From (gnu packages commencement): >=20 > > ;;; To avoid circular dependencies, this module should not be > > imported > > ;;; directly from anywhere. >=20 > 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. =E2=80=A6Yeah, I know, it's a lame excuse! ^_^' Regards, --=20 Tanguy From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 07:16:55 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 11:16:55 +0000 Received: from localhost ([127.0.0.1]:50385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nURe8-0005jB-E4 for submit@debbugs.gnu.org; Wed, 16 Mar 2022 07:16:55 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:43529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nURe7-0005is-5N for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 07:16:51 -0400 Received: from rafflesia.easter-eggs.fr (176-159-32-89.abo.bbox.fr [176.159.32.89]) (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPA id 1A5E6C0005; Wed, 16 Mar 2022 11:16:43 +0000 (UTC) From: Tanguy Le Carrour To: liliana.prikler@ist.tugraz.at Subject: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. Date: Wed, 16 Mar 2022 12:16:24 +0100 Message-Id: <20220316111624.26189-1-tanguy@bioneland.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: Tanguy Le Carrour , 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Justus Winter ;;; Copyright © 2020 Eric Brown @@ -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 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 07:28:57 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 11:28:57 +0000 Received: from localhost ([127.0.0.1]:50390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nURpo-00060j-NJ for submit@debbugs.gnu.org; Wed, 16 Mar 2022 07:28:56 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:23537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nURpm-00060a-4u for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 07:28:55 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KJShf2nT8z1LZWn; Wed, 16 Mar 2022 12:28:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4KJShf2nT8z1LZWn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1647430130; bh=zrJRRZgMR3Z850zThtA+Z4B+6EMOLobcIfWSs1Ufu10=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=eC7bR6tol9I52KE1qVVZsFndXZX8+ZeJTXHyNUIVnjv3SgpilErSKEQvXLfrOC6U6 KUJCxnH/OorxkXvSmZdiJXoVjknhLgvv8damyulfrAsrhs6Zk+rcI0vl7PaO/RgM8n tauV23qqjtnDq5j6joIaqkcaTRX/xPEFY0scIdcU= Message-ID: <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy Le Carrour Date: Wed, 16 Mar 2022 12:28:49 +0100 In-Reply-To: <20220316111624.26189-1-tanguy@bioneland.org> References: <20220316111624.26189-1-tanguy@bioneland.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Mittwoch, dem 16.03.2022 um 12:16 +0100 schrieb Tanguy Le Carrour: > 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?! Yes, it does matter. The cwd you reference will no longer exist when the bindings are installed. The purpose of generating the file is to fill it with useful, persisting data, i.e. (dirname (search-input-file inputs "notmuch.h")) and (dirname (search-input-file inputs "libnotmuch.so")). As for the version file, that should probably be set to an error value such as None or NotImplemented or even unset. It does not appear to be currently used and we don't install any such file for notmuch. Cheers From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 09:47:05 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 13:47:05 +0000 Received: from localhost ([127.0.0.1]:50629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUTzV-0003J0-3U for submit@debbugs.gnu.org; Wed, 16 Mar 2022 09:47:05 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:33525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUTzS-0003IS-Qh for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 09:47:03 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 9562620007; Wed, 16 Mar 2022 13:46:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: Liliana Marie Prikler In-Reply-To: <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> Date: Wed, 16 Mar 2022 14:46:55 +0100 Message-ID: <164743841502.31835.14352244026552742248@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Liliana, Quoting Liliana Marie Prikler (2022-03-16 12:28:49) > Am Mittwoch, dem 16.03.2022 um 12:16 +0100 schrieb Tanguy Le Carrour: > > The generated contains the expected paths: > > [=E2=80=A6] > >=20 > > =E2=80=A6 but they **always** reference `drv-0`, even if it's not the f= irst > > build!? > > For instance: > >=20 > > ``` > > $ cat /tmp/guix-build-python-notmuch2-0.35.drv-6/notmuch- > > 0.35/bindings/python- > > cffi/_notmuch_config.py > > NOTMUCH_VERSION_FILE=3D'/tmp/guix-build-python-notmuch2-0.35.drv- > > 0/notmuch-0.35/version.txt' > > NOTMUCH_INCLUDE_DIR=3D'/tmp/guix-build-python-notmuch2-0.35.drv- > > 0/notmuch-0.35/lib' > > NOTMUCH_LIB_DIR=3D'/tmp/guix-build-python-notmuch2-0.35.drv-0/notmuch- > > 0.35/lib' > > ``` > >=20 > > Does it matter?! > Yes, it does matter. The cwd you reference will no longer exist when > the bindings are installed. The purpose of generating the file is to > fill it with useful, persisting data, Oh, I thought it was only used at build time! Sorry, my mistake! > i.e. (dirname (search-input-file inputs "notmuch.h")) and > (dirname (search-input-file inputs "libnotmuch.so")). Unfortunately, I couldn't make those work. :-( So I ended up with a less "sexy" version: ``` "NOTMUCH_INCLUDE_DIR=3D'" (assoc-ref inputs "notmuch") "/include/notmuch.h"= "'\n" "NOTMUCH_LIB_DIR=3D'" (assoc-ref inputs "notmuch") "/lib/libnotmuch.so" "'" ``` > As for the version file, that should probably be > set to an error value such as None or NotImplemented or even unset. It > does not appear to be currently used and we don't install any such file > for notmuch. If I set `NOTMUCH_VERSION_FILE=3D''`, I get a "file does not exist" error at build time. So I decided to set it to `/dev/null` instead. Or would it be better if I patched `notmuch` to create the actual version file?! Thanks again for your precious help! --=20 Tanguy From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 10:02:40 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 14:02:40 +0000 Received: from localhost ([127.0.0.1]:51909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUUEa-0006Ep-Kc for submit@debbugs.gnu.org; Wed, 16 Mar 2022 10:02:40 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:15504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUUEY-0006Ef-S9 for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 10:02:39 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KJX5z3GxMz1LZWn; Wed, 16 Mar 2022 15:02:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4KJX5z3GxMz1LZWn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1647439351; bh=CElcQsuJ7jyttu+yNJVcrm2ynCxdyKXcDHzsMsm6SUw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=GwfODmCMN2L1D5Ok8w16SetdMM7nq13ka8H7OoQYT4ezYP1D9pKIYZfJHBHnOPzcl H5QbJhFubq1OBxIhCQY63TnYcXbChHQK9Mfbwm3t7Hjy7oInqtn0GIRCpUqPMcxcKC 0D30UQ4TzXkEsRdWxccJorAGJg3M5rCV3hz57hgI= Message-ID: Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy LE CARROUR Date: Wed, 16 Mar 2022 15:02:30 +0100 In-Reply-To: <164743841502.31835.14352244026552742248@localhost> References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Mittwoch, dem 16.03.2022 um 14:46 +0100 schrieb Tanguy LE CARROUR: > Hi Liliana, > [...] > > > i.e. (dirname (search-input-file inputs "notmuch.h")) and > > (dirname (search-input-file inputs "libnotmuch.so")). > > Unfortunately, I couldn't make those work. :-( > > So I ended up with a less "sexy" version: > > ``` > "NOTMUCH_INCLUDE_DIR='" (assoc-ref inputs "notmuch") > "/include/notmuch.h" "'\n" > "NOTMUCH_LIB_DIR='" (assoc-ref inputs "notmuch") "/lib/libnotmuch.so" > "'" > ``` That is actually a mistake on my part, search-input-file should search inputs for "include/notmuch.h" and likewise "lib/libnotmuch.so". The dirname is important here, since both constants want directories. Alternatively, forgoing those constants might be a good idea, but is not worth investing too much time in. > > As for the version file, that should probably be set to an error > > value such as None or NotImplemented or even unset.  It does not > > appear to be currently used and we don't install any such file > > for notmuch. > > If I set `NOTMUCH_VERSION_FILE=''`, I get a "file does not exist" > error at build time. So I decided to set it to `/dev/null` instead. > Or would it be better if I patched `notmuch` to create the actual > version file?! I think you ought to debug the build and short-circuit the logic by inferring the version number directly where it is needed. Without actual build output that's as much as I can propose. Cheers From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 12:48:48 2022 Received: (at 54396) by debbugs.gnu.org; 16 Mar 2022 16:48:48 +0000 Received: from localhost ([127.0.0.1]:52175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUWpG-0004R6-CZ for submit@debbugs.gnu.org; Wed, 16 Mar 2022 12:48:48 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:40651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUWpD-0004Qr-OD for 54396@debbugs.gnu.org; Wed, 16 Mar 2022 12:48:41 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id C4759200010; Wed, 16 Mar 2022 16:48:31 +0000 (UTC) Content-Type: multipart/mixed; boundary="===============3923205946926723755==" MIME-Version: 1.0 References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: Liliana Marie Prikler In-Reply-To: Date: Wed, 16 Mar 2022 17:48:31 +0100 Message-ID: <164744931122.17491.16594765317356733408@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --===============3923205946926723755== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Liliana, Quoting Liliana Marie Prikler (2022-03-16 15:02:30) > Am Mittwoch, dem 16.03.2022 um 14:46 +0100 schrieb Tanguy LE CARROUR: > > > i.e. (dirname (search-input-file inputs "notmuch.h")) and > > > (dirname (search-input-file inputs "libnotmuch.so")). > >=20 > > Unfortunately, I couldn't make those work. :-( > >=20 > > So I ended up with a less "sexy" version: > >=20 > > ``` > > "NOTMUCH_INCLUDE_DIR=3D'" (assoc-ref inputs "notmuch") > > "/include/notmuch.h" "'\n" > > "NOTMUCH_LIB_DIR=3D'" (assoc-ref inputs "notmuch") "/lib/libnotmuch.so" > > "'" > > ``` > That is actually a mistake on my part, search-input-file should search > inputs for "include/notmuch.h" and likewise "lib/libnotmuch.so". The > dirname is important here, since both constants want directories.=20 > Alternatively, forgoing those constants might be a good idea, but is > not worth investing too much time in. So, I'm leaving those as they are for now. > > If I set `NOTMUCH_VERSION_FILE=3D''`, I get a "file does not exist" > > error at build time. So I decided to set it to `/dev/null` instead. > > Or would it be better if I patched `notmuch` to create the actual > > version file?! > I think you ought to debug the build and short-circuit the logic by > inferring the version number directly where it is needed. Without > actual build output that's as much as I can propose. Mmm=E2=80=A6 I've added a new phase to patch the `setup.py`, but couldn't g= et the version variable to work. Sorry for my=E2=80=A6 noobiness!? ^_^' ``` ;; version.txt is not included in notmuch, so we patch in the version number (add-after 'create-notmuch-config 'patch-setup.py (lambda _ (substitute* "setup.py" (("with open\\(NOTMUCH_VERSION_FILE\\) as fp:") "") ((" VERSION =3D fp.read\\(\\).strip\\(\\)") "") (("version=3DVERSION,") (string-append "version=3D'" "0.0.0" "',"))))) ``` I've tried to replace `0.0.0` with `version` or `,version` but that doesn't seem to be the proper way to do it. Regards, --=20 Tanguy --===============3923205946926723755== Content-Type: text/x-diff; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-WIP-gnu-python-notmuch2-Fix-build.patch"; maxlinelen="78" >From 590bfced58815504ed7ed71f8832107b6e0980c0 Mon Sep 17 00:00:00 2001 From: Tanguy Le Carrour Date: Tue, 15 Mar 2022 10:38:14 +0100 Subject: [PATCH v4] [WIP] gnu: python-notmuch2: Fix build. * gnu/packages/mail.scm (python-notmuch2): (%standard-phases): Add 'create-notmuch-config' and 'patch-setup.py' after 'enter-python-dir'. --- gnu/packages/mail.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index d253ca7011..2ad60e595c 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -28,7 +28,7 @@ ;;; Copyright =C2=A9 2018 Alex Vong ;;; Copyright =C2=A9 2018 G=C3=A1bor Boskovits ;;; Copyright =C2=A9 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright =C2=A9 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright =C2=A9 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright =C2=A9 2020 Vincent Legoll ;;; Copyright =C2=A9 2020 Justus Winter ;;; Copyright =C2=A9 2020 Eric Brown @@ -1493,7 +1493,26 @@ (define-public python-notmuch2 ;; This python package lives in a subdirectory of the notmuch sou= rce ;; tree, so chdir into it before building. (add-after 'unpack 'enter-python-dir - (lambda _ (chdir "bindings/python-cffi")))))) + (lambda _ (chdir "bindings/python-cffi"))) + ;; python-build-system does not invoke the configure script + ;; so _notmuch_config.py is missing + (add-after 'enter-python-dir 'create-notmuch-config + (lambda* (#:key inputs #:allow-other-keys) + (with-output-to-file "_notmuch_config.py" + (lambda _ + (display + (string-append + "NOTMUCH_INCLUDE_DIR=3D" + "'" (assoc-ref inputs "notmuch") "/include/notmuch.h" "= '\n" + "NOTMUCH_LIB_DIR=3D" + "'" (assoc-ref inputs "notmuch") "/lib/libnotmuch.so" "= '")))))) + ;; version.txt is not included in notmuch, so we patch in the ver= sion number + (add-after 'create-notmuch-config 'patch-setup.py + (lambda _ + (substitute* "setup.py" + (("with open\\(NOTMUCH_VERSION_FILE\\) as fp:") "") + ((" VERSION =3D fp.read\\(\\).strip\\(\\)") "") + (("version=3DVERSION,") (string-append "version=3D'" "0.0.0= " "',")))))))) (synopsis "Pythonic bindings for the notmuch mail database using CFFI") (license license:gpl3+))) =20 --=20 2.34.0 --===============3923205946926723755==-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 02:59:54 2022 Received: (at 54396) by debbugs.gnu.org; 17 Mar 2022 06:59:54 +0000 Received: from localhost ([127.0.0.1]:52841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUk6z-0008Gi-Ts for submit@debbugs.gnu.org; Thu, 17 Mar 2022 02:59:54 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:42802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUk6x-0008GX-8A for 54396@debbugs.gnu.org; Thu, 17 Mar 2022 02:59:52 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KJygl4ZY6z3x6h; Thu, 17 Mar 2022 07:59:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1647500387; bh=+JKKe2B4+1cERVoT50lqXMy2KNq9+zdF0JKU0lrLiZQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=r3AkLoCupijcxtrcYmfL8OfJ4A9hcB4fKbjTfPNm/ZxwBqm+9Q1vI0Y0L7gri4UCf 87MgKys3UbiGdvwZt7oYhizr99anhV1a0wcwAB6tdtoPTwEdYqUiQff27PKHIb4O+x 6yFAyD15IglCKPwFzEImTct5713t4QHDTcmvwsxk= Message-ID: <4235d01b2b9f335451e4715ea90fbe92d8ce7f91.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy LE CARROUR Date: Thu, 17 Mar 2022 07:59:48 +0100 In-Reply-To: <164744931122.17491.16594765317356733408@localhost> References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> <164744931122.17491.16594765317356733408@localhost> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Tanguy, Am Mittwoch, dem 16.03.2022 um 17:48 +0100 schrieb Tanguy LE CARROUR: > > That is actually a mistake on my part, search-input-file should > > search inputs for "include/notmuch.h" and likewise > > "lib/libnotmuch.so".  > > The dirname is important here, since both constants want > > directories. > > Alternatively, forgoing those constants might be a good idea, but > > is not worth investing too much time in. > > So, I'm leaving those as they are for now. I think you misunderstood me. It is absolutely necessary that you instantiate these variables correctly. It is not necessary to substitute* their uses. > > > If I set `NOTMUCH_VERSION_FILE=''`, I get a "file does not exist" > > > error at build time. So I decided to set it to `/dev/null` > > > instead. > > > Or would it be better if I patched `notmuch` to create the actual > > > version file?! > > I think you ought to debug the build and short-circuit the logic by > > inferring the version number directly where it is needed.  Without > > actual build output that's as much as I can propose. > > Mmm… I've added a new phase to patch the `setup.py`, but couldn't get > the version variable to work. Sorry for my… noobiness!? ^_^' > > ``` > ;; version.txt is not included in notmuch, so we patch in the version > number > (add-after 'create-notmuch-config 'patch-setup.py >   (lambda _ >     (substitute* "setup.py" >       (("with open\\(NOTMUCH_VERSION_FILE\\) as fp:") "") >       (("    VERSION = fp.read\\(\\).strip\\(\\)") "") >       (("version=VERSION,") (string-append "version='" "0.0.0" > "',"))))) > ``` > > I've tried to replace `0.0.0` with `version` or `,version` but that > doesn't seem to be the proper way to do it. substitute* is not nice when dealing with multi-line expressions. I think you could replace NOTMUCH_VERSION_FILE with '/dev/null' and "VERSION = .*" with (string-append "VERSION = " #$version). Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 05:44:14 2022 Received: (at 54396) by debbugs.gnu.org; 17 Mar 2022 09:44:14 +0000 Received: from localhost ([127.0.0.1]:53087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUmfw-0004AR-Le for submit@debbugs.gnu.org; Thu, 17 Mar 2022 05:44:14 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:36153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUmft-00049l-KX for 54396@debbugs.gnu.org; Thu, 17 Mar 2022 05:44:07 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 025CD40009; Thu, 17 Mar 2022 09:43:58 +0000 (UTC) Content-Type: multipart/mixed; boundary="===============1545102982114285582==" MIME-Version: 1.0 References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> <164744931122.17491.16594765317356733408@localhost> <4235d01b2b9f335451e4715ea90fbe92d8ce7f91.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: Liliana Marie Prikler In-Reply-To: <4235d01b2b9f335451e4715ea90fbe92d8ce7f91.camel@ist.tugraz.at> Date: Thu, 17 Mar 2022 10:43:58 +0100 Message-ID: <164751023805.11899.12185326929295576108@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --===============1545102982114285582== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Liliana, Quoting Liliana Marie Prikler (2022-03-17 07:59:48) > Am Mittwoch, dem 16.03.2022 um 17:48 +0100 schrieb Tanguy LE CARROUR: > > > That is actually a mistake on my part, search-input-file should > > > search inputs for "include/notmuch.h" and likewise > > > "lib/libnotmuch.so".=C2=A0 > > > The dirname is important here, since both constants want > > > directories.=20 > > > Alternatively, forgoing those constants might be a good idea, but > > > is not worth investing too much time in. > >=20 > > So, I'm leaving those as they are for now. > I think you misunderstood me. It is absolutely necessary that you > instantiate these variables correctly. It is not necessary to > substitute* their uses. You right, I **totally** misunderstood you! Sorry! I didn't pay attention to the fact that I left the actual file names in, instead of using the folder names. Hope I've gotten it right this time and that you are not getting tired of reviewing my patch! :-) > > > > If I set `NOTMUCH_VERSION_FILE=3D''`, I get a "file does not exist" > > > > error at build time. So I decided to set it to `/dev/null` > > > > instead. > > > > Or would it be better if I patched `notmuch` to create the actual > > > > version file?! > > > I think you ought to debug the build and short-circuit the logic by > > > inferring the version number directly where it is needed.=C2=A0 Witho= ut > > > actual build output that's as much as I can propose. > >=20 > > Mmm=E2=80=A6 I've added a new phase to patch the `setup.py`, but couldn= 't get > > the version variable to work. Sorry for my=E2=80=A6 noobiness!? ^_^' > >=20 > > ``` > > ;; version.txt is not included in notmuch, so we patch in the version > > number > > (add-after 'create-notmuch-config 'patch-setup.py > > =C2=A0 (lambda _ > > =C2=A0=C2=A0=C2=A0 (substitute* "setup.py" > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("with open\\(NOTMUCH_VERSION_FILE\\) a= s fp:") "") > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("=C2=A0=C2=A0=C2=A0 VERSION =3D fp.rea= d\\(\\).strip\\(\\)") "") > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("version=3DVERSION,") (string-append "= version=3D'" "0.0.0" > > "',"))))) > > ``` > >=20 > > I've tried to replace `0.0.0` with `version` or `,version` but that > > doesn't seem to be the proper way to do it. > substitute* is not nice when dealing with multi-line expressions. I > think you could replace NOTMUCH_VERSION_FILE with '/dev/null' and > "VERSION =3D .*" with (string-append "VERSION =3D " #$version). Oh, looks like gexp magic to me, right? I'm not (yet) comfortable with it! So I came up with another version. Seems to work as I've built, installed and used it! I'm attaching v5. Finger crossed! :-) Thanks again for you time! --=20 Tanguy --===============1545102982114285582== Content-Type: text/x-diff; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-gnu-python-notmuch2-Fix-build.patch"; maxlinelen="78" >From ecdb6dab3901e661544f4cd8aaf892f939b5e4ee Mon Sep 17 00:00:00 2001 From: Tanguy Le Carrour Date: Tue, 15 Mar 2022 10:38:14 +0100 Subject: [PATCH v5] gnu: python-notmuch2: Fix build. * gnu/packages/mail.scm (python-notmuch2): (%standard-phases): Add 'create-notmuch-config' and 'patch-setup.py' after 'enter-python-dir'. --- gnu/packages/mail.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index d253ca7011..2b44f84446 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -28,7 +28,7 @@ ;;; Copyright =C2=A9 2018 Alex Vong ;;; Copyright =C2=A9 2018 G=C3=A1bor Boskovits ;;; Copyright =C2=A9 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright =C2=A9 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright =C2=A9 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright =C2=A9 2020 Vincent Legoll ;;; Copyright =C2=A9 2020 Justus Winter ;;; Copyright =C2=A9 2020 Eric Brown @@ -1493,7 +1493,26 @@ (define-public python-notmuch2 ;; This python package lives in a subdirectory of the notmuch sou= rce ;; tree, so chdir into it before building. (add-after 'unpack 'enter-python-dir - (lambda _ (chdir "bindings/python-cffi")))))) + (lambda _ (chdir "bindings/python-cffi"))) + ;; python-build-system does not invoke the configure script + ;; so _notmuch_config.py is missing + (add-after 'enter-python-dir 'create-notmuch-config + (lambda* (#:key inputs #:allow-other-keys) + (with-output-to-file "_notmuch_config.py" + (lambda _ + (display + (string-append + "NOTMUCH_VERSION_FILE=3D'/dev/null'\n" + "NOTMUCH_INCLUDE_DIR=3D" + "'" (assoc-ref inputs "notmuch") "/include/" "'\n" + "NOTMUCH_LIB_DIR=3D" + "'" (assoc-ref inputs "notmuch") "/lib/" "'")))))) + ;; version.txt is not included in notmuch, so we patch in the ver= sion number + (add-after 'create-notmuch-config 'patch-setup.py + (lambda _ + (substitute* "setup.py" + (("version=3DVERSION,") + (string-append "version=3D'" ,(package-version this-packag= e) "',")))))))) (synopsis "Pythonic bindings for the notmuch mail database using CFFI") (license license:gpl3+))) =20 --=20 2.34.0 --===============1545102982114285582==-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 05:51:49 2022 Received: (at 54396) by debbugs.gnu.org; 17 Mar 2022 09:51:49 +0000 Received: from localhost ([127.0.0.1]:53093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUmnN-0004OG-DW for submit@debbugs.gnu.org; Thu, 17 Mar 2022 05:51:49 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:41446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUmnK-0004O3-Uf for 54396@debbugs.gnu.org; Thu, 17 Mar 2022 05:51:47 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KK2V63LDwz3wZB; Thu, 17 Mar 2022 10:51:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1647510702; bh=Nfwx+b72TA1zt28jg9S0NmTLbTQn6IoA5M8Zkn1pIC8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ToCgK4u1UOp9xepE0VHbCDbV2ynrjL4XtjgQPqXyk+zWGM/syh+6c1E0QB/FYmFii IkApsThMDnIGxASwx+HQvHYscoEzialknrtg8IwYU2KiAlr3Uugrd8lH+8ulVY9m5+ gMDpP83JLorMAyLu75hnTi5gz/H9XFnuVsNfW0zc= Message-ID: <7ef5790e1f6c92df4cb03687502e45634af4cb59.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy LE CARROUR Date: Thu, 17 Mar 2022 10:51:41 +0100 In-Reply-To: <164751023805.11899.12185326929295576108@localhost> References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> <164744931122.17491.16594765317356733408@localhost> <4235d01b2b9f335451e4715ea90fbe92d8ce7f91.camel@ist.tugraz.at> <164751023805.11899.12185326929295576108@localhost> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.03.2022 um 10:43 +0100 schrieb Tanguy LE CARROUR: > Hi Liliana, > > Quoting Liliana Marie Prikler (2022-03-17 07:59:48) > > Am Mittwoch, dem 16.03.2022 um 17:48 +0100 schrieb Tanguy LE > > CARROUR: > > > > That is actually a mistake on my part, search-input-file should > > > > search inputs for "include/notmuch.h" and likewise > > > > "lib/libnotmuch.so".  > > > > The dirname is important here, since both constants want > > > > directories. > > > > Alternatively, forgoing those constants might be a good idea, > > > > but is not worth investing too much time in. > > > > > > So, I'm leaving those as they are for now. > > I think you misunderstood me.  It is absolutely necessary that you > > instantiate these variables correctly.  It is not necessary to > > substitute* their uses. > > You right, I **totally** misunderstood you! Sorry! > I didn't pay attention to the fact that I left the actual file names > in, instead of using the folder names. > Hope I've gotten it right this time and that you are not getting > tired of reviewing my patch! :-) You'd do well using search-input-file as I've suggested for a while now ;) > > > > > > > > > substitute* is not nice when dealing with multi-line expressions.  > > I think you could replace NOTMUCH_VERSION_FILE with '/dev/null' and > > "VERSION = .*" with (string-append "VERSION = " #$version). > > Oh, looks like gexp magic to me, right? I'm not (yet) comfortable > with it! So I came up with another version. Seems to work as I've > built, installed and used it! I think we need to convert this package to the newstyle anyway, so it's not something you have to do, but it'd be appreciated if you first translated the existing package to use gexps and then applied your modifications on top. That being said, using this-package is IIRC fine for such purposes. Regarding NOTMUCH_VERSION_FILE, I don't think we should put an "implemented" value into a file that (as far as I can see) ends up being installed. So here you have to substitute* the use in setup.py instead. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 13:33:09 2022 Received: (at 54396) by debbugs.gnu.org; 17 Mar 2022 17:33:09 +0000 Received: from localhost ([127.0.0.1]:55099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtzo-0000Ku-KZ for submit@debbugs.gnu.org; Thu, 17 Mar 2022 13:33:08 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:37367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtzn-0000KO-0o for 54396@debbugs.gnu.org; Thu, 17 Mar 2022 13:33:07 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 569AC24000B; Thu, 17 Mar 2022 17:32:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20220316111624.26189-1-tanguy@bioneland.org> <6b3d3874c3953688431be77f08989ef709780443.camel@ist.tugraz.at> <164743841502.31835.14352244026552742248@localhost> <164744931122.17491.16594765317356733408@localhost> <4235d01b2b9f335451e4715ea90fbe92d8ce7f91.camel@ist.tugraz.at> <164751023805.11899.12185326929295576108@localhost> <7ef5790e1f6c92df4cb03687502e45634af4cb59.camel@ist.tugraz.at> Subject: Re: [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: Liliana Marie Prikler In-Reply-To: <7ef5790e1f6c92df4cb03687502e45634af4cb59.camel@ist.tugraz.at> Date: Thu, 17 Mar 2022 18:32:59 +0100 Message-ID: <164753837946.17064.8028005328264062282@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: 54396@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Liliana, Quoting Liliana Marie Prikler (2022-03-17 10:51:41) > Am Donnerstag, dem 17.03.2022 um 10:43 +0100 schrieb Tanguy LE CARROUR: > > Quoting Liliana Marie Prikler (2022-03-17 07:59:48) > > > Am Mittwoch, dem 16.03.2022 um 17:48 +0100 schrieb Tanguy LE > > > CARROUR: > > > > > That is actually a mistake on my part, search-input-file should > > > > > search inputs for "include/notmuch.h" and likewise > > > > > "lib/libnotmuch.so".=C2=A0 > > > > > The dirname is important here, since both constants want > > > > > directories.=20 > > > > > Alternatively, forgoing those constants might be a good idea, > > > > > but is not worth investing too much time in. > > > >=20 > > > > So, I'm leaving those as they are for now. > > > I think you misunderstood me.=C2=A0 It is absolutely necessary that y= ou > > > instantiate these variables correctly.=C2=A0 It is not necessary to > > > substitute* their uses. > >=20 > > You right, I **totally** misunderstood you! Sorry! > > I didn't pay attention to the fact that I left the actual file names > > in, instead of using the folder names. > > Hope I've gotten it right this time and that you are not getting > > tired of reviewing my patch! :-) > You'd do well using search-input-file as I've suggested for a while now > ;) You're right! So, now, it looks like: ``` (add-after 'enter-python-dir 'create-notmuch-config (lambda* (#:key inputs #:allow-other-keys) (with-output-to-file "_notmuch_config.py" (lambda _ (display (string-append "NOTMUCH_INCLUDE_DIR=3D" "'" (dirname (search-input-file inputs "include/notmuch.h")) "'\= n" "NOTMUCH_LIB_DIR=3D" "'" (dirname (search-input-file inputs "lib/libnotmuch.so")) "'"= )))))) ``` > > > substitute* is not nice when dealing with multi-line expressions.=C2= =A0 > > > I think you could replace NOTMUCH_VERSION_FILE with '/dev/null' and > > > "VERSION =3D .*" with (string-append "VERSION =3D " #$version). > >=20 > > Oh, looks like gexp magic to me, right? I'm not (yet) comfortable > > with it! So I came up with another version. Seems to work as I've > > built, installed and used it! > I think we need to convert this package to the newstyle anyway, > not something you have to do, but it'd be appreciated if you first > translated the existing package to use gexps and then applied your > modifications on top. That being said, using this-package is IIRC fine > for such purposes. OK, I'll try to do that. But, in order not to spam you with stupid code and questions, I'll think about it for few days and probably do it at the week end. > Regarding NOTMUCH_VERSION_FILE, I don't think we should put an > "implemented" value into a file that (as far as I can see) ends up > being installed. So here you have to substitute* the use in setup.py > instead. It now looks like this: ``` (add-after 'create-notmuch-config 'patch-setup.py (lambda _ (substitute* "setup.py" (("NOTMUCH_VERSION_FILE") "'/dev/null'") (("version=3DVERSION,") (string-append "version=3D'" ,(package-version this-package) "',"))= ))) ``` I'll submit a new patch later this week with the gexp version!=E2=80=A6 if I manage to write it! ^_^' Thanks again for your valuable advice and time! --=20 Tanguy From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 12:11:57 2022 Received: (at 54396) by debbugs.gnu.org; 22 Mar 2022 16:11:57 +0000 Received: from localhost ([127.0.0.1]:41698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWh6t-0003jX-KP for submit@debbugs.gnu.org; Tue, 22 Mar 2022 12:11:57 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:54675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWh6r-0003jK-Pr for 54396@debbugs.gnu.org; Tue, 22 Mar 2022 12:11:50 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id BF93C240004; Tue, 22 Mar 2022 16:11:42 +0000 (UTC) From: Tanguy Le Carrour To: liliana.prikler@ist.tugraz.at, 54396@debbugs.gnu.org Subject: [PATCH v6] gnu: python-notmuch2: Fix build. Date: Tue, 22 Mar 2022 17:11:26 +0100 Message-Id: <20220322161126.30669-1-tanguy@bioneland.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396 Cc: Tanguy Le Carrour X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Liliana, Sorry, but I didn't find time last week-end to migrate the package definition to the new style! :-( But, just in case in would make sense to fix the build before I found some time to do my homework, here is the patch! Cheers, -- Tanguy * gnu/packages/mail.scm (python-notmuch2): (%standard-phases): Add 'create-notmuch-config' and 'patch-setup.py' after 'enter-python-dir'. --- gnu/packages/mail.scm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index d253ca7011..1a11163be6 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -28,7 +28,7 @@ ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus -;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour +;;; Copyright © 2019, 2020-2022 Tanguy Le Carrour ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Justus Winter ;;; Copyright © 2020 Eric Brown @@ -1493,7 +1493,27 @@ (define-public python-notmuch2 ;; This python package lives in a subdirectory of the notmuch source ;; tree, so chdir into it before building. (add-after 'unpack 'enter-python-dir - (lambda _ (chdir "bindings/python-cffi")))))) + (lambda _ (chdir "bindings/python-cffi"))) + ;; python-build-system does not invoke the configure script + ;; so _notmuch_config.py is missing + (add-after 'enter-python-dir 'create-notmuch-config + (lambda* (#:key inputs #:allow-other-keys) + (with-output-to-file "_notmuch_config.py" + (lambda _ + (display + (string-append + "NOTMUCH_INCLUDE_DIR=" + "'" (dirname (search-input-file inputs "include/notmuch.h")) "'\n" + "NOTMUCH_LIB_DIR=" + "'" (dirname (search-input-file inputs "lib/libnotmuch.so")) "'")))))) + ;; version.txt is not included in notmuch, so we patch in the version number + (add-after 'create-notmuch-config 'patch-setup.py + (lambda _ + (substitute* "setup.py" + (("NOTMUCH_VERSION_FILE") + "'/dev/null'") + (("version=VERSION,") + (string-append "version='" ,(package-version this-package) "',")))))))) (synopsis "Pythonic bindings for the notmuch mail database using CFFI") (license license:gpl3+))) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 16:15:53 2022 Received: (at 54396-done) by debbugs.gnu.org; 23 Mar 2022 20:15:53 +0000 Received: from localhost ([127.0.0.1]:46139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7Ob-0000PA-1k for submit@debbugs.gnu.org; Wed, 23 Mar 2022 16:15:53 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:40779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7OY-0000H9-JQ for 54396-done@debbugs.gnu.org; Wed, 23 Mar 2022 16:15:50 -0400 Received: by mail-ej1-f67.google.com with SMTP id p15so5110031ejc.7 for <54396-done@debbugs.gnu.org>; Wed, 23 Mar 2022 13:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=6YtQtgBLLUDMmNPuJ4WrXRfAG89fkjcQL0XjGTM8MpM=; b=qSwk7zM//mXKKVyzCQtMIJq5lV1ReZn7YBIX/YHfZTndBOUWxwJsj7T5fF0kEpPpbJ Lqjjkh3PdeYFqRrZ3H8NWuKOxu4n3MPENo/fQniVCUOY5djk6Gj699OGzMlYBcPq7lxC qBV8S+WsOKZaZkXDIHqJZfncWabyVQC7RNA3jdyrFnbemI768LJR+yUs+jNT7EwWZX2L NaWzhlAAc2eS8lakAaQQ39i1Qe3oR+WOeF91l5b3rZiOHOhJEnEb8Up9nbl45f3RtcaM MpvMiMN9RBvBeoUb5UiRd5B3AnqmMXhTolBU0D7rXMHFcQgabfFfV54jaWzEg1w9D0W1 GiKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=6YtQtgBLLUDMmNPuJ4WrXRfAG89fkjcQL0XjGTM8MpM=; b=7XWawxIQmclpXlSzGQRKWltSNoNO8VrpCmPN9aZBYseKIdsbULimSFpFRikdPtyaTJ BLIhhjvKTX0EM52KqVeIGrry3SOtrmpiGpa1nKV8LnWqupDiXoiKvOjzqXJUNagWybwQ J6PBqXZxg0AmrwQrJ0eSxbIV7BtEWLOENgDrV2WFFNyhGH/GZnkY4cZqtbyLacq2PEqB oTpG5jPuikIlmw49w6c7tOhONzwGRlEP6LYJf/jmWXHKHE46+YBgz+xGI8M9cjM5nbqH UrsOQYSQd/yq/oH/B2QomCHH/atxWVtuWbh1NFDfbGSHLd921RY6zR9T2G/T4V/EQRTt AoNA== X-Gm-Message-State: AOAM531zNk+EIW7JBFD7ztwnR9lvk7GtE0tNvDn9tU06dKnaFo+Q+f3a KwZVaumT17Q+4kESjxiBRDc= X-Google-Smtp-Source: ABdhPJyo90iyGr/AI4SQUIXHmWiCBLhOiGzEuDd+2mc3D16uwouuMbaf+w0MetzSyjTSU2bJ2JD1pQ== X-Received: by 2002:a17:907:3e98:b0:6d7:7c21:529f with SMTP id hs24-20020a1709073e9800b006d77c21529fmr2015873ejc.104.1648066544763; Wed, 23 Mar 2022 13:15:44 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z5-20020a1709063a0500b006da8fa9526esm317567eje.178.2022.03.23.13.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 13:15:44 -0700 (PDT) Message-ID: <0de4cd3f3983180b674274d6f3bf01d93eeb346c.camel@gmail.com> Subject: Re: [PATCH v6] gnu: python-notmuch2: Fix build. From: Liliana Marie Prikler To: Tanguy Le Carrour , 54396-done@debbugs.gnu.org Date: Wed, 23 Mar 2022 21:15:43 +0100 In-Reply-To: <20220322161126.30669-1-tanguy@bioneland.org> References: <20220322161126.30669-1-tanguy@bioneland.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54396-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Tanguy, Am Dienstag, dem 22.03.2022 um 17:11 +0100 schrieb Tanguy Le Carrour: > Hi Liliana, > > Sorry, but I didn't find time last week-end to migrate the package > definition to the new style! :-( > > But, just in case in would make sense to fix the build before I found > some time to do my homework, here is the patch! > > Cheers, I fixed some minor thing in the copyright line, added my own patch to use the new style, and pushed both. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 03:11:36 2022 Received: (at 54396-done) by debbugs.gnu.org; 24 Mar 2022 07:11:36 +0000 Received: from localhost ([127.0.0.1]:46678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXHdA-000478-2q for submit@debbugs.gnu.org; Thu, 24 Mar 2022 03:11:36 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:58701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXHd8-00046v-7p for 54396-done@debbugs.gnu.org; Thu, 24 Mar 2022 03:11:34 -0400 Received: (Authenticated sender: tanguy@bioneland.org) by mail.gandi.net (Postfix) with ESMTPSA id 9BC95240005; Thu, 24 Mar 2022 07:11:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20220322161126.30669-1-tanguy@bioneland.org> <0de4cd3f3983180b674274d6f3bf01d93eeb346c.camel@gmail.com> Subject: Re: [PATCH v6] gnu: python-notmuch2: Fix build. From: Tanguy LE CARROUR To: 54396-done@debbugs.gnu.org, Liliana Marie Prikler In-Reply-To: <0de4cd3f3983180b674274d6f3bf01d93eeb346c.camel@gmail.com> Date: Thu, 24 Mar 2022 08:11:26 +0100 Message-ID: <164810588670.3665.1565480624078022888@localhost> User-Agent: alot/0.10 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54396-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Liliana, Quoting Liliana Marie Prikler (2022-03-23 21:15:43) > Am Dienstag, dem 22.03.2022 um 17:11 +0100 schrieb Tanguy Le Carrour: > > Hi Liliana, > >=20 > > Sorry, but I didn't find time last week-end to migrate the package > > definition to the new style! :-( > >=20 > > But, just in case in would make sense to fix the build before I found > > some time to do my homework, here is the patch! > >=20 > > Cheers, > I fixed some minor thing in the copyright line, added my own patch to > use the new style, and pushed both. Thank you so much!! The change looks trivial, but some of it still doesn't make sense to me! :-( I guess I have to improve my Guile skills! I'll read (again) some of those resources: - [The Big Change](https://guix.gnu.org/en/blog/2021/the-big-change) - [G-Expressions](https://guix.gnu.org/manual/en/html_node/G_002dExpression= s.html) - [Guix Programming Interface](https://guix.gnu.org/manual/en/guix.html#Pro= gramming-Interface) - [Guile Manual](https://www.gnu.org/software/guile/manual/guile.html) If you have any link that could help me become a Guile Jedi, they are more than welcome! :-) Cheers, --=20 Tanguy From unknown Thu Jun 19 16:24:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 21 Apr 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator