Skip to content

Commit

Permalink
lang/python*: Replace DISABLED_EXTENSIONS with Setup.local
Browse files Browse the repository at this point in the history
Currently, lang/python38 and lang/python39 don't honor
DISABLED_EXTENSIONS because patch-issue20210 was removed when
lang/python38 was added to the ports tree. patch-issue20210 is still
present on lang/python36 and lang/python37.

Building with poudriere is not affected because builds are executed in a
clean environment.

Setup.local is the more canonical and recommended method for customizing
Python builds for shared extensions & third party libraries.

Support for a *disabled* marker in Setup files was introduced in Python
3.7, so backport this fix to it to keep consistency in the ports tree.

PR:		243358 [1]
PR:		243937 [2]
Reported by:	ngie [1]
Reported by:	jcfyecrayz@liamekaens.com [2]
Reported by:	tuxillo (IRC) DPorts
Reviewed by:	koobs (python, maintainer)
Approved by:	koobs, dbaio (python, maintainer)
Differential Revision: https://reviews.freebsd.org/D31086

(cherry picked from commit a94d4b1)
  • Loading branch information
dbaio committed Jul 8, 2021
1 parent d3cc392 commit 42b74db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 71 deletions.
7 changes: 6 additions & 1 deletion lang/python37/Makefile
Expand Up @@ -31,7 +31,7 @@ PYTHON_SUFFIX= ${PYTHON_VER:S/.//g}

DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm
CONFIGURE_ARGS+= --enable-shared --with-system-ffi --with-system-libmpdec --without-ensurepip
CONFIGURE_ENV+= OPT="" DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS}" # Null out OPT to respect user CFLAGS and remove optimizations
CONFIGURE_ENV+= OPT="" # Null out OPT to respect user CFLAGS and remove optimizations

INSTALL_TARGET= altinstall # Don't want cloberring of unprefixed files

Expand Down Expand Up @@ -112,6 +112,11 @@ post-patch:
# which introduces hidden dependency and breaks build
@${REINPLACE_CMD} -e 's|uuid/uuid.h|ignore_&|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
# Apply DISABLED_EXTENSIONS
@${ECHO} '*disabled*' > ${WRKSRC}/Modules/Setup.local
. for _module in ${DISABLED_EXTENSIONS}
@${ECHO} ${_module} >> ${WRKSRC}/Modules/Setup.local
. endfor

post-install:
.if ! ${PORT_OPTIONS:MDEBUG}
Expand Down
68 changes: 0 additions & 68 deletions lang/python37/files/patch-issue20210

This file was deleted.

7 changes: 6 additions & 1 deletion lang/python38/Makefile
Expand Up @@ -33,7 +33,7 @@ PYTHON_SUFFIX= ${PYTHON_VER:S/.//g}
DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm
CONFIGURE_ARGS+= --enable-shared --without-ensurepip \
--with-system-ffi
CONFIGURE_ENV+= OPT="" DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS}" # Null out OPT to respect user CFLAGS and remove optimizations
CONFIGURE_ENV+= OPT="" # Null out OPT to respect user CFLAGS and remove optimizations

INSTALL_TARGET= altinstall # Don't want cloberring of unprefixed files

Expand Down Expand Up @@ -115,6 +115,11 @@ post-patch:
# which introduces hidden dependency and breaks build
@${REINPLACE_CMD} -e 's|uuid/uuid.h|ignore_&|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
# Apply DISABLED_EXTENSIONS
@${ECHO} '*disabled*' > ${WRKSRC}/Modules/Setup.local
. for _module in ${DISABLED_EXTENSIONS}
@${ECHO} ${_module} >> ${WRKSRC}/Modules/Setup.local
. endfor

post-install:
.if ! ${PORT_OPTIONS:MDEBUG}
Expand Down
7 changes: 6 additions & 1 deletion lang/python39/Makefile
Expand Up @@ -34,7 +34,7 @@ PYTHON_SUFFIX= ${PYTHON_VER:S/.//g}
DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm
CONFIGURE_ARGS+= --enable-shared --without-ensurepip \
--with-system-ffi
CONFIGURE_ENV+= OPT="" DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS}" # Null out OPT to respect user CFLAGS and remove optimizations
CONFIGURE_ENV+= OPT="" # Null out OPT to respect user CFLAGS and remove optimizations

INSTALL_TARGET= altinstall # Don't want cloberring of unprefixed files

Expand Down Expand Up @@ -116,6 +116,11 @@ post-patch:
# which introduces hidden dependency and breaks build
@${REINPLACE_CMD} -e 's|uuid/uuid.h|ignore_&|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
# Apply DISABLED_EXTENSIONS
@${ECHO} '*disabled*' > ${WRKSRC}/Modules/Setup.local
. for _module in ${DISABLED_EXTENSIONS}
@${ECHO} ${_module} >> ${WRKSRC}/Modules/Setup.local
. endfor

post-install:
.if ! ${PORT_OPTIONS:MDEBUG}
Expand Down

0 comments on commit 42b74db

Please sign in to comment.