-
Notifications
You must be signed in to change notification settings - Fork 12
/
update_yaml.sh
32 lines (26 loc) · 936 Bytes
/
update_yaml.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
# We run this Bash script to update our internal version of libyaml.
set -ue pipefail
version=0.1.7
url=http://pyyaml.org/download/libyaml/yaml-$version.tar.gz
if [ ! -d yaml ]; then
wget $url
tar -xf yaml-$version.tar.gz
mv yaml-$version yaml
fi
cp yaml/LICENSE LICENSE_yaml.txt
cp yaml/include/yaml.h lib/libyaml/
# Turn the library into a drop-in library so there is only one C file and header
# file we have to worry about.
{
echo "// Single-file version of libyaml, auto-generated from"
echo "// $url"
echo "#if 0"
cat yaml/LICENSE
echo "#endif"
echo '#pragma GCC diagnostic ignored "-Wunused-but-set-variable"'
echo '#pragma GCC diagnostic ignored "-Wunused-value"'
echo '#pragma GCC diagnostic ignored "-Wunused-parameter"'
cat yaml/win32/config.h # only has version numbers
cat yaml/src/yaml_private.h
cat yaml/src/*.c
} | sed -r 's/#include .(yaml_private|config)\.h.//' > lib/libyaml/yaml.c