git: 4af982e6bea0 - main - lang/python3(6|7|8|9|10|11): work around unwanted multiarch detection again

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 26 Nov 2021 18:49:21 UTC
The branch main has been updated by dim (src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=4af982e6bea019a33ae85c6c92a3042fadccb739

commit 4af982e6bea019a33ae85c6c92a3042fadccb739
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-11-26 16:02:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-11-26 18:48:57 +0000

    lang/python3(6|7|8|9|10|11): work around unwanted multiarch detection again
    
    In ports 6bef09666460 we patched out python's erroneous multiarch
    detection using sed, but upstream changed the surrounding parts in the
    configure script to defeat the regex we were using. Update the regex to
    cope with the change.
    
    PR:             259896, 258377
    MFH:            2021Q4
    Approved by:    maintainer timeout (9 days)
---
 lang/python310/Makefile | 3 +--
 lang/python311/Makefile | 3 +--
 lang/python36/Makefile  | 3 +--
 lang/python37/Makefile  | 3 +--
 lang/python38/Makefile  | 3 +--
 lang/python39/Makefile  | 3 +--
 6 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/lang/python310/Makefile b/lang/python310/Makefile
index c74cb102450a..1faaded5c8b7 100644
--- a/lang/python310/Makefile
+++ b/lang/python310/Makefile
@@ -127,8 +127,7 @@ post-patch:
 	@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 # Apply DISABLED_EXTENSIONS
 	@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
 .  for _module in ${DISABLED_EXTENSIONS}
diff --git a/lang/python311/Makefile b/lang/python311/Makefile
index 81eca2b4c2dc..eee7fb8b94d2 100644
--- a/lang/python311/Makefile
+++ b/lang/python311/Makefile
@@ -126,8 +126,7 @@ post-patch:
 	@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 # Apply DISABLED_EXTENSIONS
 	@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
 .  for _module in ${DISABLED_EXTENSIONS}
diff --git a/lang/python36/Makefile b/lang/python36/Makefile
index ff039c4118b8..9a30d37773c3 100644
--- a/lang/python36/Makefile
+++ b/lang/python36/Makefile
@@ -128,8 +128,7 @@ PLIST_SUB+=	NO_NIS=""
 post-patch:
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 
 post-install:
 .if ! ${PORT_OPTIONS:MDEBUG}
diff --git a/lang/python37/Makefile b/lang/python37/Makefile
index 3634f533be11..43de00c66dd0 100644
--- a/lang/python37/Makefile
+++ b/lang/python37/Makefile
@@ -114,8 +114,7 @@ post-patch:
 	@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 # Apply DISABLED_EXTENSIONS
 	@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
 .  for _module in ${DISABLED_EXTENSIONS}
diff --git a/lang/python38/Makefile b/lang/python38/Makefile
index 6597443318e7..14fa1346d41c 100644
--- a/lang/python38/Makefile
+++ b/lang/python38/Makefile
@@ -118,8 +118,7 @@ post-patch:
 	@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 # Apply DISABLED_EXTENSIONS
 	@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
 .  for _module in ${DISABLED_EXTENSIONS}
diff --git a/lang/python39/Makefile b/lang/python39/Makefile
index bbc60fa202f5..25a7509e4959 100644
--- a/lang/python39/Makefile
+++ b/lang/python39/Makefile
@@ -118,8 +118,7 @@ post-patch:
 	@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
 # disable detection of multiarch as it breaks with clang >= 13, which adds a
 # major.minor version number in -print-multiarch output, confusing Python
-	@${REINPLACE_CMD} -e 's|^MULTIARCH=.*|MULTIARCH=|' ${WRKSRC}/configure \
-		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
 # Apply DISABLED_EXTENSIONS
 	@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
 .  for _module in ${DISABLED_EXTENSIONS}