forked from semios/semios-packages
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
962c916ae1 | ||
|
|
248c0bbc66 | ||
|
|
f7242af3a9 | ||
|
|
a3dbac2b67 | ||
|
|
383433a365 | ||
|
|
844b40daaa | ||
|
|
e568b3f8ee | ||
|
|
a1ae78330c | ||
|
|
9ca10cb556 | ||
|
|
95a92ddae2 | ||
|
|
e6dd47ca7f | ||
|
|
2d9586117e | ||
|
|
4df9ac681f | ||
|
|
a47f241569 | ||
|
|
df21a97eb1 | ||
|
|
adea3cc896 | ||
|
|
5a36fc628c | ||
|
|
18f624e3c9 |
+15
-3
@@ -3,7 +3,18 @@ import os
|
||||
from . import packie
|
||||
|
||||
all: dict[str, dict[str, str]] = {
|
||||
"aarch64-semios-linux": {},
|
||||
"aarch64-semios-linux": {
|
||||
"CC": "clang -target aarch64-semios-linux-musl",
|
||||
"CXX": "clang++ -target aarch64-semios-linux-musl",
|
||||
},
|
||||
"x86_64-semios-linux": {
|
||||
"CC": "clang -target x86_64-semios-linux-musl",
|
||||
"CXX": "clang++ -target x86_64-semios-linux-musl",
|
||||
},
|
||||
"riscv64-semios-linux": {
|
||||
"CC": "clang -target riscv64-semios-linux-musl",
|
||||
"CXX": "clang++ -target riscv64-semios-linux-musl",
|
||||
},
|
||||
}
|
||||
_target: str = packie.host_arch()
|
||||
|
||||
@@ -15,5 +26,6 @@ def get_target():
|
||||
def set_target(arch: str):
|
||||
global _target
|
||||
_target = arch
|
||||
for key, val in all[_target]:
|
||||
os.environ[key] = val
|
||||
for key in all[_target].keys():
|
||||
if not os.environ.get(key):
|
||||
os.environ[key] = all[_target][key]
|
||||
|
||||
+23
@@ -1,5 +1,7 @@
|
||||
import typing
|
||||
|
||||
from lib import arch
|
||||
|
||||
from . import pkgcomposer, sources
|
||||
|
||||
_key_global = "@global"
|
||||
@@ -8,11 +10,15 @@ _key_description = "description"
|
||||
_key_on_pack = "on_pack"
|
||||
_key_arch_any = "arch_any"
|
||||
_key_links = "links"
|
||||
_key_dependencies = "dependencies"
|
||||
_key_provides = "provides"
|
||||
|
||||
_current_pkgname: str = _key_global
|
||||
_pkginfo: dict[str, dict[str, typing.Any]] = {
|
||||
_key_global: {
|
||||
_key_links: [],
|
||||
_key_dependencies: [],
|
||||
_key_provides: [],
|
||||
},
|
||||
}
|
||||
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
||||
@@ -25,6 +31,9 @@ def package(s: str):
|
||||
global _current_pkgname
|
||||
_current_pkgname = s
|
||||
_pkginfo[s] = _pkginfo[_key_global].copy()
|
||||
_pkginfo[s][_key_links] = _pkginfo[s][_key_links].copy()
|
||||
_pkginfo[s][_key_dependencies] = _pkginfo[s][_key_dependencies].copy()
|
||||
_pkginfo[s][_key_provides] = _pkginfo[s][_key_provides].copy()
|
||||
|
||||
|
||||
def version(s: str):
|
||||
@@ -39,6 +48,20 @@ def arch_any():
|
||||
_pkginfo[_current_pkgname][_key_arch_any] = True
|
||||
|
||||
|
||||
def provide(s: str):
|
||||
_pkginfo[_current_pkgname][_key_provides] += [
|
||||
s.replace("@same-arch", f"@{arch.get_target()}")
|
||||
]
|
||||
|
||||
|
||||
def dep(s: str):
|
||||
_pkginfo[_current_pkgname][_key_dependencies] += [
|
||||
s.replace("(same)", "(same-version) @same-arch")
|
||||
.replace("(same-version)", f"(={_pkginfo[_current_pkgname][_key_version]})")
|
||||
.replace("@same-arch", f"@{arch.get_target()}")
|
||||
]
|
||||
|
||||
|
||||
def link(src: str, dst: str, default: bool = True):
|
||||
_pkginfo[_current_pkgname][_key_links] += [
|
||||
{
|
||||
|
||||
+6
-3
@@ -22,6 +22,10 @@ def build(rem: list[str] = []):
|
||||
subprocess.run(cmdline)
|
||||
|
||||
|
||||
def artifacts_dir():
|
||||
return f"target/{_rust_triple(arch.get_target())}/release"
|
||||
|
||||
|
||||
def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter):
|
||||
pc.makedir(dstdir)
|
||||
with os.scandir(srcdir) as entries:
|
||||
@@ -49,11 +53,10 @@ def _autopack_filter_bin(ent) -> bool:
|
||||
|
||||
|
||||
def _auto_pack(profiles: list[str], pc: pkgcomposer.PkgComposer):
|
||||
target_dir = f"target/{_rust_triple(arch.get_target())}/release"
|
||||
if "lib" in profiles:
|
||||
_do_auto_pack(pc, target_dir, "lib", _autopack_filter_lib)
|
||||
_do_auto_pack(pc, artifacts_dir(), "lib", _autopack_filter_lib)
|
||||
if "bin" in profiles:
|
||||
_do_auto_pack(pc, target_dir, "bin", _autopack_filter_bin)
|
||||
_do_auto_pack(pc, artifacts_dir(), "bin", _autopack_filter_bin)
|
||||
|
||||
|
||||
def use_auto_pack(profiles: list[str]):
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"os_name": "\u001b[36;4mSemiOS\u001b[0m",
|
||||
"config_dir": "/var/config/airup",
|
||||
"service_dir": "/share/airup/services",
|
||||
"milestone_dir": "/share/airup/milestones",
|
||||
"runtime_dir": "/run/airup",
|
||||
"env_vars": {},
|
||||
"early_cmds": []
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
version("0.10.9")
|
||||
source_url("https://github.com/sisungo/airup/archive/refs/tags/v0.10.9.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
shutil.copy2("../../build_manifest.json", "build_manifest.json")
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_airup(composer):
|
||||
os.chdir(rust.artifacts_dir())
|
||||
composer.makedir("bin")
|
||||
composer.makedir("libexec")
|
||||
composer.addfile("airup", "bin/airup")
|
||||
composer.addfile("airupd", "bin/airupd")
|
||||
composer.addfile("airup-fallback-logger", "libexec/airup-fallback-logger")
|
||||
|
||||
|
||||
package("airup")
|
||||
on_pack(pack_airup)
|
||||
dep("semi-libc @same-arch")
|
||||
@@ -29,12 +29,22 @@ def pack_libssl(composer):
|
||||
|
||||
package("aws-lc-libcrypto")
|
||||
on_pack(pack_libcrypto)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("libcrypto@same-arch")
|
||||
|
||||
package("aws-lc-libssl")
|
||||
on_pack(pack_libssl)
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
provide("libssl@same-arch")
|
||||
|
||||
package("aws-lc-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
dep("aws-lc-libssl (same)")
|
||||
|
||||
package("aws-lc-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
dep("aws-lc-libssl (same)")
|
||||
provide("libcrypto-dev@same-arch")
|
||||
provide("libssl-dev@same-arch")
|
||||
|
||||
@@ -21,9 +21,14 @@ on_build(build)
|
||||
|
||||
package("libbzip2")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("bzip2")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libbzip2 (same)")
|
||||
dep("sh")
|
||||
dep("coreutils")
|
||||
|
||||
package("libbzip2-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libbzip2 (same)")
|
||||
|
||||
@@ -7,19 +7,24 @@ block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
rust.build(["--features", "unix"])
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
functions = [
|
||||
"[",
|
||||
"arch",
|
||||
"b2sum",
|
||||
"base32",
|
||||
"base64",
|
||||
"basename",
|
||||
"basenc",
|
||||
"cat",
|
||||
"chgrp",
|
||||
"chmod",
|
||||
"chown",
|
||||
"chroot",
|
||||
"cksum",
|
||||
"comm",
|
||||
"cp",
|
||||
@@ -40,21 +45,34 @@ functions = [
|
||||
"false",
|
||||
"fmt",
|
||||
"fold",
|
||||
"groups",
|
||||
"head",
|
||||
"hostid",
|
||||
"hostname",
|
||||
"id",
|
||||
"install",
|
||||
"join",
|
||||
"kill",
|
||||
"link",
|
||||
"ln",
|
||||
"logname",
|
||||
"ls",
|
||||
"md5sum",
|
||||
"mkdir",
|
||||
"mkfifo",
|
||||
"mknod",
|
||||
"mktemp",
|
||||
"more",
|
||||
"mv",
|
||||
"nice",
|
||||
"nl",
|
||||
"nohup",
|
||||
"nproc",
|
||||
"numfmt",
|
||||
"od",
|
||||
"paste",
|
||||
"pathchk",
|
||||
"pinky",
|
||||
"pr",
|
||||
"printenv",
|
||||
"printf",
|
||||
@@ -75,22 +93,32 @@ functions = [
|
||||
"sleep",
|
||||
"sort",
|
||||
"split",
|
||||
"stat",
|
||||
"stdbuf",
|
||||
"stty",
|
||||
"sum",
|
||||
"sync",
|
||||
"tac",
|
||||
"tail",
|
||||
"tee",
|
||||
"test",
|
||||
"timeout",
|
||||
"touch",
|
||||
"tr",
|
||||
"true",
|
||||
"truncate",
|
||||
"tsort",
|
||||
"tty",
|
||||
"uname",
|
||||
"unexpand",
|
||||
"uniq",
|
||||
"unlink",
|
||||
"uptime",
|
||||
"users",
|
||||
"vdir",
|
||||
"wc",
|
||||
"who",
|
||||
"whoami",
|
||||
"yes",
|
||||
]
|
||||
|
||||
@@ -98,3 +126,4 @@ package("coreutils")
|
||||
for func in functions:
|
||||
link(f"bin/coreutils", f"/bin/{func}")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -17,3 +17,4 @@ package("diffutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
link("bin/diffutils", "/bin/cmp")
|
||||
link("bin/diffutils", "/bin/diff")
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -20,9 +20,12 @@ on_build(build)
|
||||
|
||||
package("libexpat")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("libexpat-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libexpat (same)")
|
||||
|
||||
package("libexpat-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libexpat (same)")
|
||||
|
||||
@@ -14,3 +14,4 @@ on_build(build)
|
||||
|
||||
package("findutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -15,3 +15,4 @@ on_build(build)
|
||||
|
||||
package("gnu-make")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("78.3")
|
||||
source_url(
|
||||
"https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
os.chdir("source")
|
||||
cpp.configure(["--enable-plugins", "--prefix=/"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libicu4c")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("icu4c")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libicu4c (same)")
|
||||
|
||||
package("libicu4c-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libicu4c (same)")
|
||||
@@ -18,9 +18,14 @@ on_build(build)
|
||||
|
||||
package("libkmod")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
dep("libcrypto @same-arch")
|
||||
|
||||
package("kmod")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libkmod (same)")
|
||||
|
||||
package("libkmod-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libkmod (same)")
|
||||
|
||||
@@ -17,9 +17,18 @@ on_build(build)
|
||||
|
||||
package("libarchive")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("libcrypto@same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
dep("libz @same-arch")
|
||||
dep("liblzma @same-arch")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
|
||||
package("libarchive-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libarchive (same)")
|
||||
provide("bsdtar")
|
||||
|
||||
package("libarchive-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libarchive (same)")
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib import arch
|
||||
from lib.make import *
|
||||
|
||||
version("22.1.7")
|
||||
source_url(
|
||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.7/llvm-project-22.1.7.src.tar.xz"
|
||||
)
|
||||
|
||||
|
||||
def llvm_host_triple():
|
||||
return arch.get_target().replace("-semios-linux", "-semios-linux-musl")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(
|
||||
[
|
||||
"cmake",
|
||||
"-G",
|
||||
"Ninja",
|
||||
"-S",
|
||||
"llvm",
|
||||
"-B",
|
||||
"build",
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
f"-DLLVM_DEFAULT_TARGET_TRIPLE={llvm_host_triple()}",
|
||||
f"-DLLVM_HOST_TRIPLE={llvm_host_triple()}",
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;lldb;lld;bolt",
|
||||
"-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind;compiler-rt",
|
||||
"-DLLVM_ENABLE_EH=ON",
|
||||
"-DLLVM_ENABLE_RTTI=ON",
|
||||
"-DCMAKE_INSTALL_PREFIX=/",
|
||||
"-DLLVM_ENABLE_ASSERTIONS=OFF",
|
||||
"-DLLVM_BUILD_LLVM_DYLIB=ON",
|
||||
"-DLLVM_ENABLE_LIBCXX=ON",
|
||||
"-DLLVM_ENABLE_LIBEDIT=ON",
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON",
|
||||
"-DLIBCXX_HAS_MUSL_LIBC=ON",
|
||||
"-DCOMPILER_RT_BUILD_GWP_ASAN=OFF",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(["cmake", "--build", "build"], check=True)
|
||||
os.environ["DESTDIR"] = os.getcwd() + "/cpp_install"
|
||||
subprocess.run(["cmake", "--install", "build"], check=True)
|
||||
os.chdir("cpp_install")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_runtime_lib(composer, files):
|
||||
composer.makedir("lib")
|
||||
for file in files:
|
||||
composer.addfile(f"lib/{llvm_host_triple()}/{file}", f"lib/{file}")
|
||||
|
||||
|
||||
def pack_runtime_dev(composer, files: list[str]):
|
||||
for file in files:
|
||||
if file.startswith("lib/"):
|
||||
composer.makedirs("lib")
|
||||
composer.addfile(file.replace("lib/", f"lib/{llvm_host_triple()}/"), file)
|
||||
elif file.startswith("include/"):
|
||||
realpath = file.replace("include/", "usr/include/")
|
||||
composer.makedirs(os.path.dirname(file))
|
||||
if os.path.isfile(realpath):
|
||||
composer.addfile(realpath, file)
|
||||
elif os.path.isdir(realpath):
|
||||
composer.add_dir(realpath, file)
|
||||
|
||||
|
||||
package("libunwind")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libunwind.so.1.0", "libunwind.so.1", "libunwind.so"]
|
||||
)
|
||||
)
|
||||
|
||||
package("libunwind-dev")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_dev(
|
||||
composer,
|
||||
[
|
||||
"lib/libunwind.a",
|
||||
"include/mach-o/compact_unwind_encoding.h",
|
||||
"include/__libunwind_config.h",
|
||||
"include/libunwind.h",
|
||||
"include/libunwind.modulemap",
|
||||
"include/unwind.h",
|
||||
"include/unwind_arm_ehabi.h",
|
||||
"include/unwind_itanium.h",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
package("libcxxabi")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libc++abi.so", "libc++abi.so.1", "libc++abi.so.1.0"]
|
||||
)
|
||||
)
|
||||
|
||||
package("libcxxabi-dev")
|
||||
on_pack(lambda composer: pack_runtime_dev(composer, ["lib/libc++abi.a"]))
|
||||
|
||||
|
||||
package("libcxx")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libc++.so", "libc++.so.1", "libc++.so.1.0"]
|
||||
)
|
||||
)
|
||||
|
||||
package("libcxx-dev")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_dev(
|
||||
composer,
|
||||
[
|
||||
"lib/libc++.a",
|
||||
"lib/libc++experimental.a",
|
||||
"lib/libc++.modules.json",
|
||||
f"include/{llvm_host_triple()}/c++/v1",
|
||||
"include/c++/v1",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def pack_libllvm(composer):
|
||||
LIBRARIES = [
|
||||
"libLLVM.so.22.1",
|
||||
"libLLVM.so",
|
||||
"libLLVM-22.so",
|
||||
"libLTO.so",
|
||||
"libLTO.so.22.1",
|
||||
"libRemarks.so",
|
||||
"libRemarks.so.22.1",
|
||||
]
|
||||
composer.makedir("lib")
|
||||
for lib in LIBRARIES:
|
||||
composer.addfile(f"lib/{lib}", f"lib/{lib}")
|
||||
|
||||
|
||||
package("libllvm")
|
||||
on_pack(pack_libllvm)
|
||||
|
||||
|
||||
def pack_llvm(composer):
|
||||
BINARIES = [
|
||||
"bugpoint",
|
||||
"dsymutil",
|
||||
"llc",
|
||||
"lli",
|
||||
"llvm-addr2line",
|
||||
"llvm-ar",
|
||||
"llvm-as",
|
||||
"llvm-bcanalyzer",
|
||||
"llvm-bitcode-strip",
|
||||
"llvm-bolt",
|
||||
"llvm-bolt-binary-analysis",
|
||||
"llvm-bolt-heatmap",
|
||||
"llvm-boltdiff",
|
||||
"llvm-c-test",
|
||||
"llvm-cas",
|
||||
"llvm-cat",
|
||||
"llvm-cfi-verify",
|
||||
"llvm-cgdata",
|
||||
"llvm-config",
|
||||
"llvm-cov",
|
||||
"llvm-ctxprof-util",
|
||||
"llvm-cvtres",
|
||||
"llvm-cxxdump",
|
||||
"llvm-cxxfilt",
|
||||
"llvm-cxxmap",
|
||||
"llvm-debuginfo-analyzer",
|
||||
"llvm-debuginfod",
|
||||
"llvm-debuginfod-find",
|
||||
"llvm-diff",
|
||||
"llvm-dis",
|
||||
"llvm-dlltool",
|
||||
"llvm-dwarfdump",
|
||||
"llvm-dwarfutil",
|
||||
"llvm-dwp",
|
||||
"llvm-exegesis",
|
||||
"llvm-extract",
|
||||
"llvm-gsymutil",
|
||||
"llvm-ifs",
|
||||
"llvm-install-name-tool",
|
||||
"llvm-ir2vec",
|
||||
"llvm-jitlink",
|
||||
"llvm-lib",
|
||||
"llvm-libtool-darwin",
|
||||
"llvm-link",
|
||||
"llvm-lipo",
|
||||
"llvm-lto",
|
||||
"llvm-lto2",
|
||||
"llvm-mc",
|
||||
"llvm-mca",
|
||||
"llvm-ml",
|
||||
"llvm-ml64",
|
||||
"llvm-modextract",
|
||||
"llvm-nm",
|
||||
"llvm-objcopy",
|
||||
"llvm-objdump",
|
||||
"llvm-offload-binary",
|
||||
"llvm-offload-wrapper",
|
||||
"llvm-opt-report",
|
||||
"llvm-otool",
|
||||
"llvm-pdbutil",
|
||||
"llvm-profdata",
|
||||
"llvm-profgen",
|
||||
"llvm-ranlib",
|
||||
"llvm-rc",
|
||||
"llvm-readelf",
|
||||
"llvm-readobj",
|
||||
"llvm-readtapi",
|
||||
"llvm-reduce",
|
||||
"llvm-remarkutil",
|
||||
"llvm-rtdyld",
|
||||
"llvm-sim",
|
||||
"llvm-size",
|
||||
"llvm-split",
|
||||
"llvm-stress",
|
||||
"llvm-strings",
|
||||
"llvm-strip",
|
||||
"llvm-symbolizer",
|
||||
"llvm-tblgen",
|
||||
"llvm-tli-checker",
|
||||
"llvm-undname",
|
||||
"llvm-windres",
|
||||
"llvm-xray",
|
||||
"merge-fdata",
|
||||
"opt",
|
||||
"perf2bolt",
|
||||
"reduce-chunk-list",
|
||||
"sancov",
|
||||
"sanstats",
|
||||
"verify-uselistorder",
|
||||
]
|
||||
composer.makedir("bin")
|
||||
for bin in BINARIES:
|
||||
composer.addfile(f"usr/bin/{bin}", f"bin/{bin}")
|
||||
|
||||
|
||||
package("llvm")
|
||||
on_pack(pack_llvm)
|
||||
|
||||
|
||||
def pack_lld(composer):
|
||||
BINARIES = ["lld", "lld-link", "ld.lld", "ld64.lld", "wasm-ld"]
|
||||
composer.makedir("bin")
|
||||
for bin in BINARIES:
|
||||
composer.addfile(f"usr/bin/{bin}", f"bin/{bin}")
|
||||
|
||||
|
||||
package("lld")
|
||||
on_pack(pack_lld)
|
||||
|
||||
|
||||
def pack_liblldb(composer):
|
||||
LIBRARIES = [
|
||||
"liblldb.so",
|
||||
"liblldb.so.22.1",
|
||||
"liblldb.so.22.1.7",
|
||||
"liblldbIntelFeatures.so",
|
||||
"liblldbIntelFeatures.so.22.1",
|
||||
]
|
||||
composer.makedir("lib")
|
||||
for lib in LIBRARIES:
|
||||
composer.addfile(f"lib/{lib}", f"lib/{lib}")
|
||||
|
||||
|
||||
package("liblldb")
|
||||
on_pack(pack_liblldb)
|
||||
|
||||
|
||||
def pack_lldb(composer):
|
||||
BINARIES = [
|
||||
"lldb",
|
||||
"lldb-argdumper",
|
||||
"lldb-dap",
|
||||
"lldb-instr",
|
||||
"lldb-mcp",
|
||||
"lldb-server",
|
||||
"yaml2macho-core",
|
||||
]
|
||||
composer.makedir("bin")
|
||||
for bin in BINARIES:
|
||||
composer.addfile(f"bin/{bin}", f"bin/{bin}")
|
||||
|
||||
|
||||
package("lldb")
|
||||
on_pack(pack_lldb)
|
||||
|
||||
|
||||
def pack_libclang(composer):
|
||||
LIBRARIES = [
|
||||
"libclang.so",
|
||||
"libclang-cpp.so",
|
||||
"libclang-cpp.so.22.1",
|
||||
"libclang.so.22.1",
|
||||
"libclang.so.22.1.7",
|
||||
]
|
||||
composer.makedir("lib")
|
||||
for lib in LIBRARIES:
|
||||
composer.addfile(f"lib/{lib}", f"lib/{lib}")
|
||||
|
||||
|
||||
package("libclang")
|
||||
on_pack(pack_libclang)
|
||||
|
||||
|
||||
def pack_clang(composer):
|
||||
BINARIES = [
|
||||
"clang",
|
||||
"clang++",
|
||||
"clang-22",
|
||||
"clang-check",
|
||||
"clang-cl",
|
||||
"clang-cpp",
|
||||
"clang-extdef-mapping",
|
||||
"clang-format",
|
||||
"clang-installapi",
|
||||
"clang-linker-wrapper",
|
||||
"clang-nvlink-wrapper",
|
||||
"clang-offload-bundler",
|
||||
"clang-offload-packager",
|
||||
"clang-refactor",
|
||||
"clang-repl",
|
||||
"clang-scan-deps",
|
||||
"clang-sycl-linker",
|
||||
"clang-tblgen",
|
||||
"diagtool",
|
||||
"git-clang-format",
|
||||
"hmaptool",
|
||||
"intercept-build",
|
||||
"amdgpu-arch",
|
||||
"c-index-test",
|
||||
"analyze-build",
|
||||
"nvptx-arch",
|
||||
"offload-arch",
|
||||
"scan-build",
|
||||
"scan-build-py",
|
||||
"scan-view",
|
||||
]
|
||||
LIBEXEC = [
|
||||
"analyze-c++",
|
||||
"analyze-cc",
|
||||
"c++-analyzer",
|
||||
"ccc-analyzer",
|
||||
"intercept-c++",
|
||||
"intercept-cc",
|
||||
]
|
||||
composer.makedir("bin")
|
||||
for bin in BINARIES:
|
||||
composer.addfile(f"usr/bin/{bin}", f"bin/{bin}")
|
||||
composer.makedir("libexec")
|
||||
for libexec in LIBEXEC:
|
||||
composer.addfile(f"usr/libexec/{libexec}", f"libexec/{libexec}")
|
||||
|
||||
|
||||
package("clang")
|
||||
on_pack(pack_clang)
|
||||
@@ -20,3 +20,5 @@ def pack_mksh(composer):
|
||||
|
||||
package("mksh")
|
||||
on_pack(pack_mksh)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("sh")
|
||||
|
||||
@@ -20,6 +20,8 @@ on_build(build)
|
||||
|
||||
package("libnghttp2")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("libnghttp2-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libnghttp2 (same)")
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.13.2")
|
||||
@@ -21,3 +20,5 @@ def pack_ninja(composer):
|
||||
|
||||
package("ninja")
|
||||
on_pack(pack_ninja)
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libcxx @same-arch")
|
||||
|
||||
@@ -23,9 +23,12 @@ on_build(build)
|
||||
|
||||
package("libpkgconf")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("pkgconf")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libpkgconf (same)")
|
||||
|
||||
package("libpkgconf-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libpkgconf (same)")
|
||||
|
||||
@@ -25,3 +25,4 @@ link("lib/libc.so", f"/lib/ld-musl-{musl_target()}.so.1")
|
||||
|
||||
package("semi-libc-dev")
|
||||
use_auto_pack(["dev"])
|
||||
dep("semi-libc (same)")
|
||||
|
||||
@@ -22,9 +22,12 @@ on_build(build)
|
||||
|
||||
package("libsqlite")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("sqlite")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libsqlite (same)")
|
||||
|
||||
package("libsqlite-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libsqlite (same)")
|
||||
|
||||
@@ -17,9 +17,12 @@ on_build(build)
|
||||
|
||||
package("liblzma")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("xz")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("liblzma (same)")
|
||||
|
||||
package("liblzma-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("liblzma (same)")
|
||||
|
||||
@@ -18,9 +18,14 @@ on_build(build)
|
||||
|
||||
package("libz-ng")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
provide("libz@same-arch")
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zlib-ng-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libz-ng (same)")
|
||||
|
||||
package("libz-ng-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libz-ng (same)")
|
||||
provide("libz-dev@same-arch")
|
||||
|
||||
@@ -10,7 +10,7 @@ source_url(
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"])
|
||||
cpp.make_install()
|
||||
os.chdir("usr/local")
|
||||
|
||||
@@ -19,9 +19,12 @@ on_build(build)
|
||||
|
||||
package("libzstd")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zstd")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
package("libzstd-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
@@ -20,8 +20,13 @@ argparser = argparse.ArgumentParser(
|
||||
argparser.add_argument(
|
||||
"--target", type=str, help="Target architecture to build the package for"
|
||||
)
|
||||
argparser.add_argument("--build", type=str, help="Package to build")
|
||||
argparser.add_argument("--clean", type=str, help="Package to clean")
|
||||
subparsers = argparser.add_subparsers(dest="subcommand")
|
||||
parser_build = subparsers.add_parser("build")
|
||||
parser_build.add_argument("BUILD_PKGNAME")
|
||||
parser_clean = subparsers.add_parser("clean")
|
||||
parser_clean.add_argument("CLEAN_PKGNAME")
|
||||
parser_list = subparsers.add_parser("list")
|
||||
parser_list.add_argument("ITEM", choices=("all", "built", "new"))
|
||||
args = argparser.parse_args()
|
||||
|
||||
if args.target:
|
||||
@@ -74,6 +79,8 @@ def run_build_package(package: str):
|
||||
|
||||
# Pack packages
|
||||
for pkgname in lib.make._pkginfo.keys():
|
||||
lib.make._current_pkgname = pkgname
|
||||
|
||||
if pkgname == lib.make._key_global:
|
||||
continue
|
||||
|
||||
@@ -101,10 +108,16 @@ def run_build_package(package: str):
|
||||
"version": pkgver,
|
||||
"arch": pkgarch,
|
||||
"links": pkginfo[lib.make._key_links],
|
||||
"dependencies": pkginfo[lib.make._key_dependencies],
|
||||
"provides": pkginfo[lib.make._key_provides],
|
||||
}
|
||||
composer.write_manifest(manifest)
|
||||
composer.compose()
|
||||
|
||||
# Build success
|
||||
with open(f"{package_dir}/target/build-ok.tag", "wt+") as file:
|
||||
file.write("OK")
|
||||
|
||||
|
||||
def run_clean_package(package: str):
|
||||
try:
|
||||
@@ -113,7 +126,37 @@ def run_clean_package(package: str):
|
||||
pass
|
||||
|
||||
|
||||
if args.build:
|
||||
run_build_package(args.build)
|
||||
if args.clean:
|
||||
run_clean_package(args.clean)
|
||||
def run_list(item):
|
||||
if item == "all":
|
||||
for i in os.listdir("packages"):
|
||||
if i.startswith("."):
|
||||
continue
|
||||
print(i)
|
||||
elif item == "built":
|
||||
for i in os.listdir("packages"):
|
||||
if i.startswith("."):
|
||||
continue
|
||||
if os.path.exists(f"packages/{i}/target/build-ok.tag"):
|
||||
print(i)
|
||||
elif item == "new":
|
||||
for i in os.listdir("packages"):
|
||||
if i.startswith("."):
|
||||
continue
|
||||
try:
|
||||
pkgbuild_mtime = os.path.getmtime(f"packages/{i}/pkgbuild.py")
|
||||
target_mtime = os.path.getmtime(f"packages/{i}/target/build-ok.tag")
|
||||
if target_mtime < pkgbuild_mtime:
|
||||
print(i)
|
||||
except Exception:
|
||||
print(i)
|
||||
|
||||
|
||||
if args.subcommand == "build":
|
||||
run_build_package(args.BUILD_PKGNAME)
|
||||
elif args.subcommand == "clean":
|
||||
run_clean_package(args.CLEAN_PKGNAME)
|
||||
elif args.subcommand == "list":
|
||||
run_list(args.ITEM)
|
||||
else:
|
||||
print("error: no action specified", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user