[Libreoffice] MacOS path in python wrapper on Linux i586

Christian Lohmaier lohmaier+libreoffice at googlemail.com
Tue Jun 7 08:37:33 PDT 2011


Hi Petr,

On Tue, Jun 7, 2011 at 5:20 PM, Petr Mladek <pmladek at suse.cz> wrote:
>
> I see the following path in "solver/350/unxlngi6.pro/bin/pyuno/python"
>
> --- cut ---
> # execute binary
> exec
> "$PYTHONHOME/Versions/2.6.1/Resources/Python.app/Contents/MacOS/OOoPython" "$@"
> --- cut ---

OK, apparenlty the sed statement did fail.

> I guess that it is related to the commit
> http://cgit.freedesktop.org/libreoffice/libs-extern-sys/commit/?id=75638c07880e9f01033349a9892f88c531d09260
>
> Please, how is it supposed to work?  ;-)

Ah, git played very dirty tricks on me, my commit push should not have
included any makefil.mk.orig and other crap. I foolishly did beliefe
that when I cancel the rebase, it would actually undo all the stuff
and not throw in all kinds of stuff to the to-be-committed files :-(

The idea was to

* change pyuno/zipcore/python.sh to
########
<no changes until URE_BOOTSTRAP>

NOMACSECTION
<original invocation setup comes here>
MACSECTION
<macsection comes here
#########

And add corresponding makefile rule to strip the non-matching one
accordingly when building:

* pyuno/zipcore/makefile.mk
→ ifdef the creation of the python runtime for non-mac, as on Mac the
corresponding work is done in python module already

→ change the rule to make $(BIN)/python.sh to strip the section
delimiters, along with the non-matching block

STRIPMAC=-e '/^NONMACSECTION/d' -e '/^MACSECTION/,$$d'
STRIPNONMAC=-e '/^NONMACSECTION/,/^MACSECTION/d'

$(BIN)$/python.sh : python.sh
    $(COMMAND_ECHO)sed -e 's/%%PYVERSION%%/$(eq,$(OS),MACOSX
$(PYMAJOR).$(PYMINOR) $(PYVERSION))/g' -e
's/%%OOO_LIBRARY_PATH_VAR%%/$(OOO_LIBRARY_PATH_VAR)/g' \
        $(!eq,$(OS),MACOSX $(STRIPNONMAC) $(STRIPMAC)) < $? > $@
    @chmod +x $@

This is where I screwed up by not checking what ended up in the
commit-queue after a pull -r
The logic is reversed, the !eq is wrong, it should be
When the OS is MACOSX, it should add STRIPNONMAC to the commandline,
and STRIPMAC otherwise.

STRIPMAC deletes the line NONMACSECTION and everything from (and
including) the line starting with MACSECTION to the end of the file
STRIPNONMAC strips everything in between (and including) the lines
NONMACSECTION and MACSECTION

I'll see what's left for cleanup.

Thanks for notifying (I was waiting with my build until master builds again)

ciao
Christian


More information about the LibreOffice mailing list