1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-06-29 06:20:12 +02:00
build/util/toolchain.sh
David Oberhollenzer 78c616ca27 Simplify dependency handling
- dependencies() accepts a single package name instead of a list.
   Is used only that way anwayway.
 - Remove most temporary packge lists

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-01-30 14:02:09 +01:00

36 lines
755 B
Bash

save_toolchain() {
if [ ! -e "${TCDIR}/${TARGET}.tar.gz" ]; then
pushd "$TCDIR/$TARGET" > /dev/null
tar czf "${TCDIR}/${TARGET}.tar.gz" include lib
popd > /dev/null
fi
}
restore_toolchain() {
pushd "$TCDIR/$TARGET" > /dev/null
rm -r include lib
tar zxf "${TCDIR}/${TARGET}.tar.gz"
popd > /dev/null
}
install_build_deps() {
local pkg="$1"
if [ ! -e "$SCRIPTDIR/pkg/$pkg/depends" ]; then
return
fi
dependencies "$pkg" "pkg" | grep -v "$pkg" > "$BUILDROOT/$CFG/deppkg"
while read deppkg; do
local devdir="$PKGDEPLOYDIR/${deppkg}-dev"
if [ -d "$devdir/include" ]; then
cp -R "$devdir/include" "$TCDIR/$TARGET"
fi
if [ -d "$devdir/lib" ]; then
cp -R "$devdir/lib" "$TCDIR/$TARGET"
fi
done < "$BUILDROOT/$CFG/deppkg"
}