[Libreoffice-commits] .: 2 commits - pyuno/CustomTarget_python_shell.mk pyuno/CustomTarget_pyversion.mk pyuno/Executable_python_wrapper.mk pyuno/Module_pyuno.mk pyuno/zipcore
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jan 1 04:15:22 PST 2013
pyuno/CustomTarget_python_shell.mk | 25 +++++++++++++++----------
pyuno/CustomTarget_pyversion.mk | 37 -------------------------------------
pyuno/Executable_python_wrapper.mk | 8 ++++----
pyuno/Module_pyuno.mk | 2 --
pyuno/zipcore/mac.sh | 9 +++++++++
pyuno/zipcore/nonmac.sh | 12 ++++++++++++
pyuno/zipcore/python.cxx | 2 --
pyuno/zipcore/python.sh | 23 -----------------------
pyuno/zipcore/pyversion.inc | 19 -------------------
9 files changed, 40 insertions(+), 97 deletions(-)
New commits:
commit 2e9ec0a8bcb29681c54b16fadf6b47cab6a6b0db
Author: David Tardon <dtardon at redhat.com>
Date: Tue Jan 1 12:42:09 2013 +0100
simplify processing of python.sh
Change-Id: I583407233fad1f7aaccc137642e5f134c3ba2874
diff --git a/pyuno/CustomTarget_python_shell.mk b/pyuno/CustomTarget_python_shell.mk
index feed2e4..f4df015 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 0000000..7543e6d
--- /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 0000000..0757b11
--- /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 c232c99..89e73b7 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" "$@"
commit 085e0adf53baff298059980a54758d81b08bb059
Author: David Tardon <dtardon at redhat.com>
Date: Tue Jan 1 11:47:56 2013 +0100
just pass the define through -D
I am constantly amazed at the creativity of the original makefile
writers. An extra header file, processed by sed, rather then adding one
item to CDEFS? Really?
Change-Id: I41ae8b10fc447ea5ab91e767c8afb87e39b9b5f5
diff --git a/pyuno/CustomTarget_pyversion.mk b/pyuno/CustomTarget_pyversion.mk
deleted file mode 100644
index acfec16..0000000
--- a/pyuno/CustomTarget_pyversion.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License or as specified alternatively below. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# Major Contributor(s):
-# Copyright (C) 2012 David Ostrovsky <d.ostrovsky at gmx.de> (initial developer)
-#
-# All Rights Reserved.
-#
-# For minor contributions see the git repository.
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
-$(eval $(call gb_CustomTarget_CustomTarget,pyuno/pyversion))
-
-$(call gb_CustomTarget_get_target,pyuno/pyversion) : \
- $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx
-
-$(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx : $(SRCDIR)/pyuno/zipcore/pyversion.inc | \
- $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/.dir
- $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
- sed -e "s/@/$(PYTHON_VERSION)/g" < $? > $@
-
-# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Executable_python_wrapper.mk b/pyuno/Executable_python_wrapper.mk
index 0d978ca..157a0a3 100644
--- a/pyuno/Executable_python_wrapper.mk
+++ b/pyuno/Executable_python_wrapper.mk
@@ -26,12 +26,12 @@
$(eval $(call gb_Executable_Executable,pyuno/python))
-$(eval $(call gb_Executable_use_static_libraries,pyuno/python,\
- ooopathutils \
+$(eval $(call gb_Executable_add_defs,pyuno/python,\
+ -DMY_PYVERSION=L\"$(PYTHON_VERSION)\" \
))
-$(eval $(call gb_Executable_use_custom_headers,pyuno/python,\
- pyuno/pyversion \
+$(eval $(call gb_Executable_use_static_libraries,pyuno/python,\
+ ooopathutils \
))
$(eval $(call gb_Executable_add_noexception_objects,pyuno/python,\
diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk
index 0cdb458..9ce9fe0 100644
--- a/pyuno/Module_pyuno.mk
+++ b/pyuno/Module_pyuno.mk
@@ -48,10 +48,8 @@ endif
# with SYSTEM_PYTHON=YES and SYSTEM_PYTHON=NO
# zipcore: pyuno/python.exe on Windows
-# zipcore: pyversion.hxx on Windows
ifeq ($(OS),WNT)
$(eval $(call gb_Module_add_targets,pyuno,\
- CustomTarget_pyversion \
Executable_python_wrapper \
))
endif
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index 8122f9c..34ff2e2 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -32,8 +32,6 @@
#include "tools/pathutils.hxx"
-#include "pyversion.hxx"
-
#define MY_LENGTH(s) (sizeof (s) / sizeof *(s) - 1)
#define MY_STRING(s) (s), MY_LENGTH(s)
diff --git a/pyuno/zipcore/pyversion.inc b/pyuno/zipcore/pyversion.inc
deleted file mode 100644
index f7a6e77..0000000
--- a/pyuno/zipcore/pyversion.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define MY_PYVERSION L"@"
More information about the Libreoffice-commits
mailing list