Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Mon, Aug 22, 2011 at 07:12:55PM +0200, Petr Mladek wrote:
Caolán McNamara píše v Po 22. 08. 2011 v 11:00 +0100:
On Mon, 2011-08-22 at 11:36 +0200, Tomáš Chvátal wrote:
Should apply to master, worth backporting to 3.4.

I've hacked around this with...

echo "import sys, os" > uno.py
echo "sys.path.append('%{basisinstdir}/program')" >> uno.py
echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname: %{baseinstdir}/program/fundamentalrc')" 
uno.py
cat $RPM_BUILD_ROOT/%{basisinstdir}/program/uno.py >> uno.py

in our own spec for a while, so integrating the fix would be good.

However....

a) do we need the PYTHONPATH hack in soffice.sh, I seem to be able to
get away without it ?

I guess that PYTHONPATH hack in soffice.sh is not needed when you
install uno.py and unohelper.py into %{python_sitearch}. It might be
needed when you keep it in libreoffice/basis dir.

See pyuno/source/loader/pyuno_loader.cxx, function
prependPythonPath and its caller CreateInstance; my guess is that it
adds the exact same entry to PYTHONPATH, but I can't immediately
follow all layers of indirection to see what it adds exactly.

And the added line of the patch to uno.py seems to do the _same_ thing
_again_. I don't quite understand the utility of doing it in uno.py:
if uno.py is being loaded (presumably from its place in
@libdir@/@OOOINSTALLDIRNAME@/basis-link/program), it means the python
load path already contains that. If the python load path does not
contain that directory, adding it from within uno.py does not help
because of chicken-and-egg problem of python finding uno.py in the
first place.

Unless we want to allow distributions to install uno.py in
%{python_sitearch}, but *not* the other things it needs, such as
pyuno.so; I'm not sure I get the rationale for wanting to do that.

Can someone show me something that does not work with this patch, but
works with it?

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.