pmbootstrap aportgen: replace arch=all with native (MR 1965)

Packages like binutils-*, busybox-static-*, gcc-*, grub-efi-*, musl-*
are only needed for the native architecture during cross compilation.
Don't bother with trying to build them for other arches to save time and
to avoid getting stuck frequently at "armv7/binutils-aarch64" etc.

A few people like to use pmbootstrap on aarch64 hosts (e.g. PineBook
Pro), so let's make it available for aarch64 again when we can build
aarch64 packages natively in CI and bpo. (They do get stuck there right
now, because of qemu user emulation.)

Related: https://gitlab.com/postmarketOS/build.postmarketos.org/-/issues/75
This commit is contained in:
Oliver Smith 2020-07-29 12:35:08 +02:00
parent 5b55abd4d2
commit 0dfe489b78
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
6 changed files with 9 additions and 16 deletions

View File

@ -11,15 +11,11 @@ def generate(args, pkgname):
upstream = pmb.aportgen.core.get_upstream_aport(args, "binutils")
pmb.helpers.run.user(args, ["cp", "-r", upstream, args.work + "/aportgen"])
# Architectures to build this package for
arches = list(pmb.config.build_device_architectures)
arches.remove(arch)
# Rewrite APKBUILD
fields = {
"pkgname": pkgname,
"pkgdesc": "Tools necessary to build programs for " + arch + " targets",
"arch": " ".join(arches),
"arch": args.arch_native,
"makedepends_build": "",
"makedepends_host": "",
"makedepends": "gettext libtool autoconf automake bison texinfo",

View File

@ -46,7 +46,7 @@ def generate(args, pkgname):
url="http://busybox.net"
license="GPL2"
arch="all"
arch="{args.arch_native}"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"

View File

@ -23,12 +23,12 @@ def generate(args, pkgname):
" gcc6.")
pmb.helpers.run.user(args, ["cp", "-r", upstream, args.work + "/aportgen"])
# Rewrite APKBUILD (only building for x86_64 covers most use cases and
# Rewrite APKBUILD (only building for native covers most use cases and
# saves a lot of build time, can be changed on demand)
fields = {
"pkgname": pkgname,
"pkgdesc": "Stage2 cross-compiler for " + arch,
"arch": "x86_64",
"arch": args.arch_native,
"depends": "isl binutils-" + arch + " mpc1",
"makedepends_build": "gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev",
"makedepends_host": "linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-" + arch + " binutils-" + arch,

View File

@ -42,7 +42,7 @@ def generate(args, pkgname):
pkgdesc="GRUB $_arch EFI files for every architecture"
url="https://www.gnu.org/software/grub/"
license="GPL-3.0-or-later"
arch="all"
arch="{args.arch_native}"
source="grub-efi-$pkgver-r$pkgrel-$_arch-{mirrordir}.apk::$_mirror/{mirrordir}/main/$_arch/grub-efi-$pkgver-r$pkgrel.apk"
package() {{

View File

@ -9,17 +9,14 @@ import pmb.parse.apkindex
def generate(args, pkgname):
arch = pkgname.split("-")[1]
# Parse musl version from APKINDEX
package_data = pmb.parse.apkindex.package(args, "musl")
version = package_data["version"]
pkgver = version.split("-r")[0]
pkgrel = version.split("-r")[1]
# Architectures to build this package for
arch = pkgname.split("-")[1]
arches = list(pmb.config.build_device_architectures)
arches.remove(arch)
# Prepare aportgen tempdir inside and outside of chroot
tempdir = "/tmp/aportgen"
pmb.chroot.root(args, ["rm", "-rf", tempdir])
@ -43,7 +40,7 @@ def generate(args, pkgname):
pkgname={pkgname}
pkgver={pkgver}
pkgrel={pkgrel}
arch="{" ".join(arches)}"
arch="{args.arch_native}"
subpackages="musl-dev-{arch}:package_dev"
_arch="{arch}"

View File

@ -9,7 +9,7 @@ pkgdesc="Tools necessary to build programs for armhf targets"
url="https://www.gnu.org/software/binutils/"
depends=""
makedepends="gettext libtool autoconf automake bison texinfo"
arch="armv7 aarch64 x86_64 x86"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch