build.menuconfig: add support for out-of-tree builds using _outdir (!1893)
This commit is contained in:
parent
ff61dfc077
commit
cb9a02b348
|
@ -40,7 +40,7 @@ def get_arch(args, apkbuild):
|
||||||
apkbuild["arch"][0] + "' architecture.")
|
apkbuild["arch"][0] + "' architecture.")
|
||||||
|
|
||||||
|
|
||||||
def get_outputdir(args, pkgname):
|
def get_outputdir(args, pkgname, apkbuild):
|
||||||
"""
|
"""
|
||||||
Get the folder for the kernel compilation output.
|
Get the folder for the kernel compilation output.
|
||||||
For most APKBUILDs, this is $builddir. But some older ones still use
|
For most APKBUILDs, this is $builddir. But some older ones still use
|
||||||
|
@ -69,6 +69,10 @@ def get_outputdir(args, pkgname):
|
||||||
if os.path.exists(chroot + ret + "/kernel/.config"):
|
if os.path.exists(chroot + ret + "/kernel/.config"):
|
||||||
return os.path.join(ret, "kernel")
|
return os.path.join(ret, "kernel")
|
||||||
|
|
||||||
|
# Out-of-tree builds ($_outdir)
|
||||||
|
if os.path.exists(chroot + ret + "/" + apkbuild["_outdir"] + "/.config"):
|
||||||
|
return os.path.join(ret, apkbuild["_outdir"])
|
||||||
|
|
||||||
# Not found
|
# Not found
|
||||||
raise RuntimeError("Could not find the kernel config. Consider making a"
|
raise RuntimeError("Could not find the kernel config. Consider making a"
|
||||||
" backup of your APKBUILD and recreating it from the"
|
" backup of your APKBUILD and recreating it from the"
|
||||||
|
@ -121,7 +125,7 @@ def menuconfig(args, pkgname):
|
||||||
env={"CARCH": arch})
|
env={"CARCH": arch})
|
||||||
|
|
||||||
# Run make menuconfig
|
# Run make menuconfig
|
||||||
outputdir = get_outputdir(args, pkgname)
|
outputdir = get_outputdir(args, pkgname, apkbuild)
|
||||||
logging.info("(native) make " + kopt)
|
logging.info("(native) make " + kopt)
|
||||||
pmb.chroot.user(args, ["make", kopt], "native",
|
pmb.chroot.user(args, ["make", kopt], "native",
|
||||||
outputdir, output="tui",
|
outputdir, output="tui",
|
||||||
|
|
Loading…
Reference in New Issue