From patchwork Thu Mar 17 09:43:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tanguy LE CARROUR X-Patchwork-Id: 37902 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 603B627BBEA; Thu, 17 Mar 2022 09:47:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C809627BBE9 for ; Thu, 17 Mar 2022 09:47:08 +0000 (GMT) Received: from localhost ([::1]:45482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUmip-0005qE-Rr for patchwork@mira.cbaines.net; Thu, 17 Mar 2022 05:47:07 -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) 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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! :-) > > > > 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). 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! 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 © 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,26 @@ (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_VERSION_FILE='/dev/null'\n" + "NOTMUCH_INCLUDE_DIR=" + "'" (assoc-ref inputs "notmuch") "/include/" "'\n" + "NOTMUCH_LIB_DIR=" + "'" (assoc-ref inputs "notmuch") "/lib/" "'")))))) + ;; 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" + (("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