From 77a6ad03cbc66b6a128a0f587b7a223e0e9f51c5 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 19 Apr 2020 10:57:34 +0200 Subject: [PATCH] pmb.build.autodetect: support pmb:cross-native (MR 1920) Have explicit selection of the "native" cross compilation method with a new "pmb:cross-native" option. Deprecate the implicit pkgname pattern matching. Related: #1910 --- pmb/aportgen/linux.py | 2 +- pmb/build/autodetect.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pmb/aportgen/linux.py b/pmb/aportgen/linux.py index d3ad0f22..9f07e06b 100644 --- a/pmb/aportgen/linux.py +++ b/pmb/aportgen/linux.py @@ -38,7 +38,7 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches): _flavor=\"""" + device + """\" url="https://kernel.org" license="GPL-2.0-only" - options="!strip !check !tracedeps" + options="!strip !check !tracedeps pmb:cross-native" makedepends=\"""" + makedepends + """\" # Source diff --git a/pmb/build/autodetect.py b/pmb/build/autodetect.py index 119d161f..3954a2e8 100644 --- a/pmb/build/autodetect.py +++ b/pmb/build/autodetect.py @@ -65,10 +65,19 @@ def suffix(args, apkbuild, arch): if arch == args.arch_native: return "native" + if "pmb:cross-native" in apkbuild["options"]: + return "native" + pkgname = apkbuild["pkgname"] if args.cross: for pattern in pmb.config.build_cross_native: if fnmatch.fnmatch(pkgname, pattern): + logging.info(f"NOTE: '{pkgname}' would implicitly get cross" + f" compiled with the 'native' method, because" + f" it matches pattern '{pattern}'.") + logging.info("NOTE: this pattern matching will be removed in" + " the future, add 'pmb:cross-native' to the" + " APKBUILD's options to make it explicit.") return "native" return "buildroot_" + arch