From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EIBwGAwXMmLqQAEAgWs5BA (envelope-from ) for ; Wed, 16 Mar 2022 17:57:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4FYiFQwXMmKqPQAAauVa8A (envelope-from ) for ; Wed, 16 Mar 2022 17:57:48 +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 CE0203EA5A for ; Wed, 16 Mar 2022 17:57:47 +0100 (CET) Received: from localhost ([::1]:55696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUWy2-0007fC-Rb for larch@yhetil.org; Wed, 16 Mar 2022 12:57:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUWpa-0004U1-7v for guix-patches@gnu.org; Wed, 16 Mar 2022 12:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUWpZ-0006Vp-SL for guix-patches@gnu.org; Wed, 16 Mar 2022 12:49:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUWpZ-0004Rk-Oj for guix-patches@gnu.org; Wed, 16 Mar 2022 12:49:01 -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: Wed, 16 Mar 2022 16:49:01 +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.164744932817071 (code B ref 54396); Wed, 16 Mar 2022 16:49:01 +0000 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> From: Tanguy LE CARROUR In-Reply-To: Date: Wed, 16 Mar 2022 17:48:31 +0100 Message-ID: <164744931122.17491.16594765317356733408@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=1647449868; 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=63R7kfc+T0gEIi8MsFKp2yPQe+lqBT6afaWXdRy92mw=; b=ifNRwImi64g1aV4rOwyGNMWe3Nr+iP26YanesNWxWIgWV024N6NSoJ2r0NbEgeiJtLhgFs mOo0VzfPYll5UVGlcX1klS69goDVIxO0nH4p86mGzJUx4gJ9EwoQzNggwE5Ungc2ArR2Od 49MQUfePif0eXtEZK0yD/5AKT04ffFPwWRhSgxIWLxS3Dj/GQyKZDj2asW/gt4sgmSKScZ ILLPUPKYtyh0zlHShXetTJPSsH03LMoCYb5HH9XQFfxZjyERxrjCgs5dTJnddjcsLr1OAc +Bs16rnzch9SE75upH5htb22NUgm2oaUm8+FWU/IK0bV2Ip2IsYo9EPXLSukQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647449868; a=rsa-sha256; cv=none; b=XGBp55/5tZkjLl+NwyjrETbJJkRdqvRq9C1klSCpCLsPW51LwpKZ3JpWW9FZqgKnnBHEzE t0VvYkE57GPYxFZ5lgoor7w9AY8Slmw0mBDZQwpfRwQrQ21bgF8XMatChD9x5dWFLp4WCe Zw4c5qzVw/qHBtEqsYaFRY/LdrjDGhsNRgKe2jedAf3gFK5Ij5Rx0VlLODSozLx/xd6Zu3 WBTF0supYsiA6njZ42kiWIRHxPkB1e+tQgDoDAeyhG6v8Sdu46bJBiZqg+V+Q7Dz3qBWzI 5q3DfSgCBcgDs4/NHOILBCD0NuOX01mp0jgMfvFno7S02GFu776FCjhkWo970g== 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: -2.66 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: CE0203EA5A X-Spam-Score: -2.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: vyXpt3ZW1dW6 --===============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==--