Bug#1041633: cmake: FindPython.cmake returns /usr/local/lib/python3.11/dist-packages for Python_SITEARCH

Timo Röhling roehling at debian.org
Thu Jul 27 07:12:42 BST 2023


* Adrian Bunk <bunk at debian.org> [2023-07-26 20:10]:
>Is it really the package maintainer's responsibility to set this manually,
>or should something (dh-python?) do that automatically?[1]
dh-python (more precisely, the pybuild build system for debhelper)
does it automatically. It can even be used with CMake:

export PYBUILD_SYSTEM=cmake

It does not always work (I have a package which builds
both a C++ libraries and Python modules but does weird
stuff that does not integrate well with pybuild), but if it does, it
will even take care to build for all available Python versions,
so you will get early warnings if a new Python release breaks your
package.

If you are not using pybuild, you can still be lucky because
dh_python3 will try to move packages from /usr/local to the correct
location. However, that does not work if dh_install is used to copy
Python modules from debian/tmp (e.g., python3-foo.install), because
dh_install runs earlier than dh_python3. AFAICT, that is what
typically breaks the package build.


Cheers
Timo

-- 
⢀⣴⠾⠻⢶⣦⠀   ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁   │ Timo Röhling                                       │
⢿⡄⠘⠷⠚⠋⠀   │ 9B03 EBB9 8300 DF97 C2B1  23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230727/6bd38076/attachment.sig>


More information about the Pkg-grass-devel mailing list