diff options
author | Kai Knoblich <kai@FreeBSD.org> | 2021-03-14 18:53:04 +0800 |
---|---|---|
committer | Kai Knoblich <kai@FreeBSD.org> | 2021-03-14 18:53:04 +0800 |
commit | a57baf2a5fb2db4316c5a984839bc4f64a9dd08b (patch) | |
tree | 196fa35cf0f5f5cd4f47b848b0fb94ff060c19eb /games/adonthell/Makefile | |
parent | 3ce7c790118ed2423ff80cca74b8fd3f5d85ab1b (diff) | |
download | freebsd-ports-gnome-a57baf2a5fb2db4316c5a984839bc4f64a9dd08b.tar.gz freebsd-ports-gnome-a57baf2a5fb2db4316c5a984839bc4f64a9dd08b.tar.zst freebsd-ports-gnome-a57baf2a5fb2db4316c5a984839bc4f64a9dd08b.zip |
games/adonthell: Fix linking with Python 3.8 and onwards
* Link against libpython via the "--embed" flag for Python 3.8 and onwards.
Excerpt from the log:
main.o: In function `main':
main.cc:(.text+0x1af): undefined reference to `PyImport_AppendInittab'
main.cc:(.text+0x1c2): undefined reference to `Py_DecodeLocale'
main.cc:(.text+0x1cf): undefined reference to `Py_SetProgramName'
main.cc:(.text+0x4e9): undefined reference to `PyModule_GetDict'
[...]
PR: 253815
Diffstat (limited to 'games/adonthell/Makefile')
-rw-r--r-- | games/adonthell/Makefile | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/games/adonthell/Makefile b/games/adonthell/Makefile index be2837d6ba4d..01d8ab7df459 100644 --- a/games/adonthell/Makefile +++ b/games/adonthell/Makefile @@ -24,7 +24,7 @@ USE_SDL= mixer2 ttf2 GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-py-debug \ --disable-pyc \ - --with-py-libs="$$(${PYTHON_CMD}-config --ldflags)" \ + --with-py-libs="$$(${PYTHON_CMD}-config --ldflags ${_PY_EMBED})" \ --with-python=${PYTHON_CMD} PLIST_DIRS= ${DATADIR}/games @@ -33,7 +33,17 @@ PLIST_FILES= bin/adonthell \ ${DATADIR}/modules/adonthell.py \ ${DATADIR}/modules/dialogue.py +.include <bsd.port.pre.mk> + +# The "--embed" flag was introduced with Python 3.8 and is required because +# C extensions are no longer linked to libpython since Python 3.8 and onwards. +# +# See also https://bugs.python.org/issue36721 for reference. +.if ${PYTHON_REL} >= 3800 +_PY_EMBED= --embed +.endif + post-patch: @${REINPLACE_CMD} 's,adonthell-0.3,adonthell,g' ${WRKSRC}/src/Makefile.in -.include <bsd.port.mk> +.include <bsd.port.post.mk> |