1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-14 03:49:48 +03:00

build: init: simplify installing build deps (MR 2363)

No reason to handle abuild separately here.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-07-11 00:52:22 +02:00
parent 30d8ea997f
commit 02f9da9a64
No known key found for this signature in database
GPG key ID: 0583312B195F64B6
2 changed files with 7 additions and 4 deletions

View file

@ -15,16 +15,19 @@ from pmb.core import Chroot
from pmb.core.context import get_context from pmb.core.context import get_context
def init_abuild_minimal(chroot: Chroot = Chroot.native(), additional_pkgs: list[str] = []): def init_abuild_minimal(chroot: Chroot = Chroot.native(), build_pkgs: list[str] = []):
"""Initialize a minimal chroot with abuild where one can do 'abuild checksum'.""" """Initialize a minimal chroot with abuild where one can do 'abuild checksum'."""
marker = chroot / "tmp/pmb_chroot_abuild_init_done" marker = chroot / "tmp/pmb_chroot_abuild_init_done"
if os.path.exists(marker): if os.path.exists(marker):
return return
if not build_pkgs:
build_pkgs = pmb.config.build_packages
# pigz is multithreaded and makes compression must faster, we install it in the native # pigz is multithreaded and makes compression must faster, we install it in the native
# chroot and then symlink it into the buildroot so we aren't running it through QEMU. # chroot and then symlink it into the buildroot so we aren't running it through QEMU.
# pmb.chroot.apk.install(["pigz"], Chroot.native(), build=False) # pmb.chroot.apk.install(["pigz"], Chroot.native(), build=False)
pmb.chroot.apk.install(["abuild"] + additional_pkgs, chroot, build=False) pmb.chroot.apk.install(build_pkgs, chroot, build=False)
# Fix permissions # Fix permissions
pmb.chroot.root(["chown", "root:abuild", "/var/cache/distfiles"], chroot) pmb.chroot.root(["chown", "root:abuild", "/var/cache/distfiles"], chroot)
@ -47,7 +50,7 @@ def init(chroot: Chroot = Chroot.native()) -> bool:
# Initialize chroot, install packages # Initialize chroot, install packages
pmb.chroot.init(Chroot.native()) pmb.chroot.init(Chroot.native())
pmb.chroot.init(chroot) pmb.chroot.init(chroot)
init_abuild_minimal(chroot, additional_pkgs=pmb.config.build_packages) init_abuild_minimal(chroot)
# Generate package signing keys # Generate package signing keys
if not os.path.exists(get_context().config.work / "config_abuild/abuild.conf"): if not os.path.exists(get_context().config.work / "config_abuild/abuild.conf"):

View file

@ -209,7 +209,7 @@ chroot_outdated = 3600 * 24 * 2
# Packages that will be installed in a chroot before it builds packages # Packages that will be installed in a chroot before it builds packages
# for the first time # for the first time
build_packages = ["abuild", "build-base", "ccache", "git"] build_packages = ["abuild", "apk-tools", "build-base", "ccache", "git"]
# #
# PARSE # PARSE