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

replace python-core zip built in pyuno with direct use of Package

- python3: deliver files to INSTDIR, with same layout as instset
  and do not deliver .lib files
- pyuno: remove obsolete python.bin targets
- pyuno: remove usage of CustomTarget_zip for WNT and non-Mac UNX
  platforms (sadly it is apparently still needed for "system" python on
  MinGW)
- scp2: use the python3 filelist
  There is still a problem here because the installer does not currently
  allow to preserve the executable bit on files in a filelist
- RepositoryExternal: run python executable from INSTDIR
  and link against libraries in UnpackedTarball dir

Change-Id: I931ca0a8be6ff40051b1ca50da1f0770e6057832
Reviewed-on: https://gerrit.libreoffice.org/3525Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 60a466c0
...@@ -2300,15 +2300,16 @@ $(call gb_LinkTarget__use_python_headers,$(1)) ...@@ -2300,15 +2300,16 @@ $(call gb_LinkTarget__use_python_headers,$(1))
ifeq ($(OS),WNT) ifeq ($(OS),WNT)
$(call gb_LinkTarget_add_libs,$(1),\ $(call gb_LinkTarget_add_libs,$(1),\
python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(MSVC_USE_DEBUG_RUNTIME),_d).lib \ $(call gb_UnpackedTarball_get_dir,python3)/$(if $(filter 90,$(VCVER)),PC/VS9.0,PCbuild)$(if $(filter X86_64,$(CPUNAME)),/amd64)/python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(MSVC_USE_DEBUG_RUNTIME),_d).lib \
) )
else ifeq ($(OS),MACOSX) else ifeq ($(OS),MACOSX)
$(call gb_LinkTarget_add_libs,$(1),\ $(call gb_LinkTarget_add_libs,$(1),\
-F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \ -F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \
) )
else else
$(call gb_LinkTarget_use_libraries,$(1),\ $(call gb_LinkTarget_add_libs,$(1),\
python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \ -L$(call gb_UnpackedTarball_get_dir,python3) \
-lpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
) )
endif endif
...@@ -2888,8 +2889,8 @@ $(call gb_ExternalExecutable_add_dependencies,python,$(call gb_Zip_get_outdir_ta ...@@ -2888,8 +2889,8 @@ $(call gb_ExternalExecutable_add_dependencies,python,$(call gb_Zip_get_outdir_ta
else else
$(call gb_ExternalExecutable_set_internal,python) $(call gb_ExternalExecutable_set_internal,python,$(INSTDIR)/program/$(if $(filter WNT,$(OS)),python-core-$(PYTHON_VERSION)/bin/python.exe,python.bin))
$(call gb_ExternalExecutable_set_precommand,python,$(gb_PYTHON_PRECOMMAND)) $(call gb_ExternalExecutable_set_precommand,python,$(gb_Python_PRECOMMAND))
$(call gb_ExternalExecutable_add_dependencies,python,$(call gb_Package_get_target_for_build,python3)) $(call gb_ExternalExecutable_add_dependencies,python,$(call gb_Package_get_target_for_build,python3))
endif endif
......
...@@ -33,7 +33,7 @@ ifeq ($(OS)$(COM),WNTGCC) ...@@ -33,7 +33,7 @@ ifeq ($(OS)$(COM),WNTGCC)
pyuno_PYTHON_LIB_DIR=$(MINGW_SYSROOT)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) pyuno_PYTHON_LIB_DIR=$(MINGW_SYSROOT)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
endif endif
else else
pyuno_PYTHON_LIB_DIR=$(OUTDIR)/lib/python $(error SHOULD NOT GET HERE)
endif endif
pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYTHON_VERSION).zip pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYTHON_VERSION).zip
......
...@@ -62,26 +62,12 @@ $(eval $(call gb_Module_add_targets,pyuno,\ ...@@ -62,26 +62,12 @@ $(eval $(call gb_Module_add_targets,pyuno,\
CustomTarget_python_shell \ CustomTarget_python_shell \
Package_python_shell \ Package_python_shell \
)) ))
ifneq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,pyuno,\
CustomTarget_python_bin \
Package_python_bin \
))
endif
endif
# python-zipcore-$(PYVESION) not on MACOSX
# (OOoPython.framework.zip is already delivered for MACOSX in python module)
ifneq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,pyuno,\
CustomTarget_zipcore \
Package_zipcore \
))
endif endif
else # SYSTEM_PYTHON else # SYSTEM_PYTHON
# previous two targets has to be executed also with system-python on mingw # these two targets have to be executed only with system-python on mingw
# FIXME remove this
ifeq ($(OS)$(COM),WNTGCC) ifeq ($(OS)$(COM),WNTGCC)
$(eval $(call gb_Module_add_targets,pyuno,\ $(eval $(call gb_Module_add_targets,pyuno,\
CustomTarget_zipcore \ CustomTarget_zipcore \
......
...@@ -102,15 +102,16 @@ End ...@@ -102,15 +102,16 @@ End
#endif #endif
File gid_File_Py_Python_Core File gid_File_Py_Python_Core
TXT_FILE_BODY; //FIXME the binaries and libs in the package need x bit but USE_INTERNAL_RIGHTS does not work so set BIN_FILE_BODY here as a temporary hack which makes everything executable
BIN_FILE_BODY;
#ifdef MACOSX #ifdef MACOSX
Dir = gid_Brand_Dir_Program; Dir = gid_Brand_Dir_Program;
Name = "LibreOfficePython.framework.zip"; Name = "LibreOfficePython.framework.zip";
Styles = (ARCHIVE,USE_INTERNAL_RIGHTS); Styles = (ARCHIVE,USE_INTERNAL_RIGHTS);
#else #else
Dir = gid_Dir_Py_PythonCore_Lib; Dir = FILELIST_DIR;
Name = STRING(CONCAT3(python-core-,PYVERSION,.zip)); Name = "python3.filelist";
Styles = (ARCHIVE); Styles = (FILELIST,USE_INTERNAL_RIGHTS);
#endif #endif
End End
...@@ -121,20 +122,7 @@ Directory gid_Dir_Py_PythonCore_Bin ...@@ -121,20 +122,7 @@ Directory gid_Dir_Py_PythonCore_Bin
End End
#endif #endif
#ifndef MACOSX #endif // SYSTEM_PYTHON
File gid_File_Py_Python_Bin
BIN_FILE_BODY;
#ifdef UNX
Dir = gid_Brand_Dir_Program;
Name = "python.bin";
#else
Dir = gid_Dir_Py_PythonCore_Bin;
Name = EXENAME(python);
#endif
Styles = (PACKED);
End
#endif
#endif
//Scripting Framework Python example scripts //Scripting Framework Python example scripts
...@@ -155,26 +143,7 @@ File gid_File_Share_Registry_Pyuno_Xcd ...@@ -155,26 +143,7 @@ File gid_File_Share_Registry_Pyuno_Xcd
End End
#ifndef SYSTEM_PYTHON #ifndef SYSTEM_PYTHON
#ifndef MACOSX #ifdef MACOSX
File gid_File_Lib_Python_So
LIB_FILE_BODY;
Dir = gid_Brand_Dir_Program;
Name = STRING(PY_FULL_DLL_NAME);
Styles = (PACKED);
End
#ifndef MSVC_PKG_DEBUG_RUNTIME
File gid_File_Lib_Python3_So
LIB_FILE_BODY;
Dir = gid_Brand_Dir_Program;
#ifdef UNX
Name = STRING(CONCAT3(libpython,PYMAJOR,UNXSUFFIX));
#else // WNT
Name = STRING(CONCAT3(python,PYMAJOR,.dll));
#endif //UNX
Styles = (PACKED);
End
#endif
#else //MACOSX
//directory entries solely to be able to create the symlinks //directory entries solely to be able to create the symlinks
Directory gid_Dir_PythonFramework Directory gid_Dir_PythonFramework
ParentID = gid_Brand_Dir_Program; ParentID = gid_Brand_Dir_Program;
......
...@@ -623,7 +623,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform := ...@@ -623,7 +623,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform :=
gb_Pyuno_PROGRAMDIRNAME := program gb_Pyuno_PROGRAMDIRNAME := program
# Python # Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload" gb_Python_PRECOMMAND := PATH="$(shell cygpath -w $(INSTDIR)/program);$(shell cygpath -w $(OUTDIR)/bin)" PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib;$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program"
gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/program/python.exe gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/program/python.exe
# vim: set noet sw=4: # vim: set noet sw=4:
...@@ -402,7 +402,7 @@ $(call gb_UIMenubarTarget_get_target,$(1)) :| $(call gb_ExternalExecutable_get_d ...@@ -402,7 +402,7 @@ $(call gb_UIMenubarTarget_get_target,$(1)) :| $(call gb_ExternalExecutable_get_d
endef endef
# Python # Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib gb_Python_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython
# this is passed to gdb as executable when running tests # this is passed to gdb as executable when running tests
gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_Python_INSTALLED_EXECUTABLE) gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_Python_INSTALLED_EXECUTABLE)
......
...@@ -434,7 +434,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform := ...@@ -434,7 +434,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform :=
gb_Pyuno_PROGRAMDIRNAME := program gb_Pyuno_PROGRAMDIRNAME := program
# Python # Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload"
gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python
# this is passed to gdb as executable when running tests # this is passed to gdb as executable when running tests
gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin
......
...@@ -433,7 +433,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform := ...@@ -433,7 +433,7 @@ gb_UIMenubarTarget_UIMenubarTarget_platform :=
gb_Pyuno_PROGRAMDIRNAME := program gb_Pyuno_PROGRAMDIRNAME := program
# Python # Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload"
gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python
# this is passed to gdb as executable when running tests # this is passed to gdb as executable when running tests
gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin
......
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