51 lines
804 B
Bash
Executable File
51 lines
804 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
TARGET="${1}"
|
|
if [ -z "${TARGET}" ]; then
|
|
echo "You must specify rootfs where packages should be unpacked"
|
|
exit 1
|
|
fi
|
|
|
|
TARGET="$(realpath "${TARGET}")"
|
|
|
|
source ./prepare-compiler-env.sh
|
|
|
|
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
|
|
b libressl
|
|
b curl
|
|
|
|
# Init
|
|
b sabotage-kernel-headers
|
|
b openrc
|