Files
swupd-client/scripts/github_actions/build_ci_dependencies.bash
T
Otavio Pontes e9739d9eb3 actions: cache dependencies for swupd
Some packages we need to build swupd are not available on ubunutu-latest
so we need to download and build from source. This process is slow and
caching can save us some significant time on build.
2020-03-27 15:34:41 -07:00

47 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Build all custom dependencies needed by swupd:
# - Curl
# - Bsdiff
# - libarchive
#
# As process is slow, it can be cached. If directory dependencies exists,
# just install already build dependencies.
set -e
CORES=2
# If alread exists, reuse
if [ -d dependencies ]; then
pushd dependencies
for i in *; do
if [ -d "$i" ]; then
pushd "$i"
sudo make install
popd
fi
done
popd
exit
fi
mkdir dependencies
pushd dependencies
# build bsdiff
wget https://github.com/clearlinux/bsdiff/releases/download/v1.0.2/bsdiff-1.0.2.tar.xz
tar -xvf bsdiff-1.0.2.tar.xz
pushd bsdiff-1.0.2 && ./configure --prefix=/usr --disable-tests && make -j"$CORES" && sudo make install && popd
## build curl
wget https://curl.haxx.se/download/curl-7.64.0.tar.gz
tar -xvf curl-7.64.0.tar.gz
pushd curl-7.64.0 && ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu && make -j"$CORES" && sudo make install && popd
# build libarchive
wget https://github.com/libarchive/libarchive/archive/v3.3.1.tar.gz
tar -xvf v3.3.1.tar.gz
pushd libarchive-3.3.1 && autoreconf -fi && ./configure --prefix=/usr && make -j"$CORES" && sudo make install && popd
popd