mirror of
https://github.com/Dasharo/fwbuild.git
synced 2026-03-06 14:59:53 -08:00
47 lines
876 B
Bash
Executable File
47 lines
876 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -f FWBUILD ]; then
|
|
echo "Error: No FWBUILD file found. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
source FWBUILD
|
|
|
|
missing_dependency=0
|
|
if [ -n "$depends" ]; then
|
|
for dep in "${depends[@]}"; do
|
|
if [ ! -f $dep ]; then
|
|
echo "Missing dependency: $dep"
|
|
missing_dependency=1
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [ $missing_dependency = 1 ]; then
|
|
echo "Exiting due to missing dependencies!"
|
|
exit 2
|
|
fi
|
|
|
|
mkdir -p src
|
|
cd src
|
|
|
|
if [ -d $srcname ]; then
|
|
echo "Source already present, skipping"
|
|
else
|
|
git clone $source
|
|
fi
|
|
|
|
cd $srcname
|
|
|
|
# Prepare sources: checkout, apply any patches
|
|
prepare
|
|
|
|
# Build: Execute the build() function of the FWBUILD inside the docker container
|
|
declare -f build > .fwbuild
|
|
|
|
docker_pwd=${docker_pwd:=$PWD}
|
|
docker run --rm -it -v $PWD:$docker_pwd -w $docker_pwd $container bash -c "source .fwbuild && build"
|
|
|
|
# Package: Any post-build packaging, checksumming etc
|
|
package
|