aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2022-11-14 02:04:01 +0000
committerWen Heping <wen@FreeBSD.org>2022-11-14 02:04:01 +0000
commit4f45def26118f413bf49e75a5b685aa0b8477343 (patch)
treeaf260054b583e8d16a92a3555707924dfdf41165
parent259045c3bd3d4711df2669535906ac16950dc055 (diff)
downloadports-4f45def26118f413bf49e75a5b685aa0b8477343.tar.gz
ports-4f45def26118f413bf49e75a5b685aa0b8477343.zip
lang/python*: Support FreeBSD divert(4) socket
PR: 267648 Reported by: glebius@ Exp-run by: antoine@
-rw-r--r--lang/python310/Makefile1
-rw-r--r--lang/python310/files/patch-Modules__socketmodule.c29
-rw-r--r--lang/python311/Makefile1
-rw-r--r--lang/python311/files/patch-Modules__socketmodule.c29
-rw-r--r--lang/python37/Makefile1
-rw-r--r--lang/python37/files/patch-Modules__socketmodule.c29
-rw-r--r--lang/python38/Makefile1
-rw-r--r--lang/python38/files/patch-Modules__socketmodule.c29
-rw-r--r--lang/python39/Makefile1
-rw-r--r--lang/python39/files/patch-Modules__socketmodule.c29
10 files changed, 150 insertions, 0 deletions
diff --git a/lang/python310/Makefile b/lang/python310/Makefile
index 7e51ea43cce1..929d2c9deb7d 100644
--- a/lang/python310/Makefile
+++ b/lang/python310/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION:C/[a-z].*//}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
diff --git a/lang/python310/files/patch-Modules__socketmodule.c b/lang/python310/files/patch-Modules__socketmodule.c
new file mode 100644
index 000000000000..93ef3b785ab9
--- /dev/null
+++ b/lang/python310/files/patch-Modules__socketmodule.c
@@ -0,0 +1,29 @@
+--- Modules/socketmodule.c
++++ Modules/socketmodule.c
+@@ -1850,6 +1850,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ /* RDS sockets use sockaddr_in: fall-through */
+ #endif /* AF_RDS */
+
++#ifdef AF_DIVERT
++ case AF_DIVERT:
++ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
++#endif /* AF_DIVERT */
++
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+@@ -7628,6 +7633,14 @@ PyInit__socket(void)
+ PyModule_AddIntMacro(m, AF_SYSTEM);
+ #endif
+
++/* FreeBSD divert(4) */
++#ifdef PF_DIVERT
++ PyModule_AddIntMacro(m, PF_DIVERT);
++#endif
++#ifdef AF_DIVERT
++ PyModule_AddIntMacro(m, AF_DIVERT);
++#endif
++
+ #ifdef AF_PACKET
+ PyModule_AddIntMacro(m, AF_PACKET);
+ #endif
diff --git a/lang/python311/Makefile b/lang/python311/Makefile
index 81b31ae90b5c..900776860f1f 100644
--- a/lang/python311/Makefile
+++ b/lang/python311/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION:C/[a-z].*//}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
diff --git a/lang/python311/files/patch-Modules__socketmodule.c b/lang/python311/files/patch-Modules__socketmodule.c
new file mode 100644
index 000000000000..93ef3b785ab9
--- /dev/null
+++ b/lang/python311/files/patch-Modules__socketmodule.c
@@ -0,0 +1,29 @@
+--- Modules/socketmodule.c
++++ Modules/socketmodule.c
+@@ -1850,6 +1850,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ /* RDS sockets use sockaddr_in: fall-through */
+ #endif /* AF_RDS */
+
++#ifdef AF_DIVERT
++ case AF_DIVERT:
++ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
++#endif /* AF_DIVERT */
++
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+@@ -7628,6 +7633,14 @@ PyInit__socket(void)
+ PyModule_AddIntMacro(m, AF_SYSTEM);
+ #endif
+
++/* FreeBSD divert(4) */
++#ifdef PF_DIVERT
++ PyModule_AddIntMacro(m, PF_DIVERT);
++#endif
++#ifdef AF_DIVERT
++ PyModule_AddIntMacro(m, AF_DIVERT);
++#endif
++
+ #ifdef AF_PACKET
+ PyModule_AddIntMacro(m, AF_PACKET);
+ #endif
diff --git a/lang/python37/Makefile b/lang/python37/Makefile
index a78063cd7c50..f63d9915a493 100644
--- a/lang/python37/Makefile
+++ b/lang/python37/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
diff --git a/lang/python37/files/patch-Modules__socketmodule.c b/lang/python37/files/patch-Modules__socketmodule.c
new file mode 100644
index 000000000000..93ef3b785ab9
--- /dev/null
+++ b/lang/python37/files/patch-Modules__socketmodule.c
@@ -0,0 +1,29 @@
+--- Modules/socketmodule.c
++++ Modules/socketmodule.c
+@@ -1850,6 +1850,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ /* RDS sockets use sockaddr_in: fall-through */
+ #endif /* AF_RDS */
+
++#ifdef AF_DIVERT
++ case AF_DIVERT:
++ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
++#endif /* AF_DIVERT */
++
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+@@ -7628,6 +7633,14 @@ PyInit__socket(void)
+ PyModule_AddIntMacro(m, AF_SYSTEM);
+ #endif
+
++/* FreeBSD divert(4) */
++#ifdef PF_DIVERT
++ PyModule_AddIntMacro(m, PF_DIVERT);
++#endif
++#ifdef AF_DIVERT
++ PyModule_AddIntMacro(m, AF_DIVERT);
++#endif
++
+ #ifdef AF_PACKET
+ PyModule_AddIntMacro(m, AF_PACKET);
+ #endif
diff --git a/lang/python38/Makefile b/lang/python38/Makefile
index fd476d48aecf..acde9fdc2b99 100644
--- a/lang/python38/Makefile
+++ b/lang/python38/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
diff --git a/lang/python38/files/patch-Modules__socketmodule.c b/lang/python38/files/patch-Modules__socketmodule.c
new file mode 100644
index 000000000000..93ef3b785ab9
--- /dev/null
+++ b/lang/python38/files/patch-Modules__socketmodule.c
@@ -0,0 +1,29 @@
+--- Modules/socketmodule.c
++++ Modules/socketmodule.c
+@@ -1850,6 +1850,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ /* RDS sockets use sockaddr_in: fall-through */
+ #endif /* AF_RDS */
+
++#ifdef AF_DIVERT
++ case AF_DIVERT:
++ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
++#endif /* AF_DIVERT */
++
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+@@ -7628,6 +7633,14 @@ PyInit__socket(void)
+ PyModule_AddIntMacro(m, AF_SYSTEM);
+ #endif
+
++/* FreeBSD divert(4) */
++#ifdef PF_DIVERT
++ PyModule_AddIntMacro(m, PF_DIVERT);
++#endif
++#ifdef AF_DIVERT
++ PyModule_AddIntMacro(m, AF_DIVERT);
++#endif
++
+ #ifdef AF_PACKET
+ PyModule_AddIntMacro(m, AF_PACKET);
+ #endif
diff --git a/lang/python39/Makefile b/lang/python39/Makefile
index 58d7f7372ab2..69fcdef611ea 100644
--- a/lang/python39/Makefile
+++ b/lang/python39/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
+PORTREVISION= 1
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
diff --git a/lang/python39/files/patch-Modules__socketmodule.c b/lang/python39/files/patch-Modules__socketmodule.c
new file mode 100644
index 000000000000..93ef3b785ab9
--- /dev/null
+++ b/lang/python39/files/patch-Modules__socketmodule.c
@@ -0,0 +1,29 @@
+--- Modules/socketmodule.c
++++ Modules/socketmodule.c
+@@ -1850,6 +1850,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ /* RDS sockets use sockaddr_in: fall-through */
+ #endif /* AF_RDS */
+
++#ifdef AF_DIVERT
++ case AF_DIVERT:
++ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
++#endif /* AF_DIVERT */
++
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+@@ -7628,6 +7633,14 @@ PyInit__socket(void)
+ PyModule_AddIntMacro(m, AF_SYSTEM);
+ #endif
+
++/* FreeBSD divert(4) */
++#ifdef PF_DIVERT
++ PyModule_AddIntMacro(m, PF_DIVERT);
++#endif
++#ifdef AF_DIVERT
++ PyModule_AddIntMacro(m, AF_DIVERT);
++#endif
++
+ #ifdef AF_PACKET
+ PyModule_AddIntMacro(m, AF_PACKET);
+ #endif