M pmb/aportgen/__init__.py => pmb/aportgen/__init__.py +12 -0
@@ 13,6 13,18 @@ import pmb.config
import pmb.helpers.cli
+def get_cross_package_arches(pkgname):
+ """
+ Get the arches for which we want to build cross packages.
+ :param pkgname: package name, e.g. "gcc-aarch64", "gcc-x86_64"
+ :returns: string of architecture(s) (space separated)
+ """
+ if pkgname.endswith("-x86_64"):
+ return "aarch64"
+ else:
+ return "x86_64"
+
+
def properties(pkgname):
"""
Get the `pmb.config.aportgen` properties for the aport generator, based on
M pmb/aportgen/busybox_static.py => pmb/aportgen/busybox_static.py +1 -1
@@ 47,7 47,7 @@ def generate(args, pkgname):
url="http://busybox.net"
license="GPL2"
- arch="{pmb.config.arch_native}"
+ arch="{pmb.aportgen.get_cross_package_arches(pkgname)}"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
M pmb/aportgen/gcc.py => pmb/aportgen/gcc.py +2 -3
@@ 23,12 23,11 @@ def generate(args, pkgname):
" gcc6.")
pmb.helpers.run.user(args, ["cp", "-r", upstream, f"{args.work}/aportgen"])
- # Rewrite APKBUILD (only building for native covers most use cases and
- # saves a lot of build time, can be changed on demand)
+ # Rewrite APKBUILD
fields = {
"pkgname": pkgname,
"pkgdesc": f"Stage2 cross-compiler for {arch}",
- "arch": pmb.config.arch_native,
+ "arch": pmb.aportgen.get_cross_package_arches(pkgname),
"depends": f"binutils-{arch} mpc1",
"makedepends_build": "gcc g++ bison flex texinfo gawk zip"
" gmp-dev mpfr-dev mpc1-dev zlib-dev",
M pmb/aportgen/musl.py => pmb/aportgen/musl.py +1 -1
@@ 42,7 42,7 @@ def generate(args, pkgname):
pkgname={pkgname}
pkgver={pkgver}
pkgrel={pkgrel}
- arch="{pmb.config.arch_native}"
+ arch="{pmb.aportgen.get_cross_package_arches(pkgname)}"
subpackages="musl-dev-{arch}:package_dev"
_arch="{arch}"