#i111500# - pyuno python framework diff -r 201e3ca7c48f pyuno/source/loader/makefile.mk --- a/pyuno/source/loader/makefile.mk Mon May 10 18:50:29 2010 +0200 +++ b/pyuno/source/loader/makefile.mk Mon May 10 19:30:56 2010 +0200 @@ -99,11 +99,17 @@ $(DLLDEST)$/pyuno_services.rdb .ENDIF # L10N_framework +ALLTAR: $(eq,$(OS),MACOSX $(MISC)/installname_loader $(NULL)) + .INCLUDE : target.mk .IF "$(L10N_framework)"=="" $(DLLDEST)$/%.py: %.py cp $? $@ +$(MISC)/installname_loader : $(LB)/$(TARGET)$(DLLPOST) + install_name_tool -change $(PYTHON_MAKEINSTALLDIR)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/OOoPython @loader_path/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/OOoPython $< + touch $@ + $(DLLDEST)$/pyuno_services.rdb : makefile.mk $(DLLDEST)$/$(DLLPRE)$(TARGET)$(DLLPOST) -rm -f $@ $(DLLDEST)$/pyuno_services.tmp $(DLLDEST)$/pyuno_services.rdb cd $(DLLDEST) && $(REGCOMP) -register -r pyuno_services.tmp -wop $(foreach,i,$(COMPONENTS) -c $(i)) diff -r 201e3ca7c48f pyuno/source/module/makefile.mk --- a/pyuno/source/module/makefile.mk Mon May 10 18:50:29 2010 +0200 +++ b/pyuno/source/module/makefile.mk Mon May 10 19:30:56 2010 +0200 @@ -120,7 +120,7 @@ $(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a .ELSE -ALLTAR : \ +ALLTAR : $(eq,$(OS),MACOSX $(MISC)/installname_module $(NULL)) \ $(DLLDEST)$/uno.py \ $(DLLDEST)$/unohelper.py \ $(PYUNO_MODULE) \ @@ -153,6 +153,11 @@ @+source $(MISC)$/$(@:b).cmd .ENDIF +$(MISC)/installname_module : $(LB)/$(DLLPRE)$(TARGET)$(DLLPOST) + install_name_tool -change $(PYTHON_MAKEINSTALLDIR)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/OOoPython @loader_path/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/OOoPython $< + # hack to make checkdll happy + ln -sf $(SOLARLIBDIR)/OOoPython.framework $(LB)/OOoPython.framework + touch $@ $(MISC)$/$(PYUNORC) : pyuno -rm -f $@ diff -r 201e3ca7c48f pyuno/zipcore/makefile.mk --- a/pyuno/zipcore/makefile.mk Mon May 10 18:50:29 2010 +0200 +++ b/pyuno/zipcore/makefile.mk Mon May 10 19:30:56 2010 +0200 @@ -37,7 +37,7 @@ .IF "$(SYSTEM_PYTHON)" == "YES" || "$(GUI)" == "OS2" systempython: - @echo "Not building python-core because system python is being used" + @echo "Not building python-core because system python is being used" .ELSE .INCLUDE : pyversion.mk @@ -54,6 +54,7 @@ .ENDIF .ENDIF +.IF "$(OS)" != "MACOSX" FINDLIBFILES_TMP:=$(subst,/,$/ \ $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v .pyc |$(GREP) -v .py\~ |$(GREP) -v .orig )) FINDLIBFILES=$(subst,$(SOLARLIBDIR)$/python, $(FINDLIBFILES_TMP)) @@ -75,14 +76,12 @@ ALLTAR: \ $(BIN)$/$(PYDIRNAME).zip +.ENDIF .IF "$(GUI)" == "UNX" ALLTAR : $(BIN)$/python.sh -$(BIN)$/python.sh : python.sh - -rm -f $@ - cat $? > $@ - sed 's/%%PYVERSION%%/$(PYVERSION)/g' < $@ > $@.new - mv $@.new $@ +$(BIN)$/python.sh : python$(eq,$(OS),MACOSX _mac $(NULL)).sh + sed 's/%%PYVERSION%%/$(eq,$(OS),MACOSX $(PYMAJOR).$(PYMINOR) $(PYVERSION))/g' < $? > $@ chmod +x $@ .ENDIF @@ -93,10 +92,8 @@ $(BIN)$/$(PYDIRNAME).zip : $(FILES) .IF "$(GUI)" == "UNX" -.IF "$(OS)" != "MACOSX" cd $(DESTROOT) && find . -name '*$(DLLPOST)' | xargs strip .ENDIF -.ENDIF -rm -f $@ cd $(BIN) && zip -r $(PYDIRNAME).zip $(PYDIRNAME) diff -r 201e3ca7c48f pyuno/zipcore/python_mac.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pyuno/zipcore/python_mac.sh Mon May 10 19:30:56 2010 +0200 @@ -0,0 +1,67 @@ +#!/bin/sh +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# resolve installation directory +sd_cwd="`pwd`" +if [ -h "$0" ] ; then + sd_basename=`basename "$0"` + sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` + cd "`dirname "$0"`" + cd "`dirname "$sd_script"`" +else + cd "`dirname "$0"`" +fi +sd_prog=`pwd` +cd "$sd_cwd" + +# Set PATH so that crash_report is found: +PATH=$sd_prog${PATH+:$PATH} +export PATH + +# Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so: +DYLD_LIBRARY_PATH=$sd_prog/../basis-link/program:$sd_prog/../basis-link/ure-link/lib${DYLD_LIBRARY_PATH+:$DYLD_LIBRARY_PATH} +export DYLD_LIBRARY_PATH + +# Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable: +: ${UNO_PATH=$sd_prog} +export UNO_PATH + +# Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete +# OOo UNO environment: +: ${URE_BOOTSTRAP=vnd.sun.star.pathname:$sd_prog/fundamentalrc} +export URE_BOOTSTRAP + +PYTHONHOME=$sd_prog/../basis-link/program/OOoPython.framework +export PYTHONHOME + +pybasislibdir=$PYTHONHOME/Versions/%%PYVERSION%%/lib/python%%PYVERSION%% +PYTHONPATH=$sd_prog/../basis-link/program:$pybasislibdir:$pybasislibdir/lib-dynload:$pybasislibdir/lib-tk:$pybasislibdir/site-packages${PYTHONPATH+:$PYTHONPATH} +export PYTHONPATH + +# execute binary +exec "$PYTHONHOME/Versions/%%PYVERSION%%/Resources/Python.app/Contents/MacOS/OOoPython" "$@"