Date: Sun, 14 Mar 2021 10:53:05 +0000 (UTC) From: Kai Knoblich <kai@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r568377 - head/games/adonthell Message-ID: <202103141053.12EAr5Ak007375@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kai Date: Sun Mar 14 10:53:04 2021 New Revision: 568377 URL: https://svnweb.freebsd.org/changeset/ports/568377 Log: 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 Modified: head/games/adonthell/Makefile Modified: head/games/adonthell/Makefile ============================================================================== --- head/games/adonthell/Makefile Sun Mar 14 10:50:04 2021 (r568376) +++ head/games/adonthell/Makefile Sun Mar 14 10:53:04 2021 (r568377) @@ -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>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103141053.12EAr5Ak007375>