From 8881b0489fcf05381d1eddc23a557fcf16de671d Mon Sep 17 00:00:00 2001 From: lambdadroid Date: Sat, 12 Oct 2019 11:14:05 +0200 Subject: [PATCH] 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. --- pmb/build/envkernel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmb/build/envkernel.py b/pmb/build/envkernel.py index f24aa6b1..6a9da270 100644 --- a/pmb/build/envkernel.py +++ b/pmb/build/envkernel.py @@ -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