$NetBSD: patch-configure,v 1.4 2021/06/23 18:34:33 schmonz Exp $

* Select GnuPG binary
* Don't let CDPATH affect the build

--- configure.orig	2021-05-15 12:04:24.000000000 +0000
+++ configure
@@ -499,7 +499,7 @@ EOF
         printf 'No.\nCould not make tempdir for testing session-key support.\n'
         errors=$((errors + 1))
     elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \
-           && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
+           && GNUPGHOME=${TEMP_GPG} @GPGME_GPG@ --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
            && SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \
            && [ $SESSION_KEY = 9:0BACD64099D1468AB07C796F0C0AC4851948A658A15B34E803865E9FC635F2F5 ]
     then
@@ -650,7 +650,7 @@ EOF
         printf 'No.\nCould not make tempdir for testing signature verification when decrypting with session keys.\n'
         errors=$((errors + 1))
     elif ${CC} ${CFLAGS} ${gmime_cflags} _verify_sig_with_session_key.c ${gmime_ldflags} -o _verify_sig_with_session_key \
-            && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
+            && GNUPGHOME=${TEMP_GPG} @GPGME_GPG@ --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
             && rm -f ${TEMP_GPG}/private-keys-v1.d/*.key
     then
         if GNUPGHOME=${TEMP_GPG} ./_verify_sig_with_session_key; then
@@ -1536,7 +1536,7 @@ EOF
     if [ $WITH_PYTHON_DOCS = "1" ]; then
         echo "tags.add('WITH_PYTHON')"
     fi
-    printf "rsti_dir = '%s'\n" "$(cd emacs && pwd -P)"
+    printf "rsti_dir = '%s'\n" "$(unset CDPATH && cd emacs && pwd -P)"
 } > sphinx.config
 
 # Finally, after everything configured, inform the user how to continue.
