feat(termux): MC 启动接线——Linux arm64 natives + softpipe 子进程环境
- Library::native_classifier:Linux/aarch64 上把 LWJGL3 的 natives-linux 改写成 natives-linux-arm64(Mojang 清单只有 x86_64) - install::libraries:arm64 分类器在清单里没有下载信息时,按 Maven 相对路径 兜底到阿里云镜像(实测 Mojang libraries 404、Aliyun 200); 单测覆盖 arm64 兜底与 x86_64 不变 - launch::defaults:Termux glibc 构建启动 MC 时默认带 MESA_LOADER_DRIVER_OVERRIDE=swrast / LIBGL_ALWAYS_SOFTWARE=1(用户可覆盖) - 文档:JRE patchelf 一次性步骤与接线现状;README 同步 - 验证:patched Temurin java 直接执行;LWJGL arm64+GLFW 探针 gl-ok
This commit is contained in:
1 parent
02ed09ae49
commit
7eed6c6261
5 files changed
+179
-26
No files matched your search
@@ -172,6 +172,11 @@ impl Library {
|
||||
}
|
||||
|
||||
/// natives 分类器名:按 OS 查 `natives` 表并展开 `${arch}`(64 位为 `64`)。
|
||||
///
|
||||
/// **Linux arm64 特例**:Mojang 的 LWJGL3 条目只写 `natives-linux`(x86_64),
|
||||
/// 但同一个 Maven 坐标有 `natives-linux-arm64`。原样用 `natives-linux` 会下到 x86_64
|
||||
/// 的 `.so`,在 aarch64 JVM 里加载失败;这里改成 arm64 分类器(下载地址的兜底见
|
||||
/// `install::libraries`)。
|
||||
pub fn native_classifier(&self, env: &Environment) -> Option<String> {
|
||||
let raw = self.natives.as_ref()?.get(&env.os)?;
|
||||
let arch = if matches!(env.arch.as_str(), "x86_64" | "arm64") {
|
||||
@@ -179,7 +184,20 @@ impl Library {
|
||||
} else {
|
||||
""
|
||||
};
|
||||
Some(raw.replace("${arch}", arch))
|
||||
let classifier = raw.replace("${arch}", arch);
|
||||
if env.os == "linux"
|
||||
&& env.arch == "arm64"
|
||||
&& classifier == "natives-linux"
|
||||
&& self.is_lwjgl3()
|
||||
{
|
||||
return Some("natives-linux-arm64".to_owned());
|
||||
}
|
||||
Some(classifier)
|
||||
}
|
||||
|
||||
/// 是否是 LWJGL 3(`org.lwjgl:<module>`;LWJGL 2 的 group 是 `org.lwjgl.lwjgl`)。
|
||||
fn is_lwjgl3(&self) -> bool {
|
||||
self.name.starts_with("org.lwjgl:")
|
||||
}
|
||||
|
||||
/// natives 构件下载信息(按分类器查 `downloads.classifiers`)。
|
||||
|
||||
Reference in new issue
Block a user