build: envkernel: install makedepends (!1824)

Currently, building with envkernel.sh entirely ignores the
makedepends listed in the kernel APKBUILD. Common dependencies
needed by most kernels are hardcoded in envkernel.sh.
However, some kernels may need extra dependencies either during
the build process or when the kernel is packaged.

Installing the makedepends when the build environment is initialized
is difficult because "source helpers/envkernel.sh" is not aware
of the exact kernel package that is going to be built later.

However, we can easily modify the packaging step
(i.e. pmbootstrap build --envkernel linux-...)
to install the required makedepends.

This fixes building "linux-postmarketos-qcom-msm8916" using envkernel,
since it requires "dtbTool" and "installkernel" to be installed when
the APKBUILD package() function is executed.
This commit is contained in:
lambdadroid 2019-10-12 11:14:05 +02:00 committed by Oliver Smith
parent 9ed179594e
commit 8881b0489f
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ def package_kernel(args):
arch = args.deviceinfo["arch"]
apkbuild = pmb.parse.apkbuild(args, apkbuild_path, check_pkgname=False)
suffix = pmb.build.autodetect.suffix(args, apkbuild, arch)
# Install package dependencies
depends, _ = pmb.build._package.build_depends(args, apkbuild, args.arch_native, strict=False)
pmb.build.init(args, suffix)
pmb.chroot.apk.install(args, depends, suffix)
output = (arch + "/" + apkbuild["pkgname"] + "-" + apkbuild["pkgver"] +
"-r" + apkbuild["pkgrel"] + ".apk")
message = "(" + suffix + ") build " + output