diff --git a/lang/python310/Portfile b/lang/python310/Portfile index 3f3f4312d28a9..67104a13ca2b8 100644 --- a/lang/python310/Portfile +++ b/lang/python310/Portfile @@ -239,6 +239,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.9 and older if {${os.major} > 11} { diff --git a/lang/python311/Portfile b/lang/python311/Portfile index aaae55863df5f..fedf0ca6671eb 100644 --- a/lang/python311/Portfile +++ b/lang/python311/Portfile @@ -246,6 +246,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.9 and older if {${os.major} > 11} { diff --git a/lang/python312/Portfile b/lang/python312/Portfile index 27cb79742d579..cca73f3ca84a9 100644 --- a/lang/python312/Portfile +++ b/lang/python312/Portfile @@ -231,6 +231,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.9 and older if {${os.major} > 11} { diff --git a/lang/python313/Portfile b/lang/python313/Portfile index a092b7ec26678..393adf623d2b0 100644 --- a/lang/python313/Portfile +++ b/lang/python313/Portfile @@ -232,6 +232,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.10 and older if {${os.major} > 11} { diff --git a/lang/python314-devel/Portfile b/lang/python314-devel/Portfile index b73cfa27d2d30..1e88dfdfc2f85 100644 --- a/lang/python314-devel/Portfile +++ b/lang/python314-devel/Portfile @@ -232,6 +232,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.10 and older if {${os.major} > 11} { diff --git a/lang/python39/Portfile b/lang/python39/Portfile index 7778249beebdd..fc40a4f4fb5f4 100644 --- a/lang/python39/Portfile +++ b/lang/python39/Portfile @@ -242,6 +242,12 @@ variant lto description {enable Link-Time Optimization} { configure.args-append --with-lto } +# Fixes the return type of `ttyname_r` +# See /~https://github.com/python/cpython/issues/127614 +platform darwin 8 { + configure.cflags-append -D__DARWIN_UNIX03=1 +} + platform darwin { # Build failures on 10.9 and older if {${os.major} > 11} {