Skip to content

Python 3.13, site-packages and SDK 2013 update #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
13492ea
First part of Win update
Ayuto Apr 1, 2025
284fe5b
Update Python
Ayuto Apr 1, 2025
e32e72b
Fixed dict usage before Python initialization (thanks to spitice)
Ayuto Apr 15, 2025
a1bf96d
Fix Python initialization
Ayuto Apr 15, 2025
e84647e
Update site packages
Ayuto Apr 16, 2025
8f691e4
Fixes due to updated path library
Ayuto Apr 16, 2025
f3f1647
Fix cmake deprecation warnings
Ayuto Apr 16, 2025
061c063
OB SDK fixes
Ayuto Apr 16, 2025
6ac5afe
Fix deprecated datetime function.
Ayuto Apr 16, 2025
81c5b67
Remove tf2 patches
Ayuto Apr 16, 2025
a45cd6e
Remove hl2dm patches
Ayuto Apr 16, 2025
30b818b
Remove patched tier1 for l4d2
Ayuto Apr 16, 2025
977f87c
Fix SDK link libs
Ayuto Apr 16, 2025
7e9a70d
Fix gmod
Ayuto Apr 16, 2025
91691e6
Remove bms patch and fix compilation
Ayuto Apr 16, 2025
28750cd
Remove blade patch
Ayuto Apr 16, 2025
685d27c
Update documentation
Ayuto Apr 16, 2025
2d7e65c
Updated docs for building
Ayuto Apr 16, 2025
732b121
Add static AsmJit lib for Linux
Ayuto Apr 17, 2025
5b9d787
Add static DynamicHooks lib for Linux
Ayuto Apr 17, 2025
740e098
Python update linux
Ayuto Apr 17, 2025
835bc69
32bit Python...
Ayuto Apr 17, 2025
a2e6639
Added Boost libs
Ayuto Apr 17, 2025
cee5da7
Fix link libraries
Ayuto Apr 17, 2025
76171e7
Final fixes
Ayuto Apr 17, 2025
5499de4
Fix path to sqlite lib
Ayuto Apr 17, 2025
081c601
Add sysconfigdata
Ayuto Apr 17, 2025
5f50c5b
Merge branch 'master' into py313
Ayuto Apr 18, 2025
c1836ae
Fix some Sphinx warnings
Ayuto Apr 18, 2025
2b6018a
Add requirements.txt
Ayuto Apr 18, 2025
4b63c1a
Accidentally installed the wrong arch...
Ayuto Apr 18, 2025
3cfe784
Add Linux site-packages
Ayuto Apr 18, 2025
092a33c
Fix documentation
Ayuto Apr 18, 2025
0eea28b
Use c++17
Ayuto Apr 18, 2025
3ba852d
Patches for bms and gmod (use V_swap instead of swap)
Ayuto Apr 18, 2025
0ee352f
PRs have been merged already
Ayuto Apr 18, 2025
720c2df
Use devenv to build Win from cmd
Ayuto Apr 18, 2025
2cba278
Also clear site-packages when updating
Ayuto Apr 18, 2025
a1b20f8
Updated requirements doc
Ayuto Apr 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Next Next commit
First part of Win update
  • Loading branch information
Ayuto committed Apr 1, 2025
commit 13492ea8e73cf07114de9472ef349c1b69152940
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion src/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ goto CloneRepo
if not exist %BUILDDIR% mkdir %BUILDDIR%

:: Create the build files
cmake . -B%BUILDDIR% -G"Visual Studio 10" -DBRANCH=%branch%
cmake . -B%BUILDDIR% -G"Visual Studio 17" -A Win32 -DBRANCH=%branch%

