git: fdec694e7d29 - main - misc/py-mmcv: fix build with the latest pytorch; update WWW

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 17 Sep 2026 16:32:01 UTC
The branch main has been updated by yuri:

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

commit fdec694e7d29ec112d23b9d96baddd7782280e9f
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-09-17 15:59:21 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-09-17 16:31:59 +0000

    misc/py-mmcv: fix build with the latest pytorch; update WWW
    
    Reported by:    fallout
---
 misc/py-mmcv/Makefile             |  3 ++-
 misc/py-mmcv/files/patch-setup.py | 46 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/misc/py-mmcv/Makefile b/misc/py-mmcv/Makefile
index 3c3fd2f52dd4..4f4761f4160e 100644
--- a/misc/py-mmcv/Makefile
+++ b/misc/py-mmcv/Makefile
@@ -8,7 +8,8 @@ PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	OpenMMLab: Foundational library for computer vision research
-WWW=		https://mmcv.readthedocs.io/en/latest/
+WWW=		https://mmcv.readthedocs.io/en/latest/ \
+		https://github.com/open-mmlab/mmcv
 
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
diff --git a/misc/py-mmcv/files/patch-setup.py b/misc/py-mmcv/files/patch-setup.py
new file mode 100644
index 000000000000..46bfb2260ea8
--- /dev/null
+++ b/misc/py-mmcv/files/patch-setup.py
@@ -0,0 +1,46 @@
+-- latest pytorch requires c++20: https://github.com/open-mmlab/mmcv/issues/3341
+
+--- setup.py.orig	2024-04-24 14:24:15 UTC
++++ setup.py
+@@ -159,7 +159,7 @@ def get_extensions():
+         cuda_args = os.getenv('MMCV_CUDA_ARGS')
+         extra_compile_args = {
+             'nvcc': [cuda_args, '-std=c++14'] if cuda_args else ['-std=c++14'],
+-            'cxx': ['-std=c++14'],
++            'cxx': ['-std=c++20'],
+         }
+         if torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1':
+             define_macros += [('MMCV_WITH_CUDA', None)]
+@@ -204,12 +204,12 @@ def get_extensions():
+             if parse_version(torch.__version__) <= parse_version('1.12.1'):
+                 extra_compile_args['cxx'] = ['-std=c++14']
+             else:
+-                extra_compile_args['cxx'] = ['-std=c++17']
++                extra_compile_args['cxx'] = ['-std=c++20']
+         else:
+             if parse_version(torch.__version__) <= parse_version('1.12.1'):
+                 extra_compile_args['cxx'] = ['/std:c++14']
+             else:
+-                extra_compile_args['cxx'] = ['/std:c++17']
++                extra_compile_args['cxx'] = ['/std:c++20']
+ 
+         include_dirs = []
+         library_dirs = []
+@@ -379,7 +379,7 @@ def get_extensions():
+ 
+             define_macros += [('MMCV_WITH_MPS', None)]
+             extra_compile_args = {}
+-            extra_compile_args['cxx'] = ['-Wall', '-std=c++17']
++            extra_compile_args['cxx'] = ['-Wall', '-std=c++20']
+             extra_compile_args['cxx'] += [
+                 '-framework', 'Metal', '-framework', 'Foundation'
+             ]
+@@ -441,7 +441,7 @@ def get_extensions():
+             if parse_version(torch.__version__) <= parse_version('1.12.1'):
+                 extra_compile_args['nvcc'] += ['-std=c++14']
+             else:
+-                extra_compile_args['nvcc'] += ['-std=c++17']
++                extra_compile_args['nvcc'] += ['-std=c++20']
+ 
+         ext_ops = extension(
+             name=ext_name,