From patchwork Wed Mar 16 11:16:24 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: 37854 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 CA37A27BBEA; Wed, 16 Mar 2022 11:17:41 +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 7B02527BBE9 for ; Wed, 16 Mar 2022 11:17:41 +0000 (GMT) Received: from localhost ([::1]:36598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUReu-0000Cd-KA for patchwork@mira.cbaines.net; Wed, 16 Mar 2022 07:17:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUReI-0008Md-UX for guix-patches@gnu.org; Wed, 16 Mar 2022 07:17:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUReI-0005Jy-MP for guix-patches@gnu.org; Wed, 16 Mar 2022 07:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUReI-0005jc-Ck for guix-patches@gnu.org; Wed, 16 Mar 2022 07:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54396] [PATCH v2] [WIP] gnu: python-notmuch2: Fix build. References: <20220315093814.25033-1-tanguy@bioneland.org> In-Reply-To: <20220315093814.25033-1-tanguy@bioneland.org> Resent-From: Tanguy Le Carrour Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Mar 2022 11:17: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.prikler@ist.tugraz.at Cc: Tanguy Le Carrour , 54396@debbugs.gnu.org Received: via spool by 54396-submit@debbugs.gnu.org id=B54396.164742941522029 (code B ref 54396); Wed, 16 Mar 2022 11:17:02 +0000 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 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 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, 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+)))