On 11/29/20 3:22 PM, Kalev Lember wrote:
> > > for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E
> > "/usr/lib(64)?/python[0-9]\.[0-9]$"`;
> >
> > ... which should use prefix instead of hardcoding /usr (or alternatively
> scan
> > both /usr and /app).
>
> Can do. However, one question: When we find code in /app/lib(64)/pythonX.Y, do
> we bytecompile with /usr/bin/pythonX.Y or /app/bin/pythonX.Y?
>
>
> Awesome, thanks!
>
> It depends: for python2.7 (gimp flatpak) we use python2.7 re-built for /app
> prefix (so it's bundled with the app's flatpak), but for regular python3 we just
> use the /usr-installed one that's part of the flatpak runtime (the runtime uses
> /usr prefix and app flatpaks use /app prefix).
>
> Would it be possible to just use %__python2 and %__python3 macros for
> byte-compiling? These are always set correctly by the flatpak macros, no matter
> if the interpreter is in /app or /usr.
Not in the way this is currently done, no. The script detects a
Python-version-specific path and uses that Python version.
E.g. even if %__python3 is set to /usr/bin/pypy3, when the script fins files in
/usr/lib(64)/python3.9, it compiles them with python3.9.
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok