Skip to content

Set a deterministic path for installed Kea python files

Closes #2669 (closed).

Explanation of changes:

  • Moved PYTHON_PREFIX and PYTHON_EXEC_PREFIX to configure.ac. They are there for MacOS compatibility. See Kea issue 2012. My reasoning was that as long as we set them, it should affect all python files. We don't have any others than kea-shell at the moment, but it's good to address future issues caused by forgetting to set them when other python scripts are added. It would be great if this could be tested on MacOS.
  • Reduced the list of python interpreters to the ones containing at most the major version, in order of preference. This is because distributions are starting to get python3.10 and above, and we can't tractably address all of the major+minor combinations. The 2.7+ version constraint is still enforced by AM_PATH_PYTHON([2.7]).
  • Used with_site_packages value in AC_ARG_WITH. The previous pythondir and pkgpythondir values that were used, are also set by AM_PATH_PYTHON.
  • The distinction above is necessary to add a fix default value for pythondir: pythondir="${prefix}/lib/python${PYTHON_VERSION}/site-packages". This is the originally intended fix.
  • --with-site-packages didn't work before. I think the lack of distinction above had something to do with it. That is - if the flag was mentioned, the python files were not installed at the given location. I kindly ask the reviewer to verify this. The command cycle is short and can be repeated with celerity for testing purposes: git clean -dffx .; autoreconf -fi; ./configure --enable-shell [--with-site-packages=...]; make install -C src/bin/shell. If the solution gets accepted, I'd like to change the description of the issue to also say that this has fixed --with-site-packages.
  • Exanded pythondir instead of PKGPYTHONDIR so that everything based on pythondir also ends up expanded. This made more sense during development, but now it's equivalent to the prior behavior. I still prefer it this way and would keep it, but I don't insist.
Edited by Andrei Pavel

Merge request reports