if %use_msbuild% == 1 (
msbuild %BUILDDIR%\source-python.sln /p:Configuration="Release" /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0"
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ Add_Definitions(
-DSOURCE_ENGINE=${SOURCE_ENGINE}
-DSOURCE_ENGINE_BRANCH=${BRANCH}
-DBOOST_PYTHON_MAX_ARITY=32
-DASMJIT_STATIC=1
)

# ------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/core/modules/entities/entities_datamaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "entities_datamaps.h"
#include ENGINE_INCLUDE_PATH(entities_datamaps_wrap.h)

using namespace boost::placeholders;


// ============================================================================
// >> TYPEDEFS
Expand Down
29 changes: 24 additions & 5 deletions src/core/sp_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,32 @@ bool CPythonManager::Initialize( void )
wchar_t wszProgramName[MAX_PATH_LENGTH];
V_strtowcs(szProgramName, -1, wszProgramName, MAX_PATH_LENGTH);

PyStatus status;

PyConfig config;
PyConfig_InitPythonConfig(&config);

status = PyConfig_SetString(&config, &config.program_name, wszProgramName);
if (PyStatus_Exception(status)) {
Msg(MSG_PREFIX "Failed to set Python program name.\n");
PyConfig_Clear(&config);
Py_ExitStatusException(status);
return false;
}

status = PyConfig_SetString(&config, &config.home, wszPythonHome);
if (PyStatus_Exception(status)) {
Msg(MSG_PREFIX "Failed to set Python home.\n");
PyConfig_Clear(&config);
Py_ExitStatusException(status);
return false;
}

// Set that as the python home directory.
Py_SetPythonHome(wszPythonHome);
Py_SetProgramName(wszProgramName);
Py_SetPath(wszPythonHome);
//Py_SetPath(wszPythonHome);

// Initialize python and its namespaces.
Py_Initialize();
status = Py_InitializeFromConfig(&config);
PyConfig_Clear(&config);

// Print some information
DevMsg(1, MSG_PREFIX "Python version %s initialized!\n", Py_GetVersion());
Expand Down
2 changes: 1 addition & 1 deletion src/loader/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//---------------------------------------------------------------------------------
// Definitions
//---------------------------------------------------------------------------------
#define PYLIB_NAME_WIN32 "Python3/plat-win/python36.dll"
#define PYLIB_NAME_WIN32 "Python3/plat-win/python313.dll"
#define PYLIB_NAME_LINUX "Python3/plat-linux/libpython3.6m.so.1.0"

#define CORE_NAME_WIN32 "bin/core.dll"
Expand Down
12 changes: 7 additions & 5 deletions src/makefiles/win32/win32.base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Set(CMAKE_CXX_FLAGS_RELEASE "/D_NDEBUG /MD /wd4005 /MP")
# For the debug config we need to specify the release flag and vice versa.
target_compile_options(source-python PRIVATE "/MT$<$<CONFIG:Debug>:d>")
target_compile_options(source-python PRIVATE "/MTd$<$<CONFIG:Release>:d>")
target_compile_options(core PRIVATE "/MT$<$<CONFIG:Debug>:d>")
target_compile_options(core PRIVATE "/MTd$<$<CONFIG:Release>:d>")

Set_Target_Properties(core PROPERTIES
LINK_FLAGS_RELEASE "/NODEFAULTLIB:LIBC.lib /NODEFAULTLIB:LIBCMT.lib /NODEFAULTLIB:LIBCPMT.lib"
Expand All @@ -61,8 +63,8 @@ Set(SOURCEPYTHON_LINK_LIBRARIES
${DYNCALLSDK_LIB}/libdynload_s.lib
${ASMJITSDK_LIB}/AsmJit.lib
${DYNAMICHOOKSSDK_LIB}/DynamicHooks.lib
${BOOSTSDK_LIB}/libboost_filesystem-vc100-mt-s-1_64.lib
${BOOSTSDK_LIB}/libboost_system-vc100-mt-s-1_64.lib
${BOOSTSDK_LIB}/libboost_filesystem-vc143-mt-s-x32-1_87.lib
${BOOSTSDK_LIB}/libboost_system-vc143-mt-s-x32-1_87.lib
)

# CSGO Engine adds in interfaces.lib
Expand All @@ -76,16 +78,16 @@ Endif()
If( SOURCE_ENGINE MATCHES "csgo" OR SOURCE_ENGINE MATCHES "blade")
Set(SOURCEPYTHON_LINK_LIBRARIES
${SOURCEPYTHON_LINK_LIBRARIES}
${SOURCESDK_LIB}/win32/release/vs2010/libprotobuf.lib
${SOURCESDK_LIB}/win32/release/vs2017/libprotobuf.lib
)
Endif()

# ------------------------------------------------------------------
# Release link libraries
# ------------------------------------------------------------------
Set(SOURCEPYTHON_LINK_LIBRARIES_RELEASE
optimized ${PYTHONSDK_LIB}/python36.lib
optimized ${BOOSTSDK_LIB}/libboost_python3-vc100-mt-1_64.lib
optimized ${PYTHONSDK_LIB}/python313.lib
optimized ${BOOSTSDK_LIB}/libboost_python313-vc143-mt-s-x32-1_87.lib
)

If( SOURCE_ENGINE MATCHES "csgo" )
Expand Down
Binary file removed src/patches/csgo/lib/public/tier1.lib
Binary file not shown.
Binary file not shown.
24 changes: 0 additions & 24 deletions src/thirdparty/AsmJit/include/ApiBegin.h

This file was deleted.

16 changes: 0 additions & 16 deletions src/thirdparty/AsmJit/include/ApiEnd.h

This file was deleted.

Loading