Skip to content

Commit fea6399

Browse files
authored
Add zstd build script (#5)
1 parent dcea166 commit fea6399

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

zstd/build.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
recipe_dir=$(dirname $(realpath $0))
5+
version=${1:?}
6+
7+
cd $recipe_dir
8+
9+
# zstd was added to Python in version 3.14, which uses this minimum API level.
10+
# zstd also requires the same API level for fseeko and ftello on 32-bit ABIs
11+
# (https://android.googlesource.com/platform/bionic/+/HEAD/docs/32-bit-abi.md).
12+
ANDROID_API_LEVEL=24
13+
. ../android-env.sh
14+
15+
version_dir=$recipe_dir/build/$version
16+
mkdir -p $version_dir
17+
cd $version_dir
18+
src_filename=zstd-$version.tar.gz
19+
wget -c https://github.com/facebook/zstd/releases/download/v$version/$src_filename
20+
21+
build_dir=$version_dir/$HOST
22+
rm -rf $build_dir
23+
mkdir $build_dir
24+
cd $build_dir
25+
tar -xf $version_dir/$src_filename
26+
cd zstd-$version
27+
28+
prefix=$build_dir/prefix
29+
mkdir $prefix
30+
31+
make -j $CPU_COUNT lib-release PREFIX=$prefix
32+
make install PREFIX=$prefix

0 commit comments

Comments
 (0)