Vendor miniz 3.0.2 instead of downloading it

The release asset download returned HTTP 504 for hours and blocked the Windows
build. miniz (MIT) is two source files, so it now lives in third_party/miniz and
the public-tree check skips that unmodified third-party directory.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-11-08 11:19:02 +01:00
1 parent e01ac929ac
commit d2c5fade43
5 files changed
+9286 -5

No files matched your search

+3 -5
View File
@@ -284,12 +284,9 @@ if(MSVC)
endif()
# --- Game data launcher (src/launch): find, unpack and check the original game data ---------
# ZIP: miniz (MIT), 7z: the C decoder of the LZMA SDK (public domain), file dialog:
# ZIP: miniz 3.0.2 (MIT, vendored in third_party/miniz), 7z: the C decoder of the LZMA SDK (public domain), file dialog:
# nativefiledialog-extended (zlib). All pinned; fetched like SDL2.
include(FetchContent)
FetchContent_Declare(miniz
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
URL_HASH SHA256=ada38db0b703a56d3dd6d57bf84a9c5d664921d870d8fea4db153979fb5332c5)
FetchContent_Declare(lzma_sdk
GIT_REPOSITORY https://github.com/ip7z/7zip.git
GIT_TAG 24.09
@@ -301,9 +298,10 @@ FetchContent_Declare(nfd
GIT_REPOSITORY https://github.com/btzy/nativefiledialog-extended.git
GIT_TAG v1.2.1
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(miniz lzma_sdk nfd)
FetchContent_MakeAvailable(lzma_sdk nfd)
add_library(bmh_miniz STATIC ${miniz_SOURCE_DIR}/miniz.c)
set(miniz_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/miniz") # vendored: no download that can fail
target_include_directories(bmh_miniz PUBLIC ${miniz_SOURCE_DIR})
set(BMH_LZMA_C ${lzma_sdk_SOURCE_DIR}/C)
add_library(bmh_7z STATIC
+22
View File
@@ -0,0 +1,22 @@
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+7833
View File
File diff suppressed because it is too large. Load diff
+1422
View File
File diff suppressed because it is too large. Load diff
@@ -44,6 +44,8 @@ PRIVATE_DOCUMENTS = {
"PUBLIC_RELEASE_TODO.md", "chat.txt",
}
SOURCE_SUFFIXES = {".cpp", ".hpp", ".h", ".c", ".inc"}
# Unmodified third-party sources (miniz, MIT) keep their authors' own headers and are not ours to rewrite.
VENDORED_PREFIX = "third_party/"
SKIP_DIRECTORIES = {".git", "__pycache__", ".cache", "_deps", "node_modules"}
LEGACY_SYMBOLS = re.compile(
@@ -230,6 +232,8 @@ def scan_tree(root: Path):
findings = []
names = checked_files(root)
for name in names:
if name.startswith(VENDORED_PREFIX):
continue
path = root / name
if path.is_symlink():
findings.append(Finding(name, 0, "symlink-not-reviewed"))
@@ -255,6 +259,8 @@ def scan_history(root: Path):
metadata, name = entry.split(b"\t", 1)
mode, kind, object_id = metadata.decode().split()
path = name.decode("utf-8")
if path.startswith(VENDORED_PREFIX):
continue
if kind != "blob":
findings.append(Finding(path, 0, "unreviewed-history-object"))
continue