2025-05-30 16:25:45 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
import urllib.request
|
2026-02-14 08:41:16 +01:00
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
import subprocess
|
2025-05-30 16:25:45 +03:00
|
|
|
|
2026-08-03 19:30:42 -03:00
|
|
|
HTTPLIB_VERSION = "refs/tags/v0.52.0"
|
2026-02-12 16:11:22 +01:00
|
|
|
|
2025-05-30 16:25:45 +03:00
|
|
|
vendor = {
|
|
|
|
|
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
|
|
|
|
|
"https://github.com/nlohmann/json/releases/latest/download/json_fwd.hpp": "vendor/nlohmann/json_fwd.hpp",
|
|
|
|
|
|
|
|
|
|
"https://raw.githubusercontent.com/nothings/stb/refs/heads/master/stb_image.h": "vendor/stb/stb_image.h",
|
|
|
|
|
|
2025-11-12 14:56:02 +01:00
|
|
|
# not using latest tag to avoid this issue: https://github.com/ggml-org/llama.cpp/pull/17179#discussion_r2515877926
|
2026-02-28 20:10:01 +05:00
|
|
|
# "https://github.com/mackron/miniaudio/raw/refs/tags/0.11.24/miniaudio.h": "vendor/miniaudio/miniaudio.h",
|
2026-03-11 00:01:56 -03:00
|
|
|
"https://github.com/mackron/miniaudio/raw/9634bedb5b5a2ca38c1ee7108a9358a4e233f14d/miniaudio.h": "vendor/miniaudio/miniaudio.h",
|
2025-05-30 16:25:45 +03:00
|
|
|
|
2026-02-14 08:41:16 +01:00
|
|
|
f"https://raw.githubusercontent.com/yhirose/cpp-httplib/{HTTPLIB_VERSION}/httplib.h": "httplib.h",
|
|
|
|
|
f"https://raw.githubusercontent.com/yhirose/cpp-httplib/{HTTPLIB_VERSION}/split.py": "split.py",
|
2026-02-12 16:11:22 +01:00
|
|
|
f"https://raw.githubusercontent.com/yhirose/cpp-httplib/{HTTPLIB_VERSION}/LICENSE": "vendor/cpp-httplib/LICENSE",
|
2025-12-01 19:41:04 +01:00
|
|
|
|
2026-07-24 08:02:23 +02:00
|
|
|
"https://raw.githubusercontent.com/sheredom/subprocess.h/8671cee1fc09f11a70ce3782a0ee13177c3aa387/subprocess.h": "vendor/sheredom/subprocess.h",
|
2025-05-30 16:25:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for url, filename in vendor.items():
|
|
|
|
|
print(f"downloading {url} to {filename}") # noqa: NP100
|
|
|
|
|
urllib.request.urlretrieve(url, filename)
|
2025-11-11 13:32:58 +01:00
|
|
|
|
2026-02-14 08:41:16 +01:00
|
|
|
print("Splitting httplib.h...") # noqa: NP100
|
|
|
|
|
try:
|
|
|
|
|
subprocess.check_call([
|
|
|
|
|
sys.executable, "split.py",
|
|
|
|
|
"--extension", "cpp",
|
|
|
|
|
"--out", "vendor/cpp-httplib"
|
|
|
|
|
])
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(f"Error: {e}") # noqa: NP100
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
finally:
|
|
|
|
|
os.remove("split.py")
|
|
|
|
|
os.remove("httplib.h")
|