2018-11-10 00:42:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
TARGET="${1}"
|
|
|
|
if [ -z "${TARGET}" ]; then
|
|
|
|
echo "You must specify rootfs where packages should be unpacked"
|
2018-11-10 02:24:52 +02:00
|
|
|
exit 1
|
2018-11-10 00:42:27 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
TARGET="$(realpath "${TARGET}")"
|
|
|
|
|
2018-11-10 02:59:39 +02:00
|
|
|
source ./prepare-compiler-env.sh
|
2018-11-10 00:42:27 +02:00
|
|
|
|
|
|
|
build_and_install () {
|
|
|
|
local pkg="${1}"
|
|
|
|
local ver="$(grep ^pkgver < "${pkg}/build.sh" | sed 's/pkgver="\(.*\)"/\1/')"
|
|
|
|
|
|
|
|
pushd "${pkg}" > /dev/null
|
|
|
|
local pkgfile="$(realpath "./${pkg}-${ver}.pkg.tar.xz")"
|
|
|
|
|
|
|
|
if [ ! -f "${pkgfile}" ]; then
|
|
|
|
echo ">>> Building '${pkg}'"
|
|
|
|
./build.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
tar -C "${TARGET}" -xf "${pkgfile}"
|
|
|
|
popd > /dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
b () {
|
|
|
|
build_and_install "${@}"
|
|
|
|
return "${?}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Absulutely needed
|
|
|
|
b filesystem
|
|
|
|
b musl-libc
|
|
|
|
b libexecinfo
|
|
|
|
b mksh
|
|
|
|
|
|
|
|
# Networking
|
|
|
|
b zlib
|
2018-11-10 22:47:53 +02:00
|
|
|
b openssl
|
2018-11-10 00:42:27 +02:00
|
|
|
b curl
|
|
|
|
|
|
|
|
# Init
|
2018-11-10 23:51:59 +02:00
|
|
|
b sabotage-kernel-headers
|
2018-11-10 02:58:37 +02:00
|
|
|
b openrc
|