-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix python mod autoconf #1606
Fix python mod autoconf #1606
Changes from 4 commits
3ee6baf
a3c022a
d097ee8
a391a5f
09beea1
c5d3351
f7071b1
6dbc8c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,16 +21,14 @@ python_avail="false" | |
|
||
if test "x$egg_enable_python" != "xno"; then | ||
if test "x$egg_with_python_config" = "x"; then | ||
AC_PATH_PROGS([python_config_bin], [python3-config python-config python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config]) | ||
AC_PATH_PROGS([python_config_bin], [python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python3-config python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python-config]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why add all these versions we aren't compatible with? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idea is, to have a smaller diff to upstream ax autoconf macro, so that futrue updates to upstream are easy. |
||
else | ||
if test -d "$egg_with_python_config"; then | ||
AC_MSG_NOTICE([Checking for python-config binaries in $egg_with_python_config]) | ||
AC_PATH_PROGS([python_config_bin], [python3-config python-config], [], [$egg_with_python_config]) | ||
AC_PATH_PROGS([python_config_bin], [python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python3-config python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python-config], [], [$egg_with_python_config]) | ||
else | ||
if test -x "$egg_with_python_config"; then | ||
python_config_bin="$egg_with_python_config" | ||
else | ||
AC_MSG_WARN([Specified --with-python-config=$egg_with_python_config does not exist.]) | ||
fi | ||
fi | ||
fi | ||
|
@@ -66,28 +64,18 @@ version to use, for example '2.3'. This string | |
will be appended to the Python interpreter | ||
canonical name.]) | ||
|
||
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) | ||
if test -z "$PYTHON"; then | ||
AC_MSG_WARN([Cannot find python$PYTHON_VERSION in your system path]) | ||
if ! $ax_python_devel_optional; then | ||
AC_MSG_ERROR([Giving up, python development not available]) | ||
fi | ||
ax_python_devel_found=no | ||
PYTHON_VERSION="" | ||
fi | ||
PYTHON_VERSION=`echo $PYTHON_LDFLAGS | sed 's/.*-lpython\(.*[[0-9]]\).*/\1/'` | ||
|
||
# Check for python version | ||
python_ver=`$PYTHON -c "import sys; \ | ||
print(sys.version.split ()[[0]])"` | ||
AX_COMPARE_VERSION([$python_ver],[ge],[3.8.0], [ax_check_ver="yes"], [ax_check_ver="no"]) | ||
AC_MSG_CHECKING([$PYTHON version is >= 3.8.0]) | ||
if test "x$ax_check_ver" = x"no"; then | ||
python_avail="false" | ||
AC_MSG_RESULT([no ($python_ver)]) | ||
AC_MSG_WARN([Eggdrop requires python version 3.8.0 or higher]) | ||
else | ||
AC_MSG_RESULT([yes ($python_ver)]) | ||
fi | ||
AX_COMPARE_VERSION([$PYTHON_VERSION],[ge],[3.8.0], [ax_check_ver="yes"], [ax_check_ver="no"]) | ||
AC_MSG_CHECKING([python version is >= 3.8.0]) | ||
if test "x$ax_check_ver" = x"no"; then | ||
python_avail="false" | ||
AC_MSG_RESULT([no ($PYTHON_VERSION)]) | ||
AC_MSG_WARN([Eggdrop requires python version 3.8.0 or higher]) | ||
else | ||
AC_MSG_RESULT([yes ($PYTHON_VERSION)]) | ||
fi | ||
|
||
# Disable the module | ||
if test "x$python_avail" = "xfalse"; then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a good thought to make future updates easier, but two things I see here- first, I think python3-config is usually a symlink to the current version, so searching for that first should prevent the scrolling of multiple failed searches
and also future-proof us for python3.13-config, etc.
And second, I think by adding the extra specific versions it may just keep going down the line until it finds an older version? I think I would be in favor of not making this (and the similar following) change at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was merily suggesting, to stick with upstream, but if you see more value in adopting it more to our liking, i can do those changes.
regarding "I think python3-config is usually a symlink". thats not the case with freebsd, which was the motivation for this PR.
for freebsd it is like:
So, shifting python3-config detection to the top would result in:
for the test system, a vanilla
FreeBSD 14.1-RELEASE-p2
.would you still like me to change it and shift detection of python3-config to the top of the test queue?