-
Notifications
You must be signed in to change notification settings - Fork 151
/
repack.sh
executable file
·44 lines (34 loc) · 1006 Bytes
/
repack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -e
BOOST_VERSION=1.67.0
function finish {
rm -rf ${tmp_dir}
}
trap finish EXIT
out_dir=$(pwd)
patch_dir=$(pwd)/patch/${BOOST_VERSION}
tmp_dir=$(mktemp -d)
echo "Downloading Boost ${BOOST_VERSION}..."
curl -L "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION//\./_}.tar.bz2" > ${tmp_dir}/boost_${BOOST_VERSION}.tar.bz2
mkdir -p ${tmp_dir}/extract
cd ${tmp_dir}/extract
echo "Extracting archive..."
tar xf ${tmp_dir}/boost_${BOOST_VERSION}.tar.bz2
cd boost_*
if [ -d "${patch_dir}" ]; then
mkdir patch
for f in ${patch_dir}/*.patch; do
echo "Applying patch ${f}..."
git apply --verbose $f
cp $f patch/
done
fi
echo "Removing extra files..."
find . -name "doc" -print0 | xargs -0 -- rm -rf
find . -name "*.htm*" -delete
find . -name "*.png" -delete
find . -name "*.bmp" -delete
find . -name "*.jpg" -delete
cd ..
echo "Recompressing archive..."
tar cfJ ${out_dir}/boost_${BOOST_VERSION//./_}.tar.xz boost_*