v / thirdparty / zstd / update.vsh
22 lines · 19 sloc · 720 bytes · 4fd405cfb18e84501dd63f4ac2c33b43e0667f5e
Raw
1// Use this script to update thirdparty/zstd to a future version of mbedtls.
2import os
3
4fn do(cmd string) {
5 println(cmd)
6 res := os.system(cmd)
7 if res != 0 {
8 panic('failed at: `${cmd}`')
9 }
10}
11
12os.chdir(os.dir(@VEXE))!
13
14version := '1.5.7'
15do('rm -rf zstd-${version}*')
16do('wget https://github.com/facebook/zstd/releases/download/v${version}/zstd-${version}.tar.gz')
17do('tar -xf zstd-${version}.tar.gz')
18do('pushd .; cd zstd-${version}/build/single_file_libs/; ./create_single_file_library.sh; popd')
19do('cp zstd-${version}/build/single_file_libs/zstd.c thirdparty/zstd/zstd.c')
20do('pushd .; cd thirdparty/zstd/; patch --verbose --unified -p0 --input zstd_v.patch; popd')
21do('rm -rf zstd-${version}*')
22println('DONE')
23