mirror of
https://github.com/vlang/v.git
synced 2025-08-04 02:07:28 -04:00
thirdparty.zstd: add a runnable update.vsh script
This commit is contained in:
parent
b19fa76c6e
commit
4fd405cfb1
10
thirdparty/zstd/fix.md
vendored
10
thirdparty/zstd/fix.md
vendored
@ -1,9 +1,7 @@
|
|||||||
1. Get `zstd` from https://github.com/facebook/zstd/releases
|
The changes here are produced by modifying `thirdparty/zstd/zstd_v.patch`,
|
||||||
2. Download and extract `zstd`, and goto `zstd-1.5.7/build/single_file_libs/`, run `create_single_file_library.sh`
|
and then running `v thirdparty/zstd/update.vsh` .
|
||||||
3. Copy generated `zstd.c` to v's `thirdparty/zstd/zstd-1.5.7.c`
|
|
||||||
4. In `thirdparty/zstd/`, apply patch by `patch -p0 -i zstd_v.patch -o zstd.c`
|
|
||||||
5. Remove `zstd-1.5.7.c`
|
|
||||||
|
|
||||||
You can generate a new patch by `diff -u zstd-1.5.7.c zstd_modified.c > zstd_custom.patch`
|
You can generate a new patch by:
|
||||||
|
`diff -u zstd-1.5.7/build/single_file_libs/zstd.c thirdparty/zstd/zstd.c > zstd_custom.patch`
|
||||||
|
|
||||||
BTW, patch is between `/* >> v_patch start */` and `/* << v_patch end */` mostly.
|
BTW, patch is between `/* >> v_patch start */` and `/* << v_patch end */` mostly.
|
||||||
|
22
thirdparty/zstd/update.vsh
vendored
Executable file
22
thirdparty/zstd/update.vsh
vendored
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
// Use this script to update thirdparty/zstd to a future version of mbedtls.
|
||||||
|
import os
|
||||||
|
|
||||||
|
fn do(cmd string) {
|
||||||
|
println(cmd)
|
||||||
|
res := os.system(cmd)
|
||||||
|
if res != 0 {
|
||||||
|
panic('failed at: `${cmd}`')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
os.chdir(os.dir(@VEXE))!
|
||||||
|
|
||||||
|
version := '1.5.7'
|
||||||
|
do('rm -rf zstd-${version}*')
|
||||||
|
do('wget https://github.com/facebook/zstd/releases/download/v${version}/zstd-${version}.tar.gz')
|
||||||
|
do('tar -xf zstd-${version}.tar.gz')
|
||||||
|
do('pushd .; cd zstd-${version}/build/single_file_libs/; ./create_single_file_library.sh; popd')
|
||||||
|
do('cp zstd-${version}/build/single_file_libs/zstd.c thirdparty/zstd/zstd.c')
|
||||||
|
do('pushd .; cd thirdparty/zstd/; patch --verbose --unified -p0 --input zstd_v.patch; popd')
|
||||||
|
do('rm -rf zstd-${version}*')
|
||||||
|
println('DONE')
|
2
thirdparty/zstd/zstd_v.patch
vendored
2
thirdparty/zstd/zstd_v.patch
vendored
@ -1,4 +1,4 @@
|
|||||||
--- zstd-1.5.7.c 2025-05-30 16:39:46.374765970 +0800
|
--- zstd.c 2025-05-30 16:39:46.374765970 +0800
|
||||||
+++ zstd.c 2025-05-30 21:02:30.710831777 +0800
|
+++ zstd.c 2025-05-30 21:02:30.710831777 +0800
|
||||||
@@ -50,6 +50,27 @@
|
@@ -50,6 +50,27 @@
|
||||||
/* TODO: Can't amalgamate ASM function */
|
/* TODO: Can't amalgamate ASM function */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user