diff options
author | David Tardon <dtardon@redhat.com> | 2013-01-01 12:42:09 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-01-01 13:15:01 +0100 |
commit | 2e9ec0a8bcb29681c54b16fadf6b47cab6a6b0db (patch) | |
tree | ccd44b84a1c1f13903a612083966f00900043e4c /pyuno | |
parent | 085e0adf53baff298059980a54758d81b08bb059 (diff) |
simplify processing of python.sh
Change-Id: I583407233fad1f7aaccc137642e5f134c3ba2874
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/CustomTarget_python_shell.mk | 25 | ||||
-rw-r--r-- | pyuno/zipcore/mac.sh | 9 | ||||
-rw-r--r-- | pyuno/zipcore/nonmac.sh | 12 | ||||
-rw-r--r-- | pyuno/zipcore/python.sh | 23 |
4 files changed, 36 insertions, 33 deletions
diff --git a/pyuno/CustomTarget_python_shell.mk b/pyuno/CustomTarget_python_shell.mk index feed2e48730a..f4df015b8217 100644 --- a/pyuno/CustomTarget_python_shell.mk +++ b/pyuno/CustomTarget_python_shell.mk @@ -26,23 +26,28 @@ $(eval $(call gb_CustomTarget_CustomTarget,pyuno/python_shell)) -$(call gb_CustomTarget_get_target,pyuno/python_shell) : \ - $(call gb_CustomTarget_get_workdir,pyuno/python_shell)/python.sh +$(eval $(call gb_CustomTarget_register_targets,pyuno/python_shell,\ + os.sh \ + python.sh \ +)) ifeq ($(OS),MACOSX) pyuno_PYTHON_SHELL_VERSION:=$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) -pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/,/^MACSECTION/d' else pyuno_PYTHON_SHELL_VERSION:=$(PYTHON_VERSION) -pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/d' -e '/^MACSECTION/,$$d' endif -$(call gb_CustomTarget_get_workdir,pyuno/python_shell)/python.sh : $(SRCDIR)/pyuno/zipcore/python.sh | \ - $(call gb_CustomTarget_get_workdir,pyuno/python_shell)/.dir +$(call gb_CustomTarget_get_workdir,pyuno/python_shell)/python.sh : \ + $(SRCDIR)/pyuno/zipcore/python.sh \ + $(call gb_CustomTarget_get_workdir,pyuno/python_shell)/os.sh + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1) + cat $^ > $@ && chmod +x $@ + +$(call gb_CustomTarget_get_workdir,pyuno/python_shell)/os.sh : \ + $(SRCDIR)/pyuno/zipcore/$(if $(filter MACOSX,$(OS)),mac,nonmac).sh $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1) - sed -e "s/%%PYVERSION%%/$(pyuno_PYTHON_SHELL_VERSION)/g" -e \ - "s/%%OOO_LIBRARY_PATH_VAR%%/$(gb_Helper_LIBRARY_PATH_VAR)/g" \ - $(pyuno_PYTHON_SHELL_STRIPRULE) < $? > $@ - chmod +x $@ + sed -e "s/%%PYVERSION%%/$(pyuno_PYTHON_SHELL_VERSION)/g" \ + -e "s/%%OOO_LIBRARY_PATH_VAR%%/$(gb_Helper_LIBRARY_PATH_VAR)/g" \ + $< > $@ # vim: set noet sw=4 ts=4: diff --git a/pyuno/zipcore/mac.sh b/pyuno/zipcore/mac.sh new file mode 100644 index 000000000000..7543e6d3f31f --- /dev/null +++ b/pyuno/zipcore/mac.sh @@ -0,0 +1,9 @@ +PYTHONHOME=$sd_prog/LibreOfficePython.framework +export PYTHONHOME + +pybasislibdir=$PYTHONHOME/Versions/%%PYVERSION%%/lib/python%%PYVERSION%% +PYTHONPATH=$sd_prog:$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/LibreOfficePython" "$@" diff --git a/pyuno/zipcore/nonmac.sh b/pyuno/zipcore/nonmac.sh new file mode 100644 index 000000000000..0757b11fca0b --- /dev/null +++ b/pyuno/zipcore/nonmac.sh @@ -0,0 +1,12 @@ +# Set %%OOO_LIBRARY_PATH_VAR%% so that python.bin finds libpython2.6.so (this +# can go once python.bin contains a proper RPATH): +%%OOO_LIBRARY_PATH_VAR%%=$sd_prog${%%OOO_LIBRARY_PATH_VAR%%:+:$%%OOO_LIBRARY_PATH_VAR%%} +export %%OOO_LIBRARY_PATH_VAR%% + +PYTHONPATH=$sd_prog:$sd_prog/python-core-%%PYVERSION%%/lib:$sd_prog/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH} +export PYTHONPATH +PYTHONHOME=$sd_prog/python-core-%%PYVERSION%% +export PYTHONHOME + +# execute binary +exec "$sd_prog/python.bin" "$@" diff --git a/pyuno/zipcore/python.sh b/pyuno/zipcore/python.sh index c232c997ac19..89e73b7a6d27 100644 --- a/pyuno/zipcore/python.sh +++ b/pyuno/zipcore/python.sh @@ -43,26 +43,3 @@ export UNO_PATH : ${URE_BOOTSTRAP=vnd.sun.star.pathname:$sd_prog/fundamentalrc} export URE_BOOTSTRAP -NONMACSECTION -# Set %%OOO_LIBRARY_PATH_VAR%% so that python.bin finds libpython2.6.so (this -# can go once python.bin contains a proper RPATH): -%%OOO_LIBRARY_PATH_VAR%%=$sd_prog${%%OOO_LIBRARY_PATH_VAR%%:+:$%%OOO_LIBRARY_PATH_VAR%%} -export %%OOO_LIBRARY_PATH_VAR%% - -PYTHONPATH=$sd_prog:$sd_prog/python-core-%%PYVERSION%%/lib:$sd_prog/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH} -export PYTHONPATH -PYTHONHOME=$sd_prog/python-core-%%PYVERSION%% -export PYTHONHOME - -# execute binary -exec "$sd_prog/python.bin" "$@" -MACSECTION -PYTHONHOME=$sd_prog/LibreOfficePython.framework -export PYTHONHOME - -pybasislibdir=$PYTHONHOME/Versions/%%PYVERSION%%/lib/python%%PYVERSION%% -PYTHONPATH=$sd_prog:$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/LibreOfficePython" "$@" |