Kaydet (Commit) 38a22a90 authored tarafından Michael Stahl's avatar Michael Stahl

Switch from python to python3

Mac specific parts of patch by:
Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>

Change-Id: I90ef17c6f5a678230539a80ab999fa5344e4fc8f
üst 6f8f95fe
......@@ -140,6 +140,7 @@ packimages\
padmin\
postgresql\
psprint_config\
python3 \
pyuno\
qadevOOo\
readlicense_oo\
......
......@@ -1966,27 +1966,31 @@ define gb_LinkTarget__use_python
ifeq ($(OS),WNT)
$(call gb_LinkTarget_add_libs,$(1),\
python26.lib \
python33.lib \
)
else ifeq ($(OS),MACOSX)
$(call gb_LinkTarget_add_libs,$(1),\
-F$(OUTDIR)/lib -framework OOoPython \
-dylib_file @loader_path/LibreOfficePython.framework/Versions/3.3/LibreOfficePython:$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.3/LibreOfficePython \
-F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \
)
else
$(call gb_LinkTarget_use_libraries,$(1),\
python2.6 \
python3.3m \
)
endif
$(call gb_LinkTarget_set_include,$(1),\
-I$(OUTDIR)/inc/python \
-I$(call gb_UnpackedTarball_get_dir,python3) \
-I$(call gb_UnpackedTarball_get_dir,python3)/PC \
-I$(call gb_UnpackedTarball_get_dir,python3)/Include \
$$(INCLUDE) \
)
endef
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
python2.6 \
python3 \
python3.3m \
))
endif # SYSTEM_PYTHON
......
......@@ -7468,7 +7468,7 @@ int main(int argc, char **argv) {
internal)
SYSTEM_PYTHON=NO
PYTHON_TARBALL="e81c2f0953aa60f8062c05a4673f2be0-Python-2.6.1.tar.bz2"
PYTHON_TARBALL="b3b2524f72409d919a4137826a870a8f-Python-3.3.0.tar.bz2"
BUILD_TYPE="$BUILD_TYPE PYTHON"
# Embedded Python dies without Home set
if test "$HOME" = ""; then
......
fl filter : svtools unotools xmloff cppu tools cppuhelper sal salhelper svx javaunohelper XPDF:xpdf jvmaccess canvas LIBXSLT:libxslt basegfx package PYTHON:python NULL
fl filter : svtools unotools xmloff cppu tools cppuhelper sal salhelper svx javaunohelper XPDF:xpdf jvmaccess canvas LIBXSLT:libxslt basegfx package PYTHON:python3 NULL
fl filter\prj nmake - all fl_prj NULL
......@@ -48,7 +48,9 @@ $(eval $(call gb_Library_set_include,pyuno_wrapper,\
))
else
$(eval $(call gb_Library_set_include,pyuno_wrapper,\
-I$(OUTDIR)/inc/python \
-I$(call gb_UnpackedTarball_get_dir,python3) \
-I$(call gb_UnpackedTarball_get_dir,python3)/PC \
-I$(call gb_UnpackedTarball_get_dir,python3)/Include \
$$(INCLUDE) \
))
endif
......
bgpu pyuno : salhelper stoc cpputools cppuhelper bridges tools PYTHON:python LIBXSLT:libxslt NULL
bgpu pyuno : salhelper stoc cpputools cppuhelper bridges tools PYTHON:python3 LIBXSLT:libxslt NULL
pu pyuno usr1 - all br_mkout NULL
pu pyuno\prj nmake - all pu_prj NULL
......@@ -57,7 +57,7 @@ export PYTHONHOME
# execute binary
exec "$sd_prog/python.bin" "$@"
MACSECTION
PYTHONHOME=$sd_prog/OOoPython.framework
PYTHONHOME=$sd_prog/LibreOfficePython.framework
export PYTHONHOME
pybasislibdir=$PYTHONHOME/Versions/%%PYVERSION%%/lib/python%%PYVERSION%%
......@@ -65,4 +65,4 @@ PYTHONPATH=$sd_prog:$pybasislibdir:$pybasislibdir/lib-dynload:$pybasislibdir/lib
export PYTHONPATH
# execute binary
exec "$PYTHONHOME/Versions/%%PYVERSION%%/Resources/Python.app/Contents/MacOS/OOoPython" "$@"
exec "$PYTHONHOME/Versions/%%PYVERSION%%/Resources/Python.app/Contents/MacOS/LibreOfficePython" "$@"
......@@ -50,6 +50,7 @@ include $(OUTDIR)/inc/pyversion.Makefile
$(eval $(call gb_InstallModule_add_defs,scp2/python,\
-DPYVERSION=$(PYVERSION) \
-DPYMAJMIN=$(PYMAJOR).$(PYMINOR) \
-DPYMAJOR=$(PYMAJOR) \
-DPY_FULL_DLL_NAME=$(PY_FULL_DLL_NAME) \
))
endif
......
cp scp2 : i18npool DESKTOP:l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
cp scp2 : i18npool DESKTOP:l10ntools PYTHON:python3 ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
cp scp2 usr1 - all cp_mkout NULL
cp scp2\prj nmake - all cp_prj NULL
......@@ -96,7 +96,7 @@ File gid_File_Py_Python_Core
TXT_FILE_BODY;
#ifdef MACOSX
Dir = gid_Brand_Dir_Program;
Name = "OOoPython.framework.zip";
Name = "LibreOfficePython.framework.zip";
Styles = (ARCHIVE,USE_INTERNAL_RIGHTS);
#else
Dir = gid_Dir_Py_PythonCore_Lib;
......@@ -153,35 +153,21 @@ File gid_File_Lib_Python_So
Name = STRING(PY_FULL_DLL_NAME);
Styles = (PACKED);
End
#ifdef UNX
Shortcut gid_Shortcut_Lib_Python_So
FileID = gid_File_Lib_Python_So;
File gid_File_Lib_Python3_So
LIB_FILE_BODY;
Dir = gid_Brand_Dir_Program;
Name = STRING(CONCAT3(libpython,PYMAJMIN,UNXSUFFIX));
Styles = (NETWORK,RELATIVE);
End
#ifdef UNX
Name = STRING(CONCAT3(libpython,PYMAJOR,UNXSUFFIX));
#else // WNT
Name = STRING(CONCAT3(python,PYMAJOR,.dll));
#endif //UNX
Styles = (PACKED);
End
#else //MACOSX
//directory entries solely to be able to create the symlinks
Directory gid_Dir_PythonFramework
ParentID = gid_Brand_Dir_Program;
HostName = "OOoPython.framework";
End
Unixlink gid_Unixlink_Python_Headers
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework;
Name = "Headers";
Target = "Versions/Current/Headers";
Styles = ();
End
Unixlink gid_Unixlink_Python_Resources
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework;
Name = "Resources";
Target = "Versions/Current/Resources";
Styles = ();
HostName = "LibreOfficePython.framework";
End
Directory gid_Dir_PythonFramework_Versions
......@@ -189,27 +175,11 @@ Directory gid_Dir_PythonFramework_Versions
HostName = "Versions";
End
Unixlink gid_Unixlink_Python_Versions_Current
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions;
Name = "Current";
Target = STRING(PYMAJMIN);
Styles = ();
End
Directory gid_Dir_PythonFramework_Versions_ver
ParentID = gid_Dir_PythonFramework_Versions;
HostName = STRING(PYMAJMIN);
End
Unixlink gid_Unixlink_Python_Versions_ver_Headers
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver;
Name = "Headers";
Target = STRING(CONCAT2(include/python,PYMAJMIN));
Styles = ();
End
Directory gid_Dir_PythonFramework_Versions_ver_bin
ParentID = gid_Dir_PythonFramework_Versions_ver;
HostName = "bin";
......@@ -220,6 +190,11 @@ Directory gid_Dir_PythonFramework_Versions_ver_lib
HostName = "lib";
End
Directory gid_Dir_PythonFramework_Versions_ver_lib_pkgconfig
ParentID = gid_Dir_PythonFramework_Versions_ver_lib;
HostName = "pkgconfig";
End
Directory gid_Dir_PythonFramework_Versions_ver_lib_pythonver
ParentID = gid_Dir_PythonFramework_Versions_ver_lib;
HostName = STRING(CONCAT2(python,PYMAJMIN));
......@@ -227,45 +202,69 @@ End
Directory gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config
ParentID = gid_Dir_PythonFramework_Versions_ver_lib_pythonver;
HostName = "config";
HostName = STRING(CONCAT3(config-,PYMAJMIN,m));
End
Unixlink gid_Unixlink_Python_OOoPython
Unixlink gid_Unixlink_Python_Headers
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework;
Name = "OOoPython";
Target = "Versions/Current/OOoPython";
Name = "Headers";
Target = "Versions/Current/Headers";
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_idle
Unixlink gid_Unixlink_Python_LibreOfficePython
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "idle";
Target = STRING(CONCAT2(idle,PYMAJMIN));
Dir = gid_Dir_PythonFramework;
Name = "LibreOfficePython";
Target = "Versions/Current/LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_pydoc
Unixlink gid_Unixlink_Python_Resources
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework;
Name = "Resources";
Target = "Versions/Current/Resources";
Styles = ();
End
Unixlink gid_Unixlink_Python_Versions_Current
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions;
Name = "Current";
Target = STRING(PYMAJMIN);
Styles = ();
End
Unixlink gid_Unixlink_Python_Versions_ver_Headers
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver;
Name = "Headers";
Target = STRING(CONCAT3(include/python,PYMAJMIN,m));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_idle
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "pydoc";
Target = STRING(CONCAT2(pydoc,PYMAJMIN));
Name = "idle3";
Target = STRING(CONCAT2(idle,PYMAJMIN));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_python_real
Unixlink gid_Unixlink_Python_bin_pydoc
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "python";
Target = "../Resources/Python.app/Contents/MacOS/OOoPython";
Name = "pydoc3";
Target = STRING(CONCAT2(pydoc,PYMAJMIN));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_python
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "python";
Name = "python3";
Target = STRING(CONCAT2(python,PYMAJMIN));
Styles = ();
End
......@@ -273,40 +272,88 @@ End
Unixlink gid_Unixlink_Python_bin_pythonconfig
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "python-config";
Name = "python3-config";
Target = STRING(CONCAT3(python,PYMAJMIN,-config));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_pythonw_real
Unixlink gid_Unixlink_Python_bin_pythonw
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "pythonw";
Target = "../Resources/Python.app/Contents/MacOS/OOoPython";
Name = "pythonw3";
Target = STRING(CONCAT2(pythonw,PYMAJMIN));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_pythonw
Unixlink gid_Unixlink_Python_bin_pyvenv
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "pythonw";
Target = STRING(CONCAT2(pythonw,PYMAJMIN));
Name = "pyvenv";
Target = STRING(CONCAT2(pyvenv-,PYMAJMIN));
Styles = ();
End
Unixlink gid_Unixlink_Python_bin_smtpdpy
Unixlink gid_Unixlink_Python_libpython
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_bin;
Name = "smtpd.py";
Target = STRING(CONCAT3(smtpd,PYMAJMIN,.py));
Dir = gid_Dir_PythonFramework_Versions_ver_lib;
Name = STRING(CONCAT3(libpython,PYMAJMIN,.dylib));
Target = "../LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_libpython
Unixlink gid_Unixlink_Python_libpython_m
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib;
Name = STRING(CONCAT3(libpython,PYMAJMIN,m.dylib));
Target = "../LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_pkgconfig
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pkgconfig;
Name = "python3.pc";
Target = STRING(CONCAT3(python-,PYMAJMIN,.pc));
Styles = ();
End
Unixlink gid_Unixlink_Python_pkgconfig_m
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pkgconfig;
Name = STRING(CONCAT3(python-,PYMAJMIN,m.pc));
Target = STRING(CONCAT3(python-,PYMAJMIN,.pc));
Styles = ();
End
Unixlink gid_Unixlink_Python_libpython_config_a
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config;
Name = STRING(PY_FULL_DLL_NAME);
Target = "../../../OOoPython";
Name = STRING(CONCAT3(libpython,PYMAJMIN,.a));
Target = "../../../LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_libpython_config_dylib
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config;
Name = STRING(CONCAT3(libpython,PYMAJMIN,.dylib));
Target = "../../../LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_libpython_m_config_a
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config;
Name = STRING(CONCAT3(libpython,PYMAJMIN,m.a));
Target = "../../../LibreOfficePython";
Styles = ();
End
Unixlink gid_Unixlink_Python_libpython_m_config_dylib
BIN_FILE_BODY;
Dir = gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config;
Name = STRING(CONCAT3(libpython,PYMAJMIN,m.dylib));
Target = "../../../LibreOfficePython";
Styles = ();
End
#endif //MACOSX
......
......@@ -39,6 +39,7 @@ Module gid_Module_Optional_Pyuno
gid_Dir_PythonFramework_Versions_ver,
gid_Dir_PythonFramework_Versions_ver_bin,
gid_Dir_PythonFramework_Versions_ver_lib,
gid_Dir_PythonFramework_Versions_ver_lib_pkgconfig,
gid_Dir_PythonFramework_Versions_ver_lib_pythonver,
gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config,
gid_Dir_Py_PythonCore,
......@@ -54,23 +55,28 @@ Module gid_Module_Optional_Pyuno
gid_File_Py_Python_Core,
gid_File_Py_Python_Bin,
gid_File_Lib_Python_So,
gid_Shortcut_Lib_Python_So,
gid_File_Lib_Python3_So,
gid_File_Scripts_Python,
gid_File_Share_Registry_Pyuno_Xcd);
Unixlinks = (gid_Unixlink_Python_Headers,
gid_Unixlink_Python_LibreOfficePython,
gid_Unixlink_Python_Resources,
gid_Unixlink_Python_Versions_Current,
gid_Unixlink_Python_Versions_ver_Headers,
gid_Unixlink_Python_OOoPython,
gid_Unixlink_Python_bin_idle,
gid_Unixlink_Python_bin_pydoc,
gid_Unixlink_Python_bin_python_real,
gid_Unixlink_Python_bin_python,
gid_Unixlink_Python_bin_pythonconfig,
gid_Unixlink_Python_bin_pythonw_real,
gid_Unixlink_Python_bin_pythonw,
gid_Unixlink_Python_bin_smtpdpy,
gid_Unixlink_Python_libpython);
gid_Unixlink_Python_bin_pyvenv,
gid_Unixlink_Python_libpython,
gid_Unixlink_Python_libpython_m,
gid_Unixlink_Python_pkgconfig,
gid_Unixlink_Python_pkgconfig_m,
gid_Unixlink_Python_libpython_config_a,
gid_Unixlink_Python_libpython_config_dylib,
gid_Unixlink_Python_libpython_m_config_a,
gid_Unixlink_Python_libpython_m_config_dylib);
Minimal = NO;
Default = YES;
Styles = ( );
......
......@@ -48,7 +48,7 @@ ProfileItem gid_Profileitem_Pythonloader_Pythonhome
Order = 1;
Key = "PYUNO_LOADER_PYTHONHOME";
#ifdef MACOSX
Value = CONCAT2($ORIGIN,"OOoPython.framework");
Value = CONCAT2($ORIGIN,/LibreOfficePython.framework);
#else
Value = CONCAT2($ORIGIN/python-core-,PYVERSION);
#endif
......@@ -66,7 +66,7 @@ ProfileItem gid_Profileitem_Pythonloader_Pythonpath
#else
#ifdef UNX
#ifdef MACOSX
#define FRAMEWORKLIB CONCAT4($ORIGIN/OOoPython.framework/Versions/,PYMAJMIN,/lib/python,PYMAJMIN)
#define FRAMEWORKLIB CONCAT3($ORIGIN,/LibreOfficePython.framework/Versions/Current/lib/python,PYMAJMIN)
Value = CONCAT4(FRAMEWORKLIB FRAMEWORKLIB,
/lib-dynload FRAMEWORKLIB,
/lib-tk FRAMEWORKLIB,
......
......@@ -67,7 +67,8 @@ foreach $file (@todo)
{
my $full = $1;
my $loc = locate($2);
$loc = locate($1) if $full =~ m'^\s*@loader_path/(OOoPython.framework/Versions/[^/]+/OOoPython)';
# mapping for PythonFramework in RepositoryExternal.mk
next if $full =~ m'^\s*@loader_path/(LibreOfficePython.framework/Versions/[^/]+/LibreOfficePython)';
if (defined $loc)
{
handle($full, $loc) unless defined $done{$full};
......
tb tail_build : CPPUNIT:cppunit EXPAT:expat FONTCONFIG:fontconfig ICU:icu LIBPNG:libpng LIBXML2:libxml2 libxmlsec LIBXSLT:libxslt MOZ:moz NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland XPDF:xpdf ZLIB:zlib external solenv soltools NULL
tb tail_build : CPPUNIT:cppunit EXPAT:expat FONTCONFIG:fontconfig ICU:icu LIBPNG:libpng LIBXML2:libxml2 libxmlsec LIBXSLT:libxslt MOZ:moz NSS:nss OPENSSL:openssl PYTHON:python3 REDLAND:redland XPDF:xpdf ZLIB:zlib external solenv soltools NULL
tb tail_build\prj nmake - all tb_prj NULL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment