nheko/gen_libs.sh

25 lines
660 B
Bash
Raw Normal View History

2018-02-02 13:35:59 +00:00
#!/bin/sh
set -e
2018-04-03 14:01:35 +00:00
echo -n "Setting some constants..."
RESDIR=include
echo " Done."
2018-02-02 13:35:59 +00:00
echo -n "Downloading header-only libraries..."
2018-04-03 14:01:35 +00:00
mkdir $RESDIR
wget https://github.com/nlohmann/json/releases/download/v3.1.2/json.hpp -O $RESDIR/json.hpp 2> /dev/null
wget https://github.com/mpark/variant/releases/download/v1.3.0/variant.hpp -O $RESDIR/variant.hpp 2> /dev/null
2018-02-02 13:35:59 +00:00
echo " Done."
echo -n "Generating tarball..."
2018-04-03 14:01:35 +00:00
nf=header_only-$(cat $RESDIR/*.hpp | sha256sum | awk '{print substr ($1, 0, 7)}').tar.gz
tar czf header_only.tar.gz $RESDIR
mv header_only.tar.gz $nf
2018-02-02 13:35:59 +00:00
echo " Done."
echo -n "Removing temporary files..."
2018-04-03 14:01:35 +00:00
rm -rf $RESDIR
2018-02-02 13:35:59 +00:00
echo " Done."
2018-04-03 14:01:35 +00:00
echo "Result: $nf"