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:
parent
34c6f88691
commit
77a6ad03cb
|
@ -38,7 +38,7 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches):
|
||||||
_flavor=\"""" + device + """\"
|
_flavor=\"""" + device + """\"
|
||||||
url="https://kernel.org"
|
url="https://kernel.org"
|
||||||
license="GPL-2.0-only"
|
license="GPL-2.0-only"
|
||||||
options="!strip !check !tracedeps"
|
options="!strip !check !tracedeps pmb:cross-native"
|
||||||
makedepends=\"""" + makedepends + """\"
|
makedepends=\"""" + makedepends + """\"
|
||||||
|
|
||||||
# Source
|
# Source
|
||||||
|
|
|
@ -65,10 +65,19 @@ def suffix(args, apkbuild, arch):
|
||||||
if arch == args.arch_native:
|
if arch == args.arch_native:
|
||||||
return "native"
|
return "native"
|
||||||
|
|
||||||
|
if "pmb:cross-native" in apkbuild["options"]:
|
||||||
|
return "native"
|
||||||
|
|
||||||
pkgname = apkbuild["pkgname"]
|
pkgname = apkbuild["pkgname"]
|
||||||
if args.cross:
|
if args.cross:
|
||||||
for pattern in pmb.config.build_cross_native:
|
for pattern in pmb.config.build_cross_native:
|
||||||
if fnmatch.fnmatch(pkgname, pattern):
|
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 "native"
|
||||||
|
|
||||||
return "buildroot_" + arch
|
return "buildroot_" + arch
|
||||||
|
|
Loading…
Reference in New Issue