[GERRIT] gbuild migration: pyuno module

Stephan Bergmann sbergman at redhat.com
Fri Jun 8 06:21:36 PDT 2012


On 06/08/2012 09:49 AM, Stephan Bergmann wrote:
> On 06/08/2012 09:22 AM, David Ostrovsky wrote:
>> 2. on Linux I'm testing the clean build with --enable-python=internal,
>> and it seems not to work: opening Tools=>Macros=>Organize Macros=>Python
>> and trying to open Hello World python Macor. I do not see any macros
>> available but see this warning in console
>>
>> [david at wizball program (master)]$ ./soffice.bin --writer
>> 'import site' failed; use -v for traceback
>>
>> Any ideas how to proceed?
>
> I can have a look.

Attached pyuno.patch addresses three problems that I discovered:

* The sed call in pyuno/CustomTarget_python_shell.mk used wrong variable 
names, so that expansions in the python wrapper script were empty.

** The pyuno/zipcore/python.sh also contains NOMACSECTION and MACSECTION 
blocks, and the original pyuno/zipcore/makefile.mk made sure to only 
include one of them.  This still needs to be fixed.

* SAL_DLLPUBLIC_EXPORT was missing from 
pyuno/source/module/pyuno_dlopenwrapper.c, so that the pyuno.so wrapper 
did not export initpyuno.

* The program/python-core-2.6.1/ tree was missing from the installation 
set.  Getting this back was a bit tricky, as the old system zipped 
together a temporary tree with some python-core-2.6.1/lib/ structure, 
that ended up with that hierarchy included in the zip, and scp2 
specified to unzip it into the program directory.  I changed that to zip 
together the flat content of $(OUTDIR)/lib/python, and instead 
explicitly create the python-core-2.6.1/lib hierarchy in scp2 into which 
to then unzip the zip file.

** Ideally, the "lib" directory could be removed from the hierarchy 
completely, but that would require changes to all the places that set up 
PYTHONPATH etc.

** The original pyuno/zipcore/makefile.mk called strip on the files that 
went into the zip.  From the recent general discussion whether or not to 
strip when building LO, it indeed seems acceptable to just drop that.

** We should also think about build dependencies, so that the zip file 
gets recreated whenever its content would change.  Maybe it would be 
best to move creation of the zip file to the python module?

Then, both executing ".../program/python -c 'import uno'" in the 
installation set and running the Hello World macro from "Tools - 
Macros..." worked fine for me on Linux (the former of course only by 
luck, printing a "NONMACSECTION: command not found" message; see above).

Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyuno.patch
Type: text/x-patch
Size: 4138 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120608/bb8a986e/attachment.bin>


More information about the LibreOffice mailing list