forked from multitheftauto/mtasa-blue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update MySQL to 8.4.0 and OpenSSL to 3.3.1
- Loading branch information
Showing
30 changed files
with
536 additions
and
237 deletions.
There are no files selected for viewing
Binary file modified
BIN
+54.5 KB
(100%)
Shared/data/MTA San Andreas/server/arm64/libcrypto-3-arm64.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+39 KB
(100%)
Shared/data/MTA San Andreas/server/mods/deathmatch/libcrypto-3.dll
Binary file not shown.
Binary file modified
BIN
+34 KB
(100%)
Shared/data/MTA San Andreas/server/mods/deathmatch/libmysql.dll
Binary file not shown.
Binary file modified
BIN
+76.5 KB
(110%)
Shared/data/MTA San Andreas/server/mods/deathmatch/libssl-3.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
DLL files can be found in "Shared/data/MTA San Andreas/server". | ||
That directory gets copied to the "Bin" directory when you run "win-install-data.bat". | ||
|
||
The source code for MySQL and OpenSSL used to produce the binaries can be found here: | ||
https://github.com/mysql/mysql-server/releases/tag/mysql-8.4.0 | ||
https://github.com/openssl/openssl/releases/tag/openssl-3.3.1 | ||
|
||
## How to compile OpenSSL | ||
|
||
1. Install [Perl](https://strawberryperl.com/) | ||
2. Install [NASM](https://www.nasm.us/) | ||
3. Ensure both Perl and NASM are available on your `%PATH%` | ||
4. Clone the repository | ||
```bat | ||
git clone --recurse-submodules https://github.com/openssl/openssl.git | ||
cd openssl | ||
``` | ||
5. Switch to the release tag | ||
```bat | ||
git switch --detach --force --recurse-submodules openssl-3.3.1 | ||
``` | ||
6. Run `VsDevCmd.cmd` to open three Developer Command Prompts | ||
> [!IMPORTANT] | ||
> The next steps assume the OpenSSL checkout directory is `C:\GitHub\openssl` | ||
7. Switch to the `VsDevCmd: x64` console window and run these commands there: | ||
```bat | ||
cd C:\GitHub\openssl | ||
perl Configure --release --prefix="%cd%\VC-WIN64A\OpenSSL" --openssldir="%cd%\VC-WIN64A\SSL" /MT VC-WIN64A | ||
nmake | ||
nmake install | ||
``` | ||
8. Switch to the `VsDevCmd: x86` console window and run these commands there: | ||
```bat | ||
cd C:\GitHub\openssl | ||
git clean -f -x | ||
perl Configure --release --prefix="%cd%\VC-WIN32\OpenSSL" --openssldir="%cd%\VC-WIN32\SSL" /MT VC-WIN32 | ||
nmake | ||
nmake install | ||
``` | ||
9. Switch to the `VsDevCmd: arm64` console window and run these commands there: | ||
```bat | ||
cd C:\GitHub\openssl | ||
git clean -f -x | ||
perl Configure --release --prefix="%cd%\VC-WIN64-ARM\OpenSSL" --openssldir="%cd%\VC-WIN64-ARM\SSL" /MT VC-WIN64-ARM | ||
nmake | ||
nmake install | ||
``` | ||
10. | ||
> [!IMPORTANT] | ||
> Copy `VC-WIN64A\OpenSSL\include\openssl\applink.c` to `VC-WIN64-ARM\OpenSSL\include\openssl\` | ||
|
||
## How to compile MySQL | ||
|
||
1. Compile OpenSSL with the steps above | ||
2. Install [CMake](https://cmake.org/download/) | ||
3. Clone the repository | ||
```bat | ||
git clone --recurse-submodules https://github.com/mysql/mysql-server.git | ||
cd mysql-server | ||
``` | ||
4. Switch to the release tag | ||
```bat | ||
git switch --detach --force --recurse-submodules mysql-8.4.0 | ||
``` | ||
5. Apply the patch file | ||
```bat | ||
git apply path\to\vendor\mysql\mysql-server.diff | ||
``` | ||
6. Run `VsDevCmd.cmd` to open three Developer Command Prompts | ||
> [!IMPORTANT] | ||
> The next steps assume the OpenSSL checkout directory is `C:\GitHub\openssl` and the MySQL checkout directory is `C:\GitHub\mysql-server`. | ||
> You must always compile x64 before cross-compiling arm64. | ||
7. Switch to the `VsDevCmd: x64` console window and run these commands there: | ||
```bat | ||
cmake -G "Visual Studio 17 2022" -A x64 -B build-x64 -DCMAKE_INSTALL_PREFIX="%cd%\install-x64" -DWITH_SSL="C:\GitHub\openssl\VC-WIN64A\OpenSSL" | ||
cmake --build build-x64 --target INSTALL --config RelWithDebInfo | ||
``` | ||
8. Switch to the `VsDevCmd: x86` console window and run these commands there: | ||
```bat | ||
cmake -G "Visual Studio 17 2022" -A Win32 -B build-x86 -DCMAKE_INSTALL_PREFIX="%cd%\install-x86" -DWITH_SSL="C:\GitHub\openssl\VC-WIN32\OpenSSL" | ||
cmake --build build-x86 --target INSTALL --config RelWithDebInfo | ||
``` | ||
9. Switch to the `VsDevCmd: arm64` console window and run these commands there: | ||
```bat | ||
cmake -G "Visual Studio 17 2022" -A ARM64 -B build-arm64 -DCMAKE_INSTALL_PREFIX="%cd%\install-arm64" -DWITH_SSL="C:\GitHub\openssl\VC-WIN64-ARM\OpenSSL" | ||
cmake --build build-arm64 --target INSTALL --config RelWithDebInfo | ||
``` | ||
|
||
## How to update MySQL | ||
|
||
1. Compile MySQL with the steps above | ||
2. Copy each folder `C:\GitHub\mysql-server\install-{x86,x64,arm64}\` to a temporary directory. | ||
3. Copy `install-x64\LICENSE` to `vendor\mysql` | ||
4. Copy `install-x64\include` to `vendor\mysql\include` | ||
5. For each `install-{arch}` folder: | ||
1. Delete all folders, but keep `bin` and `lib`. | ||
2. In `lib` folder delete everything, but keep `libmysql.{dll,lib,pdb}`. | ||
3. In `bin` folder delete everything, but keep `libcrypto-*` and `libssql-*` files. | ||
4. Sign all `*.dll` files. | ||
5. Copy signed `*.dll` files to their designed subfolder in `Shared\data\MTA San Andreas\server`. | ||
6. Copy `lib\libmysql.lib` to `vendor\mysql\lib\{arch}\`. | ||
6. Commit the update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@echo off | ||
|
||
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" | ||
if exist "%VSWHERE%" goto :FindVisualStudio | ||
|
||
echo Unable to locate Visual Studio: vswhere not found | ||
echo ^>^> %VSWHERE% | ||
pause | ||
exit /b 1 | ||
|
||
:FindVisualStudio | ||
for /f "usebackq tokens=*" %%i in (`call "%VSWHERE%" -latest -requires Microsoft.Component.MSBuild -find "**\VsDevCmd.bat"`) do ( | ||
set VSDEVCMD=%%i | ||
) | ||
|
||
if defined VSDEVCMD goto :SetupEnv | ||
echo Visual Studio not found | ||
echo Make sure you've installed the 'Desktop development with C++' workload | ||
pause | ||
exit /b 1 | ||
|
||
:SetupEnv | ||
echo Found Visual Studio environment setup batch file: | ||
echo ^>^> %VSDEVCMD% | ||
start "VsDevCmd: arm64" "%comspec%" /k "%VSDEVCMD%" -arch=arm64 -host_arch=amd64 | ||
start "VsDevCmd: x64" "%comspec%" /k "%VSDEVCMD%" -arch=amd64 -host_arch=amd64 | ||
start "VsDevCmd: x86" "%comspec%" /k "%VSDEVCMD%" -arch=x86 -host_arch=amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.