nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/portablemc/standard.py b/portablemc/standard.py
2index f59c55d..0f017e1 100644
3--- a/portablemc/standard.py
4+++ b/portablemc/standard.py
5@@ -843,6 +843,8 @@ class Version:
6 if jvm_major_version is not None and not isinstance(jvm_major_version, int):
7 raise ValueError("metadata: /javaVersion/majorVersion must be an integer")
8
9+ return self._resolve_builtin_jvm(watcher, JvmNotFoundError.UNSUPPORTED_ARCH, jvm_major_version)
10+
11 if platform.system() == "Linux" and platform.libc_ver()[0] != "glibc":
12 return self._resolve_builtin_jvm(watcher, JvmNotFoundError.UNSUPPORTED_LIBC, jvm_major_version)
13
14@@ -926,31 +928,10 @@ class Version:
15 builtin_path = shutil.which(jvm_bin_filename)
16 if builtin_path is None:
17 raise JvmNotFoundError(reason)
18-
19- try:
20-
21- # Get version of the JVM.
22- process = Popen([builtin_path, "-version"], bufsize=1, stdout=PIPE, stderr=STDOUT, universal_newlines=True)
23- stdout, _stderr = process.communicate(timeout=1)
24-
25- version_start = stdout.index(f"1.{major_version}" if major_version <= 8 else str(major_version))
26- version = None
27-
28- # Parse version by getting all character that are numeric or '.'.
29- for i, ch in enumerate(stdout[version_start:]):
30- if not ch.isnumeric() and ch not in (".", "_"):
31- version = stdout[version_start:i]
32- break
33-
34- if version is None:
35- raise ValueError()
36-
37- except (TimeoutExpired, ValueError):
38- raise JvmNotFoundError(JvmNotFoundError.BUILTIN_INVALID_VERSION)
39
40 self._jvm_path = Path(builtin_path)
41- self._jvm_version = version
42- watcher.handle(JvmLoadedEvent(version, JvmLoadedEvent.BUILTIN))
43+ self._jvm_version = "nixpkgs"
44+ watcher.handle(JvmLoadedEvent("nixpkgs", JvmLoadedEvent.BUILTIN))
45
46 def _download(self, watcher: Watcher) -> None:
47