feat (lib): add autolink and autostrip

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-06-13 12:01:43 +08:00
parent e8234fc32a
commit d4a8040a9c
5 changed files with 93 additions and 14 deletions
+31
View File
@@ -0,0 +1,31 @@
import os
from lib import arch, common, make, pkgcomposer
def autolink(composer: pkgcomposer.PkgComposer):
os.chdir(composer.workdir + "/bundle/")
try:
for i in common.treedir("bin"):
if i.is_file():
make.link(f"bin/{i.name}", "/bin/" + i.name)
except Exception:
pass
try:
for i in common.treedir("lib"):
if i.is_file():
make.link(f"lib/{i.name}", "/lib/" + arch.get_target() + "/" + i.name)
except Exception:
pass
try:
for i in common.treedir("include"):
if i.is_file():
make.link(
f"include/{i.name}",
"/lib/" + arch.get_target() + "/include/" + i.name,
)
except Exception:
pass