From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4KLfJJ4DM2JHQQEAgWs5BA (envelope-from ) for ; Thu, 17 Mar 2022 10:47:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uLipIZ4DM2IKvgAAauVa8A (envelope-from ) for ; Thu, 17 Mar 2022 10:47:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 113C62E35 for ; Thu, 17 Mar 2022 10:47:10 +0100 (CET) Received: from localhost ([::1]:45482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUmir-0005qE-4q for larch@yhetil.org; Thu, 17 Mar 2022 05:47:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUmgp-0004aZ-Pm for guix-patches@gnu.org; Thu, 17 Mar 2022 05:45:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUmgo-0000Pw-KA for guix-patches@gnu.org; Thu, 17 Mar 2022 05:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUmgo-0004Bu-H3 for guix-patches@gnu.org; Thu, 17 Mar 2022 05:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54396] [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. Resent-From: Tanguy LE CARROUR Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Mar 2022 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54396 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 54396@debbugs.gnu.org Received: via spool by 54396-submit@debbugs.gnu.org id=B54396.164751025416034 (code B ref 54396); Thu, 17 Mar 2022 09:45:02 +0000 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> From: Tanguy LE CARROUR 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647510430; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=WxZ1CCsW1KlJ3P7HMBURqK04z+/MYp/tb3RyHrUJqic=; b=QU4yo/OO4B//EGhpREd1xu3x/JD7lj/u/WAKMU2qKPcTzsGi5RYF0hA/3+b6AU1Q2PUkHI hLWR3zUQm4xda9+ZnkQrE2dKiE5nfcY+td0gexRMSOAXngNoqbFQOhfK5qV0KmG8W2hVyj D7WJ3oW1/gomxrghs95Yo29Aj/12BiW3SxGaQ/Q9iclciTF0icP2PA5W1KyGpgXMOQ60Ig dvS0zGwxS9NTU76EK6yPhu1rFYEay27PKVn4eAADFUsabLIUlroBk6yBPluHyOGXE10nsZ HONYEMHfveJzuuaqB+77Xvp0PSrKn3ckUgm0uQZ3uwBCL6wkrexV4A+FleouEg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647510430; a=rsa-sha256; cv=none; b=ujumeAn7pHuUHNZSXZWbRtLSaIrF+Jmhl9uV0G7FtYT2x/r2eZQP0JRUlrf5DzkScRUzWV Xby/4Wf8JCPKFomklenk5OJOKn5Y4aCiEhXRPUmYe36e8qNz2A1zKnd8zDchGl0Abmw4Gs UFbet/Oza2iBQg/2tG8jy2NAZ0zDIx7jCKiQA3in/0y4IQJtfvkqNLG5w6ol2UY2Xos2vQ yUUzvKf38dOM0XYEo3mZgmi/Hg1FPjHZQSI886r/qRrQB+ogNTJSeq91T3IX2j0+DIA3YY +KB+CqI3yB6znCs/3FUoZ5NLG7/Ym62aveU/PpN8gSPRRnLP7JogJg/T/eDpSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.36 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 113C62E35 X-Spam-Score: -3.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: sQX98BMXTJi3 --===============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==--