3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 06:30:16 +02:00
Velocity/native/README.md

55 Zeilen
2.0 KiB
Markdown

2018-08-02 04:22:09 +02:00
# velocity-natives
2024-09-01 02:47:25 +02:00
This directory contains native acceleration code for Velocity, along with traditional Java fallbacks.
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
Compression is based on the `libdeflate` library, which is wire-compatible with zlib but significantly faster.
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
Encryption is based on OpenSSL for Linux, which is the most widely-used encryption library in the world.
OpenSSL has had several different ABIs over the years, so we provide multiple versions of the native
library. Currently we compile against OpenSSL 1.1.x and OpenSSL 3.x.x. For macOS, we use the built-in
CommonCrypto library.
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
## Supported Platforms
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
`velocity-natives` is built for the following platforms:
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
- Linux x86_64
- Linux aarch64
- macOS aarch64 ("Apple Silicon")
2018-08-02 04:22:09 +02:00
2024-09-01 02:47:25 +02:00
For Linux platforms, we provide two versions of the native library: one built against OpenSSL 1.1.x and one built against OpenSSL 3.x.x.
All native libraries are built on various versions of Ubuntu:
2020-06-23 15:57:04 +02:00
2024-09-01 02:47:25 +02:00
- Ubuntu 20.04 for OpenSSL 1.1.x support and for compression
- Ubuntu 22.04 for OpenSSL 3.x.x support
2020-06-23 15:57:04 +02:00
2024-09-01 02:47:25 +02:00
Currently, we do not provide native libraries for distributions based on musl libc, like Alpine Linux. You might be able to use `apk add libc6-compat` to fake it, but this is not officially supported.
In the future we may provide a musl libc build.
## Building
### On Linux
To build the native libraries, you need to have Docker installed and have it set up to perform [multi-platform builds](https://docs.docker.com/build/building/multi-platform/). Then, run the following command:
```bash
./build-support/build-all-linux-natives.sh
```
This will build the native libraries for both OpenSSL 1.1.x and OpenSSL 3.x.x on both x86_64 and aarch64.
### On macOS
To build the native libraries on macOS, you need to have `cmake` installed. You can install it using Homebrew:
```bash
brew install cmake
```
Then, run the following command:
```bash
./build-support/compile-macos.sh
```
This will build the native libraries for macOS aarch64. x86_64 has not been tested, but it should work.