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
This commit is contained in:
Oliver Smith 2020-04-19 10:57:34 +02:00 committed by Minecrell
parent 34c6f88691
commit 77a6ad03cb
No known key found for this signature in database
GPG Key ID: B77CE638A6C2E562
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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