On Thu, May 26, 2022 at 5:24 PM Miro Hrončok <mhroncok@redhat.com> wrote:
On 26. 05. 22 22:08, Owen Taylor wrote:

> OK, I'll work on coming up with some patches. Do you have an opinion about
> whether it makes sense to make the %_prefix support complete with something like:
> - %python3_sitelib %(RPM_BUILD_ROOT= %{__python3} -Ic "import sysconfig;
> print(sysconfig.get_path('purelib'))")
> +%python3_sitelib %(RPM_BUILD_ROOT= %{__python3} -Ic "import sysconfig;
> print(sysconfig.get_path('purelib', sysconfig.get_default_scheme(),
> {'platbase': '%{_prefix}', 'base': '%{_prefix}')})
> Without that, the --prefix %{_prefix} additions won't work in isolation, and
> will require something else to redefine python3_sitelib/python3_sitearch.

Using vars={'platbase': '%{_prefix}', 'base': '%{_prefix}')} makes sense to me
(you can omit the second parameter (scheme) if you pass vars by name).

Ah, yes, thanks.

I made a pair of pull requests:

that I believe have all the necessary changes, and did some testing (there's also a test added in pyproject/rpm-macros/tests, which seems to work following the instructions for local testing in the README.md)

Unfortunately, I need to take time off from work for personal reasons for a while, so if you could go ahead and make whatever changes are needed and merge them, that would be greatly appreciated. Stephan Bergmann can help you if you want confirmation that these are actually fixing the Flatpak build issues that we were running into.


- Owen