git: b8c5f27e68c6 - main - science/py-pyscf: chase libXC6

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Wed, 26 Oct 2022 17:58:34 UTC
The branch main has been updated by thierry:

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

commit b8c5f27e68c6724bddd0a6b50b3d40c454e24a44
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-10-25 16:39:59 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-10-26 17:58:26 +0000

    science/py-pyscf: chase libXC6
    
    Patch from <https://github.com/pyscf/pyscf/pull/1467>.
    
    PR:             267360
    Approved by:    yuri (maintainer)
---
 science/py-pyscf/Makefile                          |  3 +-
 .../files/patch-pyscf_lib_dft_libxc__itrf.c        | 56 ++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/science/py-pyscf/Makefile b/science/py-pyscf/Makefile
index 887bcf8b4a41..10025fc36f73 100644
--- a/science/py-pyscf/Makefile
+++ b/science/py-pyscf/Makefile
@@ -1,12 +1,13 @@
 PORTNAME=	pyscf
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.1.0
+PORTREVISION=	1
 CATEGORIES=	science python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Python module for quantum chemistry
-WWW=		https://www.pymol.org/
+WWW=		https://pypi.org/project/pyscf/
 
 LICENSE=	BSD2CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
diff --git a/science/py-pyscf/files/patch-pyscf_lib_dft_libxc__itrf.c b/science/py-pyscf/files/patch-pyscf_lib_dft_libxc__itrf.c
new file mode 100644
index 000000000000..dbcee618bce5
--- /dev/null
+++ b/science/py-pyscf/files/patch-pyscf_lib_dft_libxc__itrf.c
@@ -0,0 +1,56 @@
+--- pyscf/lib/dft/libxc_itrf.c.orig	2022-09-03 00:05:50 UTC
++++ pyscf/lib/dft/libxc_itrf.c
+@@ -453,7 +453,7 @@ int LIBXC_is_hybrid(int xc_id)
+                 raise_error -1;
+         }
+ 
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+         switch(func.info->family)
+         {
+ #ifdef XC_FAMILY_HYB_LDA
+@@ -483,7 +483,7 @@ double LIBXC_hybrid_coeff(int xc_id)
+                 raise_error 0.0;
+         }
+ 
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+         switch(func.info->family)
+         {
+ #ifdef XC_FAMILY_HYB_LDA
+@@ -530,7 +530,7 @@ void LIBXC_rsh_coeff(int xc_id, double *rsh_pars) {
+         rsh_pars[1] = 0.0;
+         rsh_pars[2] = 0.0;
+ 
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+         XC(hyb_cam_coef)(&func, &rsh_pars[0], &rsh_pars[1], &rsh_pars[2]);
+ #else
+         switch(xc_hyb_type(&func)) {
+@@ -548,7 +548,7 @@ int LIBXC_is_cam_rsh(int xc_id) {
+                 fprintf(stderr, "XC functional %d not found\n", xc_id);
+                 raise_error -1;
+         }
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+         int is_cam = func.info->flags & XC_FLAGS_HYB_CAM;
+ #else
+         int is_cam = (xc_hyb_type(&func) == XC_HYB_CAM);
+@@ -793,7 +793,7 @@ void LIBXC_eval_xc(int nfn, int *fn_id, double *fac, d
+                 // set the range-separated parameter
+                 if (omega[i] != 0) {
+                         // skip if func is not a RSH functional
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+                         if (func.cam_omega != 0) {
+                                 func.cam_omega = omega[i];
+                         }
+@@ -805,7 +805,7 @@ void LIBXC_eval_xc(int nfn, int *fn_id, double *fac, d
+                         // Recursively set the sub-functionals if they are RSH
+                         // functionals
+                         for (j = 0; j < func.n_func_aux; j++) {
+-#if XC_MAJOR_VERSION < 6
++#if XC_MAJOR_VERSION <= 6
+                                 if (func.func_aux[j]->cam_omega != 0) {
+                                         func.func_aux[j]->cam_omega = omega[i];
+                                 }