python3: get python.exe from extern

Instead of downloading nuget.exe and then python.exe
as explained in https://lists.freedesktop.org/archives/libreoffice/2025-January/092881.html,
Add python.3.12.8.nupkg to extern and download it as a tarball
to unzip it in external/pythonx86.
find_python.bat will look for python.exe in external/pythonx86/tools

Downloaded from
https://globalcdn.nuget.org/packages/python.3.12.8.nupkg?packageVersion=3.12.8

Change-Id: Ib1638fa66b3983048c2f9a472d00ce365602fcbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180078
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Xisco Fauli
2025-01-10 23:18:29 +01:00
parent 3eb7cdd6ec
commit c9ae567c79
5 changed files with 16 additions and 18 deletions
+1
View File
@@ -225,6 +225,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,POPPLER,POPPLER_DATA_TARBALL) \
$(call fetch_Optional,POSTGRESQL,POSTGRESQL_TARBALL) \
$(call fetch_Optional,PYTHON,PYTHON_TARBALL) \
$(if $(filter WNT,$(OS)),PYTHON_BOOTSTRAP_TARBALL) \
$(call fetch_Optional,QXP,QXP_TARBALL) \
$(call fetch_Optional,REDLAND,RAPTOR_TARBALL) \
$(call fetch_Optional,REDLAND,RASQAL_TARBALL) \
+5
View File
@@ -595,6 +595,11 @@ PYTHON_TARBALL := Python-3.11.11.tar.xz
# three static lines
# so that git cherry-pick
# will not run into conflicts
PYTHON_BOOTSTRAP_SHA256SUM := 406856be971d957e0bee7a5cefe20a5ec78d70a495e9e33cd0e53d31faec049d
PYTHON_BOOTSTRAP_TARBALL := python.3.12.8.nupkg
# three static lines
# so that git cherry-pick
# will not run into conflicts
QXP_SHA256SUM := e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
QXP_TARBALL := libqxp-0.0.2.tar.xz
# three static lines
-6
View File
@@ -33,15 +33,9 @@ ifeq ($(OS),WNT)
# at least for MSVC 2008 it is necessary to clear MAKEFLAGS because
# nmake is invoked
#
# Since Python 3.11, _freeze_module.vcxproj needs python.exe to build
# deepfreeze.c. At the moment target _RebuildDeepFrozen is called, python.exe
# doesn't exist yet so it needs to be downloaded using nuget.
# Call find_python.bat first to have nuget.exe and python.exe ready before building
$(call gb_ExternalProject_get_state_target,python3,build) :
$(call gb_Trace_StartRange,python3,EXTERNAL)
$(call gb_ExternalProject_run,build,\
cmd /c $(gb_UnpackedTarball_workdir)/python3/PCbuild/find_python.bat -q && \
MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build $(gb_MSBUILD_CONFIG_AND_PLATFORM) \
/p:bz2Dir=$(gb_UnpackedTarball_workdir)/bzip2 \
/p:opensslIncludeDir=$(gb_UnpackedTarball_workdir)/openssl/include \
+10 -1
View File
@@ -11,6 +11,16 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,python3))
$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3))
# Since Python 3.11, _freeze_module.vcxproj needs python.exe to build deepfreeze.c
# on Windows
ifeq ($(OS),WNT)
$(eval $(call gb_UnpackedTarball_set_pre_action,python3,\
mkdir -p externals/pythonx86 && \
unzip -q -d externals/pythonx86 -o $(gb_UnpackedTarget_TARFILE_LOCATION)/$(PYTHON_BOOTSTRAP_TARBALL) && \
chmod +x externals/pythonx86/tools/* \
))
endif
$(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\
PCbuild/libffi.props \
PCbuild/pcbuild.sln \
@@ -25,7 +35,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/i100492-freebsd.patch.1 \
external/python3/python-3.3.0-darwin.patch.1 \
external/python3/python-3.7.6-msvc-ssl.patch.1 \
external/python3/replace-powershell-with-wget.patch.1 \
external/python3/python-3.5.4-msvc-disable.patch.1 \
external/python3/ubsan.patch.0 \
external/python3/python-3.5.tweak.strip.soabi.patch \
-11
View File
@@ -1,11 +0,0 @@
--- python3/PCbuild/find_python.bat 2025-01-03 11:53:41.867445033 +0100
+++ python3/PCbuild/find_python.bat 2025-01-03 11:54:25.018865518 +0100
@@ -56,7 +56,7 @@
@rem NB: Must use single quotes around NUGET here, NOT double!
@rem Otherwise, a space in the path would break things
@rem If it fails, retry with any available copy of Python
- @powershell.exe -Command Invoke-WebRequest %_Py_NUGET_URL% -OutFile '%_Py_NUGET%'
+ @wget -O '%_Py_NUGET%' %_Py_NUGET_URL%
@if errorlevel 1 (
@%_Py_HOST_PYTHON% -E "%_Py_D%\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%"
)