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