feat: add hooks/autopatch

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-06-10 04:53:01 +08:00
parent 5b4036abd2
commit bf52025629
4 changed files with 50 additions and 2 deletions
+9
View File
@@ -46,6 +46,13 @@ def run_build_package(package: str):
print(f"Architecture {lib.arch.get_target()} is not supported for this package")
exit(1)
# Run `pre_build` hooks
for n in hooks.pre_build.keys():
if n in lib.make._blocked_hooks:
continue
hooks.pre_build[n]()
os.chdir(package_dir)
# Build the package
if lib.make._on_build:
os.chdir(lib.sources.sources_dir_name())
@@ -54,10 +61,12 @@ def run_build_package(package: str):
print("on_build(): Not defined")
# Run `post_build` hooks
post_build_dir = os.getcwd()
for n in hooks.post_build.keys():
if n in lib.make._blocked_hooks:
continue
hooks.post_build[n]()
os.chdir(post_build_dir)
# Pack packages
for pkgname in lib.make._pkginfo.keys():