unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: [PATCH] configure: check explicitely for python dev (include) files
Date: Thu,  7 Oct 2021 09:09:24 -0300	[thread overview]
Message-ID: <20211007120924.515415-1-david@tethera.net> (raw)
In-Reply-To: <87im1g35ey.fsf@tethera.net>

As discussed at [1] we have received reports that the implicit check
using cffi.FFI().verify() is not reliable in all environments. Since
we already use pkg-config, and the python dev package should include a
.pc file [2], add an extra check using pkg-config.  On at least
Debian, we have to know which version of python dev files with are
looking for, so calculate that first.

[1]: id:87im1g35ey.fsf@tethera.netid:87im1g35ey.fsf@tethera.net,
[2]: checked on Debian and Fedora
---
 configure | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/configure b/configure
index 4262d122..fc9512f9 100755
--- a/configure
+++ b/configure
@@ -777,7 +777,23 @@ fi
 
 have_python3_cffi=0
 have_python3_pytest=0
+have_python3_dev=0
 if [ $have_python3 -eq 1 ]; then
+    printf "Checking for python3 version ..."
+    python3_version=$("$python" -c 'import sysconfig; print(sysconfig.get_python_version());')
+    printf "(%s)\n" $python3_version
+
+    printf "Checking for python $python3_version development files..."
+    if pkg-config --exists "python-$python3_version"; then
+	have_python3_dev=1
+	printf "Yes.\n"
+    else
+	have_python3_dev=0
+        printf "No (will not install CFFI-based python bindings).\n"
+    fi
+fi
+
+if [ $have_python3_dev -eq 1 ]; then
     printf "Checking for python3 cffi and setuptools... "
     if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then
         printf "Yes.\n"
-- 
2.33.0

  parent reply	other threads:[~2021-10-07 12:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11 21:29 configure checks for python3-notmuch2 module David Bremner
2021-07-12  7:14 ` Michael J Gruber
2021-07-25 12:00   ` Tomi Ollila
2021-07-15 11:14 ` Tomi Ollila
2021-10-06 11:42   ` David Bremner
2021-10-06 12:45     ` Tomi Ollila
2021-10-06 18:58       ` Tomi Ollila
2021-10-07 12:09 ` David Bremner [this message]
2021-10-08 19:22   ` [PATCH] configure: check explicitely for python dev (include) files Tomi Ollila
2021-10-09 20:15     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211007120924.515415-1-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).