Skip to content

Commit 04ad6e9

Browse files
committed
Add zstd to Windows
1 parent d9f5072 commit 04ad6e9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

cpython-windows/build.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ def hack_props(
357357
sqlite_version = DOWNLOADS["sqlite"]["version"]
358358
xz_version = DOWNLOADS["xz"]["version"]
359359
zlib_version = DOWNLOADS[zlib_entry]["version"]
360+
zstd_version = DOWNLOADS["zstd"]["version"]
360361

361362
mpdecimal_version = DOWNLOADS["mpdecimal"]["version"]
362363

@@ -372,6 +373,7 @@ def hack_props(
372373
xz_path = td / ("xz-%s" % xz_version)
373374
zlib_prefix = "cpython-source-deps-" if zlib_entry == "zlib-ng" else ""
374375
zlib_path = td / ("%s%s-%s" % (zlib_prefix, zlib_entry, zlib_version))
376+
zstd_path = td / ("cpython-source-deps-zstd-%s" % zstd_version)
375377
mpdecimal_path = td / ("mpdecimal-%s" % mpdecimal_version)
376378

377379
openssl_root = td / "openssl" / arch
@@ -416,6 +418,9 @@ def hack_props(
416418
elif b"<zlibNgDir" in line:
417419
line = b"<zlibNgDir>%s\\</zlibNgDir>" % zlib_path
418420

421+
elif b"<zstdDir" in line:
422+
line = b"<zstdDir>%s\\</zstdDir>" % zstd_path
423+
419424
elif b"<mpdecimalDir" in line:
420425
line = b"<mpdecimalDir>%s\\</mpdecimalDir>" % mpdecimal_path
421426

@@ -1255,6 +1260,12 @@ def build_cpython(
12551260
"tk-windows-bin-8612", BUILD, local_name="tk-windows-bin.tar.gz"
12561261
)
12571262

1263+
# On CPython 3.14+, zstd is included
1264+
if meets_python_minimum_version(python_version, "3.14"):
1265+
zstd_archive = download_entry("zstd", BUILD)
1266+
else:
1267+
zstd_archive = None
1268+
12581269
# CPython 3.13+ no longer uses a bundled `mpdecimal` version so we build it
12591270
if meets_python_minimum_version(python_version, "3.13"):
12601271
mpdecimal_archive = download_entry("mpdecimal", BUILD)
@@ -1297,6 +1308,7 @@ def build_cpython(
12971308
tk_bin_archive,
12981309
xz_archive,
12991310
zlib_archive,
1311+
zstd_archive,
13001312
):
13011313
if a is None:
13021314
continue

pythonbuild/downloads.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,4 +429,13 @@
429429
"licenses": ["Zlib"],
430430
"license_file": "LICENSE.zlib-ng.txt",
431431
},
432+
"zstd": {
433+
"url": "https://github.com/python/cpython-source-deps/archive/refs/tags/zstd-1.5.7.tar.gz",
434+
"size": 2440298,
435+
"sha256": "f24b52470d12f466e9fa4fcc94e6c530625ada51d7b36de7fdc6ed7e6f499c8e",
436+
"version": "1.5.7",
437+
"library_names": ["zstd"],
438+
"licenses": ["BSD-3-Clause"],
439+
"license_file": "LICENSE.zstd.txt",
440+
},
432441
}

0 commit comments

Comments
 (0)