aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Osipov <michaelo@FreeBSD.org>2026-09-30 17:18:30 +0000
committerMichael Osipov <michaelo@FreeBSD.org>2026-10-03 09:19:10 +0000
commit0d01e25f76a32c53df8bb41257ac09250b3f63af (patch)
tree82fdbd24173877b1dec08eca31c557d85df382f1
parentb670c57cd6d08aa3a3c87bc0ffbc1fba2d0527b3 (diff)
www/mod_wsgi: fix Python library linking
Always pass Python's LIBDIR to the linker instead of assuming that Apache's LIBDIR is also a default linker search path. Link mod_wsgi only against the shared libpython library. Do not append Python's LIBS and SYSLIBS, which are intended for linking Python itself or for static embedding. With NLS-enabled Python, those flags promote libintl to a direct dependency of mod_wsgi and cause an unnecessary gettext-runtime dependency. This results in the intended dependency chain: mod_wsgi.so -> libpython${PYTHON_VERSION}.so.1.0 -> libintl.so.8 rather than making libintl a direct dependency of mod_wsgi. PR: 298985 Approved by: portmgr (blanket) MFH: 2026Q4
-rw-r--r--www/mod_wsgi/Makefile3
-rw-r--r--www/mod_wsgi/files/patch-configure.ac29
2 files changed, 31 insertions, 1 deletions
diff --git a/www/mod_wsgi/Makefile b/www/mod_wsgi/Makefile
index 1146d9256b9c..6aa88ce7681f 100644
--- a/www/mod_wsgi/Makefile
+++ b/www/mod_wsgi/Makefile
@@ -1,5 +1,6 @@
PORTNAME= mod_wsgi
DISTVERSION= 6.1.0
+PORTREVISION= 1
CATEGORIES= www python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${APACHE_PKGNAMEPREFIX}${PYTHON_PKGNAMEPREFIX}
@@ -10,7 +11,7 @@ WWW= https://www.modwsgi.org/
LICENSE= APACHE20
-USES= apache cpe gettext-runtime python
+USES= apache autoreconf cpe python
USE_PYTHON= flavors
CPE_VENDOR= modwsgi
diff --git a/www/mod_wsgi/files/patch-configure.ac b/www/mod_wsgi/files/patch-configure.ac
new file mode 100644
index 000000000000..de4ed24384b4
--- /dev/null
+++ b/www/mod_wsgi/files/patch-configure.ac
@@ -0,0 +1,29 @@
+--- configure.ac.orig 2026-09-26 23:11:57 UTC
++++ configure.ac
+@@ -153,10 +153,7 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \
+
+ if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \
+ "${ENABLE_FRAMEWORK}" != "yes"; then
+- if test "${PYTHONLIBDIR}" != "${APXS_LIBDIR}" ; then
+- LDFLAGS1="-L${PYTHONLIBDIR}"
+- fi
+-
++ LDFLAGS1="-L${PYTHONLIBDIR}"
+ LDLIBS1="-lpython${PYTHON_LDVERSION}"
+
+ # MacOS X seems to be broken and doesn't use ABIFLAGS suffix
+@@ -166,12 +163,8 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \
+ LDLIBS1="-lpython${PYTHON_VERSION}"
+ fi
+
+- LDLIBS2=`${PYTHON} -c 'from sys import stdout; \
+- import sysconfig; \
+- stdout.write(sysconfig.get_config_var("LIBS"))'`
+- LDLIBS3=`${PYTHON} -c 'from sys import stdout; \
+- import sysconfig; \
+- stdout.write(sysconfig.get_config_var("SYSLIBS"))'`
++ LDLIBS2=""
++ LDLIBS3=""
+ else
+ LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}"
+