forked from semios/semios-packages
Compare commits
78
Commits
gettext-tiny
...
libpsl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6abf94ba6c | ||
|
|
557aae6cb5 | ||
|
|
178f5820e7 | ||
|
|
aded8393fe | ||
|
|
ea6c4592e9 | ||
|
|
a903430180 | ||
|
|
b3d71e0a3a | ||
|
|
6dd8c911a1 | ||
|
|
5c22c479bd | ||
|
|
6704ec11ea | ||
|
|
8c58073118 | ||
|
|
eea8869aa5 | ||
|
|
7e888b8408 | ||
|
|
5729463e2e | ||
|
|
9dc11ca666 | ||
|
|
e567c27db8 | ||
|
|
4f4ec0468a | ||
|
|
ab71a8ae75 | ||
|
|
07c93dac59 | ||
|
|
5dece05466 | ||
|
|
c47d1390bc | ||
|
|
b0185d379b | ||
|
|
bd16d6d218 | ||
|
|
d06120bdeb | ||
|
|
490c81a6d9 | ||
|
|
b9533a5c6e | ||
|
|
37da18439b | ||
|
|
aaab087b4d | ||
|
|
e6fb25c31b | ||
|
|
4f06471aa2 | ||
|
|
f6efa6fd66 | ||
|
|
e92240a211 | ||
|
|
c530c16fbf | ||
|
|
e24723a940 | ||
|
|
cf9d57202b | ||
|
|
c0e9573a41 | ||
|
|
23394f785e | ||
|
|
3994b0d9a3 | ||
|
|
3b78c450c5 | ||
|
|
0075495c78 | ||
|
|
f0147fafac | ||
|
|
a34f41f1fe | ||
|
|
db6f7fa8ad | ||
|
|
e9f52ee363 | ||
|
|
0178b36988 | ||
|
|
57578dcb05 | ||
|
|
9f623be2e5 | ||
|
|
f76006e595 | ||
|
|
fea89673ed | ||
|
|
487ac4a679 | ||
|
|
e55d5e74db | ||
|
|
868a631c93 | ||
|
|
92192d5fba | ||
|
|
bbe4604406 | ||
|
|
c471a18585 | ||
|
|
c4e694cd42 | ||
|
|
7300eb7d00 | ||
|
|
aba5fba2e3 | ||
|
|
3ced6357dc | ||
|
|
b026069a61 | ||
|
|
bafd4098a8 | ||
|
|
ed7d0b5680 | ||
|
|
66626cf702 | ||
|
|
bfd4548869 | ||
|
|
e3d032623f | ||
|
|
abfe30c539 | ||
|
|
b0ae1f4bf4 | ||
|
|
2938e9e969 | ||
|
|
b0b40ef774 | ||
|
|
df1accfb3e | ||
|
|
2fa379760a | ||
|
|
b7d9d9b7d6 | ||
|
|
f55398575a | ||
|
|
3a4307f811 | ||
|
|
2b73f626a1 | ||
|
|
3022b06b20 | ||
|
|
dac07d40bb | ||
|
|
f947e27187 |
@@ -0,0 +1,138 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from . import packie
|
||||
|
||||
BASE_REQUIREMENTS = [
|
||||
# Basic packages for running shell scripts
|
||||
"mksh",
|
||||
"coreutils",
|
||||
"findutils",
|
||||
"diffutils",
|
||||
# Packages for running `semios-packages` scripts
|
||||
"python",
|
||||
"packie",
|
||||
"patch",
|
||||
"zstd",
|
||||
"libz-ng",
|
||||
"liblzma",
|
||||
"libbzip2",
|
||||
# Basic libraries
|
||||
"sqlite",
|
||||
"libgcc-compat",
|
||||
"libcxx",
|
||||
"semi-libc",
|
||||
# Networking
|
||||
"ca-certificates",
|
||||
"certutil",
|
||||
"aws-lc-libssl",
|
||||
"aws-lc-tools",
|
||||
]
|
||||
|
||||
|
||||
def _prepare_build_env_base_files(root: str):
|
||||
os.makedirs(root, exist_ok=True)
|
||||
os.mkdir(f"{root}/var")
|
||||
os.mkdir(f"{root}/var/tmp")
|
||||
os.mkdir(f"{root}/var/run")
|
||||
os.mkdir(f"{root}/tmp")
|
||||
os.mkdir(f"{root}/run")
|
||||
os.makedirs(f"{root}/var/db/packie")
|
||||
shutil.copytree("/var/config/packie/repos.d", f"{root}/var/config/packie/repos.d")
|
||||
os.mkdir(f"{root}/dev")
|
||||
os.mkdir(f"{root}/sys")
|
||||
os.mkdir(f"{root}/proc")
|
||||
os.makedirs(f"{root}/home/root")
|
||||
|
||||
|
||||
def prepare_build_env(root: str, extreq: list[str] = []):
|
||||
# Skip if the environment is already initialized
|
||||
if os.path.exists(f"{root}/.INIT"):
|
||||
return
|
||||
try:
|
||||
shutil.rmtree(root)
|
||||
except:
|
||||
pass
|
||||
|
||||
# Prepare basic filesystem hierarchy
|
||||
_prepare_build_env_base_files(root)
|
||||
|
||||
# Install packages
|
||||
packie.chroot_update(root)
|
||||
packie.chroot_install(root, BASE_REQUIREMENTS + extreq)
|
||||
|
||||
# Refresh certificates
|
||||
enter_build_env(root, ["certutil", "refresh"])
|
||||
|
||||
# Copy DNS config
|
||||
os.makedirs(f"{root}/etc", exist_ok=True)
|
||||
shutil.copy2("/etc/resolv.conf", f"{root}/etc/resolv.conf")
|
||||
|
||||
# Create initialized tag
|
||||
with open(f"{root}/.INIT", "wt+") as file:
|
||||
file.write("OK")
|
||||
|
||||
|
||||
def enter_build_env(root: str, cmd: list[str], chdir: str = "/"):
|
||||
reserve_env = ["https_proxy", "http_proxy", "all_proxy"]
|
||||
reserve_env_args = []
|
||||
for i in reserve_env:
|
||||
if os.environ.get(i):
|
||||
reserve_env_args += ["--setenv", i, os.environ[i]]
|
||||
subprocess.run(
|
||||
[
|
||||
"bwrap",
|
||||
"--bind",
|
||||
root,
|
||||
"/",
|
||||
"--unshare-pid",
|
||||
"--unshare-user",
|
||||
"--uid",
|
||||
"0",
|
||||
"--gid",
|
||||
"0",
|
||||
"--dev",
|
||||
"/dev",
|
||||
"--bind",
|
||||
"/sys",
|
||||
"/sys",
|
||||
"--proc",
|
||||
"/proc",
|
||||
"--clearenv",
|
||||
"--setenv",
|
||||
"HOME",
|
||||
"/home/root",
|
||||
"--setenv",
|
||||
"PATH",
|
||||
"/bin",
|
||||
"--setenv",
|
||||
"SEMIOS_PKGBUILD_IN_ATOMIC",
|
||||
"1",
|
||||
"--chdir",
|
||||
chdir,
|
||||
]
|
||||
+ reserve_env_args
|
||||
+ cmd
|
||||
)
|
||||
|
||||
|
||||
def copy_pkgbuild_tree(repo_root: str, pkgname: str, build_env_root: str):
|
||||
build_dir = f"{build_env_root}/Atom"
|
||||
if os.path.exists(build_dir):
|
||||
return
|
||||
os.mkdir(build_dir)
|
||||
shutil.copytree(f"{repo_root}/hooks", f"{build_dir}/hooks")
|
||||
shutil.copytree(f"{repo_root}/lib", f"{build_dir}/lib")
|
||||
shutil.copy2(f"{repo_root}/x", f"{build_dir}/x")
|
||||
shutil.copy2(f"{repo_root}/x.py", f"{build_dir}/x.py")
|
||||
os.makedirs(f"{build_dir}/packages/{pkgname}")
|
||||
for i in os.listdir(f"{repo_root}/packages/{pkgname}"):
|
||||
srcpath = f"{repo_root}/packages/{pkgname}/{i}"
|
||||
dstpath = f"{build_dir}/packages/{pkgname}/{i}"
|
||||
if i in ["target", "__pycache__"]:
|
||||
continue
|
||||
if os.path.isdir(srcpath):
|
||||
shutil.copytree(srcpath, dstpath)
|
||||
elif os.path.isfile(srcpath):
|
||||
shutil.copy2(srcpath, dstpath)
|
||||
+13
-9
@@ -29,6 +29,15 @@ def cmake(rem: list[str] = []):
|
||||
)
|
||||
|
||||
|
||||
def _move_install():
|
||||
subprocess.run(["sh", "-c", "cp -r ./pkg/*@*/* . 2>/dev/null || true"], check=False)
|
||||
subprocess.run(
|
||||
["sh", "-c", "cp -r ./usr/local/* . 2>/dev/null || true"], check=False
|
||||
)
|
||||
subprocess.run(["sh", "-c", "cp -r ./usr/* . 2>/dev/null || true"], check=False)
|
||||
subprocess.run(["rm", "-rf", "./pkg", "./usr"], check=False)
|
||||
|
||||
|
||||
def make(rem: list[str] = []):
|
||||
subprocess.run(["make", f"-j{os.cpu_count()}"] + rem, check=True)
|
||||
|
||||
@@ -44,26 +53,21 @@ def make_install(rem: list[str] | None = None, chdir: bool = True, move: bool =
|
||||
if rem is None and chdir:
|
||||
os.chdir("../cpp_install")
|
||||
if chdir and move:
|
||||
subprocess.run(
|
||||
["sh", "-c", "cp -r ./pkg/*@*/* . 2>/dev/null || true"], check=False
|
||||
)
|
||||
subprocess.run(
|
||||
["sh", "-c", "cp -r ./usr/local/* . 2>/dev/null || true"], check=False
|
||||
)
|
||||
subprocess.run(["sh", "-c", "cp -r ./usr/* . 2>/dev/null || true"], check=False)
|
||||
subprocess.run(["rm", "-rf", "./pkg", "./usr"], check=False)
|
||||
_move_install()
|
||||
|
||||
|
||||
def ninja(rem: list[str] = []):
|
||||
subprocess.run(["ninja"] + rem, check=True)
|
||||
|
||||
|
||||
def ninja_install(rem: list[str] = [], chdir: bool = True):
|
||||
def ninja_install(rem: list[str] = [], chdir: bool = True, move: bool = True):
|
||||
if chdir:
|
||||
os.environ["DESTDIR"] = os.getcwd() + "/../cpp_install"
|
||||
subprocess.run(["ninja", "install"] + rem, check=True)
|
||||
if chdir:
|
||||
os.chdir(os.environ["DESTDIR"])
|
||||
if chdir and move:
|
||||
_move_install()
|
||||
|
||||
|
||||
def meson_setup(rem: list[str] = []):
|
||||
|
||||
+36
-5
@@ -11,6 +11,7 @@ _key_on_pack = "on_pack"
|
||||
_key_arch_any = "arch_any"
|
||||
_key_links = "links"
|
||||
_key_dependencies = "dependencies"
|
||||
_key_recommendations = "recommendations"
|
||||
_key_provides = "provides"
|
||||
|
||||
_current_pkgname: str = _key_global
|
||||
@@ -19,14 +20,34 @@ _pkginfo: dict[str, dict[str, typing.Any]] = {
|
||||
_key_links: [],
|
||||
_key_dependencies: [],
|
||||
_key_provides: [],
|
||||
_key_recommendations: [],
|
||||
},
|
||||
}
|
||||
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
||||
_on_build: typing.Callable[[], None] | None = None
|
||||
|
||||
_in_atombuild = False
|
||||
_builddep: list[str] = []
|
||||
|
||||
_blocked_hooks: list[str] = []
|
||||
|
||||
|
||||
def builddep(s: str):
|
||||
global _builddep
|
||||
if s == "shortcut/c":
|
||||
_builddep += ["semi-libc-dev", "clang", "llvm", "lld"]
|
||||
elif s == "shortcut/c++":
|
||||
builddep("shortcut/c")
|
||||
_builddep += ["libcxx-dev"]
|
||||
elif s == "shortcut/autotools":
|
||||
_builddep += ["gnu-make", "gnu-sed", "awk", "grep"]
|
||||
elif s == "shortcut/rust":
|
||||
builddep("shortcut/c")
|
||||
_builddep += ["cargo", "rustc"]
|
||||
else:
|
||||
_builddep += [s]
|
||||
|
||||
|
||||
def package(s: str):
|
||||
global _current_pkgname
|
||||
_current_pkgname = s
|
||||
@@ -54,12 +75,20 @@ def provide(s: str):
|
||||
]
|
||||
|
||||
|
||||
def dep(s: str):
|
||||
_pkginfo[_current_pkgname][_key_dependencies] += [
|
||||
def _translate_dep_spec(s: str) -> str:
|
||||
return (
|
||||
s.replace("(same)", "(same-version) @same-arch")
|
||||
.replace("(same-version)", f"(={_pkginfo[_current_pkgname][_key_version]})")
|
||||
.replace("@same-arch", f"@{arch.get_target()}")
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def dep(s: str):
|
||||
_pkginfo[_current_pkgname][_key_dependencies] += [_translate_dep_spec(s)]
|
||||
|
||||
|
||||
def recommend(s: str):
|
||||
_pkginfo[_current_pkgname][_key_recommendations] += [_translate_dep_spec(s)]
|
||||
|
||||
|
||||
def link(src: str, dst: str, default: bool = True):
|
||||
@@ -103,8 +132,10 @@ def block_hook(hook: str):
|
||||
|
||||
|
||||
def source_url(url: str):
|
||||
sources.source_url(url)
|
||||
if not _in_atombuild:
|
||||
sources.source_url(url)
|
||||
|
||||
|
||||
def source_git(url: str, branch: str | None = None):
|
||||
sources.source_git(url, branch)
|
||||
if not _in_atombuild:
|
||||
sources.source_git(url, branch)
|
||||
|
||||
+28
-2
@@ -1,11 +1,37 @@
|
||||
import subprocess
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
PACKIE_EXEC = os.getenv("PACKIE", "packie")
|
||||
|
||||
|
||||
def host_arch() -> str:
|
||||
result = subprocess.run(
|
||||
[PACKIE_EXEC, "print", "profile.host_arch"],
|
||||
check=True, capture_output=True,
|
||||
check=True,
|
||||
capture_output=True,
|
||||
)
|
||||
return result.stdout.decode().strip()
|
||||
|
||||
|
||||
def chroot_update(root: str):
|
||||
subprocess.run([PACKIE_EXEC, "--chroot", root, "update"], check=True)
|
||||
|
||||
|
||||
def chroot_install(root: str, requirements: list[str]):
|
||||
subprocess.run(
|
||||
[PACKIE_EXEC, "--chroot", root, "install", "--yes"] + requirements, check=True
|
||||
)
|
||||
|
||||
|
||||
def update():
|
||||
subprocess.run([PACKIE_EXEC, "update"], check=True)
|
||||
|
||||
|
||||
def install(requirements: list[str]):
|
||||
subprocess.run([PACKIE_EXEC, "install", "--yes"] + requirements, check=True)
|
||||
|
||||
|
||||
def repo_add(repo: str, pkgfile: str):
|
||||
subprocess.run(
|
||||
[PACKIE_EXEC, "repo-admin", repo, "--add-package", pkgfile], check=True
|
||||
)
|
||||
|
||||
+12
-1
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
@@ -45,4 +46,14 @@ class PkgComposer:
|
||||
shutil.copy2(src, f"{self.workdir}/bundle/{dst}", follow_symlinks=False)
|
||||
|
||||
def add_dir(self, src: str, dst: str, merge: bool = False):
|
||||
shutil.copytree(src, f"{self.workdir}/bundle/{dst}", dirs_exist_ok=merge)
|
||||
target = f"{self.workdir}/bundle/{dst}"
|
||||
if not os.path.exists(src):
|
||||
raise FileNotFoundError(f"Source directory not found: {src}")
|
||||
os.makedirs(os.path.dirname(target), exist_ok=True)
|
||||
if merge and os.path.exists(target) and os.path.isdir(target):
|
||||
cmd = ["cp", "-a", f"{src}/.", target]
|
||||
else:
|
||||
cmd = ["cp", "-a", src, target]
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
if result.returncode != 0:
|
||||
raise RuntimeError(f"cp command failed: {result.stderr}")
|
||||
|
||||
@@ -30,6 +30,45 @@ def download(url, output):
|
||||
last_percent = percent
|
||||
|
||||
try:
|
||||
if url.startswith("file://"):
|
||||
file_path = url[7:]
|
||||
if not os.path.exists(file_path):
|
||||
raise Exception("File not found: " + file_path)
|
||||
|
||||
total_size = os.path.getsize(file_path)
|
||||
if total_size <= 0:
|
||||
print("Copying...")
|
||||
with open(file_path, "rb") as src, open(output, "wb") as dst:
|
||||
while True:
|
||||
chunk = src.read(8192)
|
||||
if not chunk:
|
||||
break
|
||||
dst.write(chunk)
|
||||
print("Download completed: " + output)
|
||||
return output
|
||||
|
||||
sys.stdout.write("downloading... 0%")
|
||||
sys.stdout.flush()
|
||||
|
||||
with open(file_path, "rb") as src, open(output, "wb") as dst:
|
||||
downloaded = 0
|
||||
block_size = 8192
|
||||
while True:
|
||||
chunk = src.read(block_size)
|
||||
if not chunk:
|
||||
break
|
||||
dst.write(chunk)
|
||||
downloaded += len(chunk)
|
||||
percent = int(downloaded * 100 / total_size)
|
||||
report_progress(percent)
|
||||
|
||||
if last_percent != 100:
|
||||
report_progress(100)
|
||||
|
||||
sys.stdout.write("\n")
|
||||
print("Download completed: " + output)
|
||||
return output
|
||||
|
||||
req = urllib.request.Request(url, method="GET")
|
||||
req.add_header(
|
||||
"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
||||
|
||||
@@ -7,6 +7,8 @@ from lib.make import *
|
||||
version("0.10.9")
|
||||
source_url("https://github.com/sisungo/airup/archive/refs/tags/v0.10.9.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
shutil.copy2("../../build_manifest.json", "build_manifest.json")
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "1.2.16.1"
|
||||
|
||||
version(upstream_version)
|
||||
source_url("https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('alsa-lib')}/lib",
|
||||
f"--includedir={get_prefix('alsa-lib-dev')}/include",
|
||||
"--enable-symbolic-functions",
|
||||
f"--with-configdir={get_prefix('alsa-lib')}/share/alsa",
|
||||
f"--with-plugindir=/lib/{arch.get_target()}/alsa/plugins",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_alsa_lib(composer):
|
||||
composer.makedir("lib")
|
||||
for i in [
|
||||
"libasound.so",
|
||||
"libasound.so.2",
|
||||
"libasound.so.2.0.0",
|
||||
"libatopology.so",
|
||||
"libatopology.so.2",
|
||||
"libatopology.so.2.0.0",
|
||||
]:
|
||||
composer.addfile(f"lib/{i}", f"lib/{i}")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/alsa", "share/alsa")
|
||||
|
||||
|
||||
package("alsa-lib")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_alsa_lib)
|
||||
|
||||
package("alsa-lib-dev")
|
||||
dep("alsa-lib (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -6,6 +6,10 @@ from lib.make import *
|
||||
version("2026.4.26")
|
||||
source_url("https://github.com/onetrueawk/awk/archive/refs/tags/20260426.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("bison")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
|
||||
@@ -6,13 +6,28 @@ from lib.make import *
|
||||
version("5.1.0")
|
||||
source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
|
||||
def _fix_pc(name, prefix):
|
||||
filepath = f"lib/pkgconfig/{name}.pc"
|
||||
with open(filepath, "r") as f:
|
||||
content = f.read()
|
||||
new_content = content.replace("prefix=/", f"prefix={prefix}").replace("libdir=${prefix}/usr/lib", "libdir=${prefix}/lib")
|
||||
with open(filepath, "w") as f:
|
||||
f.write(new_content)
|
||||
|
||||
def build():
|
||||
cpp.cmake(["-DBUILD_SHARED_LIBS=1"])
|
||||
cpp.cmake(
|
||||
[
|
||||
"-DBUILD_SHARED_LIBS=1",
|
||||
"-DCMAKE_INSTALL_PREFIX=/",
|
||||
f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('aws-lc-dev')}/include",
|
||||
]
|
||||
)
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
_fix_pc("libssl", get_prefix("aws-lc-libssl"))
|
||||
_fix_pc("libcrypto", get_prefix("aws-lc-libcrypto"))
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
version("7.0.3")
|
||||
source_url("https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
predefined_build_type = "GDH"
|
||||
if "-linux" in arch.get_target():
|
||||
predefined_build_type = "GNU"
|
||||
cpp.configure(
|
||||
[
|
||||
"--disable-nls",
|
||||
"--opt=3",
|
||||
f"--predefined-build-type={predefined_build_type}",
|
||||
f"--prefix={get_prefix('bc')}",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("bc")
|
||||
dep("semi-libc @same-arch")
|
||||
provide("dc")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -0,0 +1,36 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.7.91")
|
||||
source_url("https://alpha.gnu.org/gnu/bison/bison-3.7.91.tar.xz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("gnu-m4")
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(["--enable-relocatable"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_bison(composer):
|
||||
composer.add_dir("bin", "bin")
|
||||
composer.add_dir("lib", "lib")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/aclocal", "share/aclocal")
|
||||
composer.add_dir("share/bison", "share/bison")
|
||||
|
||||
|
||||
package("bison")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("gnu-m4")
|
||||
on_pack(pack_bison)
|
||||
link("bin/bison", "/bin/bison")
|
||||
link("bin/yacc", "/bin/yacc", default=False)
|
||||
@@ -8,6 +8,10 @@ VERSION = "2026.6.19"
|
||||
version(VERSION)
|
||||
source_url("https://www.crufty.net/ftp/pub/sjg/bmake-20260619.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("bc")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.2.0")
|
||||
source_url("https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libbrotli")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("brotli")
|
||||
dep("libbrotli (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("libbrotli-dev")
|
||||
dep("libbrotli (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2.0")
|
||||
source_url("https://www.invisible-island.net/archives/byacc/byacc-2.0.tgz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure([f"--prefix={get_prefix('byacc')}", "--enable-btyacc"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
os.rename("bin/yacc", "bin/byacc")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("byacc")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin", "lib", "dev"])
|
||||
link("bin/byacc", "/bin/yacc")
|
||||
@@ -6,14 +6,28 @@ from lib.make import *
|
||||
|
||||
upstream_version = "1.0.8"
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
version(f"{upstream_version}")
|
||||
source_url(f"https://sourceware.org/pub/bzip2/bzip2-{upstream_version}.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make(["-f", "Makefile-libbz2_so"])
|
||||
cpp.make_install(["PREFIX=../cpp_install"], chdir=False)
|
||||
shutil.copy2(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so")
|
||||
makevars = [f"CC={os.environ.get('CC', 'cc')}"]
|
||||
cpp.make(["-f", "Makefile-libbz2_so"] + makevars)
|
||||
try:
|
||||
shutil.rmtree("../cpp_install")
|
||||
except Exception:
|
||||
pass
|
||||
cpp.make_install(["PREFIX=../cpp_install"] + makevars, chdir=False)
|
||||
shutil.copy2(
|
||||
f"libbz2.so.{upstream_version}",
|
||||
f"../cpp_install/lib/libbz2.so.{upstream_version}",
|
||||
)
|
||||
os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so.1.0")
|
||||
os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so.1")
|
||||
os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so")
|
||||
os.chdir("../cpp_install")
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.34.6")
|
||||
source_url(
|
||||
"https://github.com/c-ares/c-ares/releases/download/v1.34.6/c-ares-1.34.6.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libcares')}/lib",
|
||||
f"--includedir={get_prefix('libcares-dev')}/include",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libcares")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libcares-dev")
|
||||
dep("libcares (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("2026.7.4")
|
||||
source_url(
|
||||
"https://gitea.semilabs.org/semios/ca-certificates/releases/download/v2026.07.04/ca-certificates-2026.07.04.tar"
|
||||
)
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
for i in os.listdir("."):
|
||||
link(f"share/ca-certificates/{i}", f"/share/ca-certificates/{i}")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("share")
|
||||
composer.add_dir(".", "share/ca-certificates")
|
||||
|
||||
|
||||
package("ca-certificates")
|
||||
arch_any()
|
||||
on_pack(pack)
|
||||
@@ -0,0 +1,18 @@
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
version("0.1.0")
|
||||
source_url("https://gitea.semilabs.org/semios/certutil/archive/v0.1.0.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("certutil")
|
||||
dep("semi-libc @same-arch")
|
||||
rust.use_auto_pack(["bin"])
|
||||
@@ -5,6 +5,8 @@ version("0.9.0")
|
||||
source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.9.0.tar.gz")
|
||||
block_hook("autolink")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build(["--features", "unix"])
|
||||
|
||||
@@ -4,6 +4,8 @@ from lib.make import *
|
||||
version("0.5.0")
|
||||
source_url("https://github.com/uutils/diffutils/archive/refs/tags/v0.5.0.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import subprocess
|
||||
|
||||
from lib import cpp
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
VERSION = "5.48"
|
||||
@@ -8,6 +8,13 @@ VERSION = "5.48"
|
||||
version(VERSION)
|
||||
source_git("https://github.com/file/file.git", "FILE5_48")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libz-dev @{arch.get_target()}")
|
||||
builddep(f"libzstd-dev @{arch.get_target()}")
|
||||
builddep(f"liblzma-dev @{arch.get_target()}")
|
||||
builddep(f"libbzip2-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["autoreconf", "-fiv"], check=True)
|
||||
@@ -32,6 +39,10 @@ on_pack(pack_magic_db)
|
||||
package("libmagic")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("file-magic-db (same-version) @any")
|
||||
dep("libz @same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
dep("liblzma @same-arch")
|
||||
dep("libbzip2 @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libmagic-dev")
|
||||
|
||||
@@ -4,6 +4,8 @@ from lib.make import *
|
||||
version("0.9.0")
|
||||
source_url("https://github.com/uutils/findutils/archive/refs/tags/0.9.0.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2.6.4")
|
||||
source_url("https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("m4")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
f"--prefix={get_prefix('flex')}",
|
||||
"--disable-nls",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("flex")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin", "lib", "dev"])
|
||||
@@ -8,6 +8,9 @@ source_url(
|
||||
"https://github.com/sabotage-linux/gettext-tiny/releases/download/v0.3.3/gettext-tiny-0.3.3.tar.xz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make(["LIBINTL=musl"])
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import subprocess
|
||||
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2.55.0")
|
||||
source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libintl-dev @{arch.get_target()}")
|
||||
builddep(f"libz-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=",
|
||||
"--with-gitconfig=/var/config/git/config.ini",
|
||||
"--with-gitattributes=/var/config/git/attributes.txt",
|
||||
]
|
||||
)
|
||||
cpp.make(["RUNTIME_PREFIX=YesPlease"])
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_git(composer):
|
||||
composer.add_dir("bin", "bin")
|
||||
composer.add_dir("libexec", "libexec")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/git-core", "share/git-core")
|
||||
composer.add_dir("share/gitweb", "share/gitweb")
|
||||
composer.add_dir("share/perl5", "share/perl5")
|
||||
|
||||
|
||||
package("git")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libz @same-arch")
|
||||
on_pack(pack_git)
|
||||
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
|
||||
from lib import cpp, arch
|
||||
from lib.make import *
|
||||
|
||||
version("1.4.21")
|
||||
source_url("https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"linux-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[f"--prefix={get_prefix('gnu-m4')}", "--enable-changeword", "--disable-nls"]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
os.rename("bin/m4", "bin/gnu-m4")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("gnu-m4")
|
||||
provide("m4")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
link("bin/gnu-m4", "/bin/m4")
|
||||
@@ -4,6 +4,9 @@ from lib.make import *
|
||||
version("4.4.1")
|
||||
source_url("https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure([f"--prefix={get_prefix('gnu-make')}"])
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("4.10")
|
||||
source_url("https://ftp.gnu.org/gnu/sed/sed-4.10.tar.gz")
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('gnu-sed')}/bin",
|
||||
"--disable-i18n",
|
||||
"--disable-nls",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
os.rename("bin/sed", "bin/gsed")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("gnu-sed")
|
||||
provide("sed")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
link("bin/gsed", "/bin/gsed")
|
||||
link("bin/gsed", "/bin/sed")
|
||||
@@ -0,0 +1,32 @@
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("15.1.2")
|
||||
source_url("https://gitea.semilabs.org/semios/grep/archive/v15.1.2.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep(f"libpcre2-dev @{arch.get_target()}")
|
||||
builddep("pcre2-tools")
|
||||
builddep(f"libbzip2-dev @{arch.get_target()}")
|
||||
builddep(f"libz-ng-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["./build.sh"], check=True)
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_grep(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("grep", "bin/grep")
|
||||
|
||||
|
||||
package("grep")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libpcre2 @same-arch")
|
||||
on_pack(pack_grep)
|
||||
link("bin/grep", "/bin/egrep")
|
||||
link("bin/grep", "/bin/fgrep")
|
||||
@@ -6,6 +6,9 @@ from lib.make import *
|
||||
version("2026.4.22")
|
||||
source_url("https://data.iana.org/time-zones/releases/tzdb-2026b.tar.lz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
|
||||
@@ -8,6 +8,9 @@ source_url(
|
||||
"https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c++")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
os.chdir("source")
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("7.1.0")
|
||||
source_git("https://git.kernel.org/pub/scm/network/iproute2/iproute2.git", "v7.1.0")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("git")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure()
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_iproute2(composer):
|
||||
composer.makedirs("lib/iproute2")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("sbin", "bin")
|
||||
composer.add_dir("share/iproute2", "share/iproute2")
|
||||
composer.add_dir("lib/tc", "lib/iproute2/tc")
|
||||
|
||||
|
||||
package("iproute2")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_iproute2)
|
||||
|
||||
package("iproute2-dev")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,23 @@
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libncurses-dev @{arch.get_target()}")
|
||||
|
||||
version("704")
|
||||
source_url("https://www.greenwoodsoftware.com/less/less-704.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure([f"--prefix={get_prefix('less')}", "--with-regex=posix"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("less")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libncurses @same-arch")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -6,6 +6,14 @@ source_url(
|
||||
"https://github.com/libarchive/libarchive/releases/download/v3.8.7/libarchive-3.8.7.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"aws-lc-dev @{arch.get_target()}")
|
||||
builddep(f"libz-ng-dev @{arch.get_target()}")
|
||||
builddep(f"libzstd-dev @{arch.get_target()}")
|
||||
builddep(f"libbzip2-dev @{arch.get_target()}")
|
||||
builddep(f"liblzma-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from lib import cpp
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.6.0")
|
||||
@@ -6,6 +6,10 @@ source_url(
|
||||
"https://github.com/libffi/libffi/releases/download/v3.6.0/libffi-3.6.0.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"linux-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib import arch
|
||||
from lib.make import *
|
||||
|
||||
version("0.2.0")
|
||||
source_url("https://gitea.semilabs.org/semios/libgcc-compat/archive/v0.2.0.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep(f"libunwind-dev @{arch.get_target()}")
|
||||
builddep(f"linux-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["./build.sh"], check=True)
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("lib")
|
||||
composer.addfile("libgcc_s.so.1", "lib/libgcc_s.so.1")
|
||||
composer.addfile("libatomic.so.1", "lib/libatomic.so.1")
|
||||
|
||||
|
||||
package("libgcc-compat")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libunwind @same-arch")
|
||||
on_pack(pack)
|
||||
@@ -0,0 +1,31 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.6.1")
|
||||
source_url("https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libopus')}/lib",
|
||||
f"--includedir={get_prefix('libopus-dev')}/include",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libopus")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libopus-dev")
|
||||
dep("libopus (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,41 @@
|
||||
from lib import cpp, arch
|
||||
from lib.make import *
|
||||
|
||||
version("0.22.0")
|
||||
source_url(
|
||||
"https://github.com/rockdaboot/libpsl/releases/download/0.22.0/libpsl-0.22.0.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libicu4c-dev @{arch.get_target()}")
|
||||
builddep("pkgconf")
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libpsl')}/lib",
|
||||
f"--includedir={get_prefix('libpsl-dev')}/include",
|
||||
"--disable-nls",
|
||||
"--enable-runtime=libicu",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libpsl")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libicu4c @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libpsl-tools")
|
||||
dep("libpsl (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("libpsl-dev")
|
||||
dep("libpsl (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -5,13 +5,19 @@ import lib.arch as arch
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "6.18.35"
|
||||
upstream_version = "6.18.38"
|
||||
|
||||
version(f"{upstream_version}")
|
||||
source_url(
|
||||
f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("libncurses-dev")
|
||||
builddep("aws-lc-dev")
|
||||
builddep("aws-lc-tools")
|
||||
|
||||
|
||||
def get_arch():
|
||||
return arch.get_target().split("-")[0].replace("aarch64", "arm64")
|
||||
|
||||
+302
-273
@@ -1,13 +1,161 @@
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
upstream_version = "22.1.8"
|
||||
[upstream_major, upstream_minor, upstream_rev] = upstream_version.split(".")
|
||||
|
||||
# Begin of file lists
|
||||
LLVM_TOOLS = [
|
||||
"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",
|
||||
]
|
||||
LLDB_BINARIES = [
|
||||
"lldb",
|
||||
"lldb-argdumper",
|
||||
"lldb-dap",
|
||||
"lldb-instr",
|
||||
"lldb-mcp",
|
||||
"lldb-server",
|
||||
"yaml2macho-core",
|
||||
]
|
||||
LLD_BINARIES = ["lld", "lld-link", "ld64.lld", "wasm-ld", "wrapper://ld.lld~ld.lld"]
|
||||
CLANG_BINARIES = [
|
||||
f"clang-{upstream_major}~llvm-clang",
|
||||
"wrapper://clang~clang",
|
||||
"wrapper://clang++~clang++",
|
||||
f"wrapper://clang~clang-{upstream_major}",
|
||||
"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++",
|
||||
"libexec/analyze-cc",
|
||||
"libexec/c++-analyzer",
|
||||
"libexec/ccc-analyzer",
|
||||
"libexec/intercept-c++",
|
||||
"libexec/intercept-cc",
|
||||
]
|
||||
# End of file lists
|
||||
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib import arch
|
||||
from lib.make import *
|
||||
|
||||
version("22.1.7")
|
||||
version(upstream_version)
|
||||
source_url(
|
||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.7/llvm-project-22.1.7.src.tar.xz"
|
||||
f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{upstream_version}/llvm-project-{upstream_version}.src.tar.xz"
|
||||
)
|
||||
|
||||
|
||||
@@ -16,6 +164,7 @@ def llvm_host_triple():
|
||||
|
||||
|
||||
def build():
|
||||
os.environ["CXXFLAGS"] = os.environ.get("CXXFLAGS", "") + " --rtlib=compiler-rt"
|
||||
subprocess.run(
|
||||
[
|
||||
"cmake",
|
||||
@@ -37,6 +186,7 @@ def build():
|
||||
"-DLLVM_BUILD_LLVM_DYLIB=ON",
|
||||
"-DLLVM_ENABLE_LIBCXX=ON",
|
||||
"-DLLVM_ENABLE_LIBEDIT=ON",
|
||||
"-DLLVM_ENABLE_LLD=ON",
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON",
|
||||
"-DLIBCXX_HAS_MUSL_LIBC=ON",
|
||||
"-DCOMPILER_RT_BUILD_GWP_ASAN=OFF",
|
||||
@@ -52,315 +202,194 @@ def build():
|
||||
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}")
|
||||
# Begin of helper functions
|
||||
package_dir = os.getcwd()
|
||||
|
||||
|
||||
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)
|
||||
def install_wrapper(composer, name: str, dst: str):
|
||||
composer.addfile(f"{package_dir}/wrapper/{name}.wrapper", dst)
|
||||
with open(f"{composer.workdir}/bundle/{dst}", "r") as f:
|
||||
s = f.read()
|
||||
s = s.replace("LLVM_VERSION=", f"LLVM_VERSION={upstream_version}").replace(
|
||||
"ARCHITECTURE=", "ARCHITECTURE=" + arch.get_target()
|
||||
)
|
||||
with open(f"{composer.workdir}/bundle/{dst}", "w") as f:
|
||||
f.write(s)
|
||||
os.chmod(f"{composer.workdir}/bundle/{dst}", 0o755)
|
||||
|
||||
|
||||
def auto_pack_llvm_runtime(composer, prefix, dev):
|
||||
composer.makedirs("lib")
|
||||
parent_dir = f"./lib/{llvm_host_triple()}"
|
||||
for i in os.listdir(parent_dir):
|
||||
fullpath = f"{parent_dir}/{i}"
|
||||
if i.split(".")[0] != prefix:
|
||||
continue
|
||||
if dev:
|
||||
if ".so" in i:
|
||||
continue
|
||||
else:
|
||||
if not ".so" in i:
|
||||
continue
|
||||
composer.addfile(fullpath, f"lib/{i}")
|
||||
if not dev:
|
||||
return
|
||||
|
||||
|
||||
def auto_pack_llvm_runtime_dev(composer, condition):
|
||||
composer.makedir("include")
|
||||
parent_include = f"./usr/include"
|
||||
for i in condition:
|
||||
if i.startswith("lib:"):
|
||||
auto_pack_llvm_runtime(composer, i.replace("lib:", ""), True)
|
||||
continue
|
||||
i = i.replace("include:", "")
|
||||
for file in glob.glob(f"{parent_include}/{i}"):
|
||||
name = file.replace(f"{parent_include}/", "")
|
||||
if "/" in name:
|
||||
composer.makedirs(f"include/{os.path.dirname(name)}")
|
||||
if os.path.isdir(file):
|
||||
composer.add_dir(file, f"include/{name}")
|
||||
else:
|
||||
composer.addfile(file, f"include/{name}")
|
||||
|
||||
|
||||
def use_llvm_runtime_auto_pack(prefix: str):
|
||||
on_pack(lambda composer: auto_pack_llvm_runtime(composer, prefix, False))
|
||||
|
||||
|
||||
def use_llvm_runtime_dev_auto_pack(des: list[str]):
|
||||
on_pack(lambda composer: auto_pack_llvm_runtime_dev(composer, des))
|
||||
|
||||
|
||||
def auto_pack_llvm_libs(composer, prefixes: list[str]):
|
||||
composer.makedirs("lib")
|
||||
parent_dir = f"./lib/"
|
||||
for i in os.listdir(parent_dir):
|
||||
fullpath = f"{parent_dir}/{i}"
|
||||
if not i.split(".")[0] in prefixes:
|
||||
continue
|
||||
if not ".so" in i:
|
||||
continue
|
||||
composer.addfile(fullpath, f"lib/{i}")
|
||||
|
||||
|
||||
def use_llvm_libs_auto_pack(prefixes: list[str]):
|
||||
on_pack(lambda composer: auto_pack_llvm_libs(composer, prefixes))
|
||||
|
||||
|
||||
def auto_pack_bin(composer, conditions: list[str]):
|
||||
for i in conditions:
|
||||
prefix = "bin"
|
||||
if i.startswith("libexec/"):
|
||||
i = i.replace("libexec/", "")
|
||||
prefix = "libexec"
|
||||
composer.makedirs(prefix)
|
||||
src = i
|
||||
dst = f"{prefix}/{i}"
|
||||
if len(i.split("~")) == 2:
|
||||
src = i.split("~")[0]
|
||||
dst = f"bin/{i.split('~')[1]}"
|
||||
if src.startswith("wrapper://"):
|
||||
src = src.replace("wrapper://", "")
|
||||
if len(i.split("~")) == 1:
|
||||
dst = f"bin/{src}.wrapper"
|
||||
install_wrapper(composer, src, dst)
|
||||
continue
|
||||
if os.path.exists(f"{prefix}/{src}"):
|
||||
src = f"{prefix}/{src}"
|
||||
elif os.path.exists(f"usr/{prefix}/{src}"):
|
||||
src = f"usr/{prefix}/{src}"
|
||||
composer.addfile(src, dst)
|
||||
|
||||
|
||||
def use_bin_auto_pack(conditions: list[str]):
|
||||
on_pack(lambda composer: auto_pack_bin(composer, conditions))
|
||||
|
||||
|
||||
# End of helper functions
|
||||
|
||||
# Begin of packages
|
||||
|
||||
package("libunwind")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libunwind.so.1.0", "libunwind.so.1", "libunwind.so"]
|
||||
)
|
||||
)
|
||||
dep("semi-libc @same-arch")
|
||||
use_llvm_runtime_auto_pack("libunwind")
|
||||
|
||||
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",
|
||||
],
|
||||
)
|
||||
dep("libunwind (same)")
|
||||
use_llvm_runtime_dev_auto_pack(
|
||||
["lib:libunwind", "include:mach-o", "include:*unwind*.h"]
|
||||
)
|
||||
|
||||
package("libcxxabi")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libc++abi.so", "libc++abi.so.1", "libc++abi.so.1.0"]
|
||||
)
|
||||
)
|
||||
dep("libunwind (same)")
|
||||
use_llvm_runtime_auto_pack("libc++abi")
|
||||
|
||||
package("libcxxabi-dev")
|
||||
on_pack(lambda composer: pack_runtime_dev(composer, ["lib/libc++abi.a"]))
|
||||
dep("libcxxabi (same)")
|
||||
use_llvm_runtime_dev_auto_pack(["lib:libc++abi"])
|
||||
|
||||
|
||||
package("libcxx")
|
||||
on_pack(
|
||||
lambda composer: pack_runtime_lib(
|
||||
composer, ["libc++.so", "libc++.so.1", "libc++.so.1.0"]
|
||||
)
|
||||
)
|
||||
dep("libcxxabi (same)")
|
||||
use_llvm_runtime_auto_pack("libc++")
|
||||
|
||||
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",
|
||||
dep("libcxx (same)")
|
||||
use_llvm_runtime_dev_auto_pack(
|
||||
[
|
||||
"lib:libc++",
|
||||
"lib:libc++experimental",
|
||||
f"include:{llvm_host_triple()}/c++/v1/__config_site",
|
||||
"include:c++/v1",
|
||||
]
|
||||
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}")
|
||||
|
||||
dep("libcxx @same-arch")
|
||||
use_llvm_libs_auto_pack(["libLLVM", "libLTO", "libRemarks"])
|
||||
|
||||
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}")
|
||||
dep("libllvm (same)")
|
||||
use_bin_auto_pack(LLVM_TOOLS)
|
||||
for i in ["strip", "ar", "ranlib", "readelf", "objcopy", "objdump", "strings", "nm"]:
|
||||
link(f"bin/llvm-{i}", f"/bin/{i}")
|
||||
|
||||
|
||||
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}")
|
||||
|
||||
dep("libcxx @same-arch")
|
||||
use_bin_auto_pack(LLD_BINARIES)
|
||||
link("bin/ld.lld", "/bin/ld")
|
||||
|
||||
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}")
|
||||
dep("libcxx @same-arch")
|
||||
use_llvm_libs_auto_pack(["liblldb", "liblldbIntelFeatures"])
|
||||
|
||||
|
||||
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}")
|
||||
dep("libcxx @same-arch")
|
||||
dep("liblldb (same)")
|
||||
use_bin_auto_pack(LLDB_BINARIES)
|
||||
|
||||
|
||||
package("libclang")
|
||||
on_pack(pack_libclang)
|
||||
dep("libcxx @same-arch")
|
||||
dep("libllvm (same)")
|
||||
use_llvm_libs_auto_pack(["libclang", "libclang-cpp"])
|
||||
|
||||
|
||||
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}")
|
||||
auto_pack_bin(composer, CLANG_BINARIES)
|
||||
composer.makedirs(f"lib/clang/{upstream_major}/lib")
|
||||
composer.add_dir(
|
||||
f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}",
|
||||
f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}",
|
||||
)
|
||||
|
||||
|
||||
package("clang")
|
||||
dep("libclang (same)")
|
||||
on_pack(pack_clang)
|
||||
|
||||
# End of packages
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
LLVM_VERSION=
|
||||
ARCHITECTURE=
|
||||
|
||||
CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang
|
||||
|
||||
exec ${CLANG} \
|
||||
-Wno-unused-command-line-argument \
|
||||
-isystem /lib/${ARCHITECTURE}/include/c++/v1 \
|
||||
-isystem /lib/${ARCHITECTURE}/include \
|
||||
-stdlib=libc++ \
|
||||
-rtlib=compiler-rt \
|
||||
-B /lib/${ARCHITECTURE} \
|
||||
-lc++ \
|
||||
-Wunused-command-line-argument \
|
||||
"$@"
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
LLVM_VERSION=
|
||||
ARCHITECTURE=
|
||||
|
||||
CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang
|
||||
|
||||
exec ${CLANG} \
|
||||
-Wno-unused-command-line-argument \
|
||||
-isystem /lib/${ARCHITECTURE}/include \
|
||||
-rtlib=compiler-rt \
|
||||
-B /lib/${ARCHITECTURE} \
|
||||
-Wunused-command-line-argument \
|
||||
"$@"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
LLVM_VERSION=
|
||||
ARCHITECTURE=
|
||||
|
||||
LLD=$(packie print package.prefix."lld (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/lld
|
||||
|
||||
exec ${LLD} -flavor gnu -L/lib/${ARCHITECTURE} "$@"
|
||||
@@ -1,12 +1,16 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib import cpp
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.14.6")
|
||||
source_url("https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libz-ng-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure()
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("1.59.2")
|
||||
source_git("https://github.com/mirabilos/mksh-cvs2git.git", "mksh-R59c")
|
||||
source_url(
|
||||
"https://github.com/mirabilos/mksh-cvs2git/archive/refs/tags/mksh-R59c.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("gnu-sed")
|
||||
|
||||
|
||||
def build():
|
||||
os.system("sh ./Build.sh")
|
||||
subprocess.run(["sh", "./Build.sh"], check=True)
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
@@ -6,6 +6,9 @@ from lib.make import *
|
||||
version("6.6")
|
||||
source_url("https://invisible-island.net/archives/ncurses/ncurses-6.6.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -6,6 +6,9 @@ from lib.make import *
|
||||
version("19")
|
||||
source_url("https://github.com/aligrudi/neatvi/archive/refs/tags/19.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make([f"CC={os.environ['CC']}"])
|
||||
|
||||
@@ -7,6 +7,9 @@ from lib.make import *
|
||||
version("5.3")
|
||||
source_url("https://github.com/kyx0r/nextvi/archive/refs/tags/5.3.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
os.environ["PREFIX"] = "/"
|
||||
|
||||
@@ -13,7 +13,6 @@ def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
@@ -5,9 +5,12 @@ from lib.make import *
|
||||
version("1.13.2")
|
||||
source_url("https://github.com/ninja-build/ninja/archive/refs/tags/v1.13.2.tar.gz")
|
||||
|
||||
builddep("shortcut/c++")
|
||||
builddep("sed")
|
||||
|
||||
|
||||
def build():
|
||||
os.system("./configure.py --bootstrap")
|
||||
os.system("python3 ./configure.py --bootstrap")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
@@ -4,6 +4,11 @@ from lib.make import *
|
||||
version("10.3.1")
|
||||
source_url("https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.3p1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libz-ng-dev @{arch.get_target()}")
|
||||
builddep(f"aws-lc-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("15.1.1")
|
||||
source_url("https://gitea.semilabs.org/semios/patch/archive/v15.1.1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["./build.sh"], check=True)
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_patch(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("patch", "bin/patch")
|
||||
|
||||
|
||||
package("patch")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_patch)
|
||||
@@ -0,0 +1,38 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("10.47")
|
||||
source_url(
|
||||
"https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/pcre2-10.47.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libpcre2')}/lib",
|
||||
f"--bindir={get_prefix('pcre2-tools')}/bin",
|
||||
"--enable-jit",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libpcre2")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("pcre2-tools")
|
||||
dep("libpcre2 (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("libpcre2-dev")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,75 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "5.42.2"
|
||||
|
||||
version(upstream_version)
|
||||
source_url("https://www.cpan.org/src/5.0/perl-5.42.2.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(
|
||||
[
|
||||
"./Configure",
|
||||
"-de",
|
||||
f"-Dcc={os.environ.get('CC', 'cc')}",
|
||||
f"-Doptimize={os.environ.get('CFLAGS', '')}",
|
||||
"-Dusethreads",
|
||||
"-Duseshrplib",
|
||||
"-Dprefix=/",
|
||||
"-Dvendorprefix=/",
|
||||
f"-Dprivlib={get_prefix('libperl')}/share/core_perl",
|
||||
f"-Darchlib={get_prefix('libperl')}/lib/core_perl",
|
||||
f"-Dsitelib=/lib/{arch.get_target()}/perl5/site_perl",
|
||||
f"-Dsitearch=/lib/{arch.get_target()}/perl5/site_arch",
|
||||
f"-Dvendorlib=/lib/{arch.get_target()}/perl5/vendor_perl",
|
||||
f"-Dvendorarch=/lib/{arch.get_target()}/perl5/vendor_arch",
|
||||
f"-Dscriptdir={get_prefix('perl')}/bin/core_perl",
|
||||
"-Dsitescript=/bin/site_perl",
|
||||
"-Dvendorscript=/bin/vendor_perl",
|
||||
"-Dinc_version_list=none",
|
||||
"-Dman1dir=/share/man/man1",
|
||||
"-Dman3dir=/share/man/man3",
|
||||
"-Dman1ext=1perl",
|
||||
"-Dman3ext=3perl",
|
||||
f"-Dlddlflags=-shared {os.environ.get('LDFLAGS', '')}",
|
||||
f"-Dldflags={os.environ.get('LDFLAGS', '')}",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_libperl(composer):
|
||||
composer.makedir("lib")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("lib/core_perl", "lib/core_perl")
|
||||
composer.add_dir("share/core_perl", "share/core_perl")
|
||||
|
||||
|
||||
package("libperl")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_libperl)
|
||||
|
||||
|
||||
def pack_perl(composer):
|
||||
composer.add_dir("bin", "bin")
|
||||
|
||||
|
||||
package("perl")
|
||||
dep("libperl (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
link("bin/perl", "/bin/perl")
|
||||
link(f"bin/perl{upstream_version}", f"/bin/perl{upstream_version}")
|
||||
@@ -5,6 +5,9 @@ from lib.make import *
|
||||
version("2.5.1")
|
||||
source_url("https://distfiles.ariadne.space/pkgconf/pkgconf-2.5.1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
@@ -31,6 +34,7 @@ dep("semi-libc @same-arch")
|
||||
package("pkgconf")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libpkgconf (same)")
|
||||
link("bin/pkgconf", "/bin/pkg-config")
|
||||
|
||||
package("libpkgconf-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
@@ -15,6 +14,19 @@ source_url(
|
||||
f"https://www.python.org/ftp/python/{VERSION_FULL}/Python-{VERSION_FULL}.tar.xz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"liblzma-dev @{arch.get_target()}")
|
||||
builddep(f"libzstd-dev @{arch.get_target()}")
|
||||
builddep(f"libz-ng-dev @{arch.get_target()}")
|
||||
builddep(f"aws-lc-dev @{arch.get_target()}")
|
||||
builddep(f"libexpat-dev @{arch.get_target()}")
|
||||
builddep(f"libsqlite-dev @{arch.get_target()}")
|
||||
builddep(f"libncurses-dev @{arch.get_target()}")
|
||||
builddep(f"libbzip2-dev @{arch.get_target()}")
|
||||
builddep(f"libffi-dev @{arch.get_target()}")
|
||||
builddep("pkgconf")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.4.6")
|
||||
source_url("https://github.com/rhash/RHash/archive/refs/tags/v1.4.6.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('rhash-tools')}/bin",
|
||||
f"--libdir={get_prefix('librhash')}/lib",
|
||||
"--disable-gettext",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("librhash")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("rhash-tools")
|
||||
dep("librhash (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("librhash-dev")
|
||||
dep("librhash (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -4,6 +4,8 @@ from lib.make import *
|
||||
version("15.1.0")
|
||||
source_url("https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.1.0.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
from lib import rust
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("0.1.1")
|
||||
source_url("https://github.com/uutils/sed/releases/download/0.1.1/source.tar.gz")
|
||||
version("15.1.1")
|
||||
source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep(f"libpcre2-dev @{arch.get_target()}")
|
||||
builddep("pcre2-tools")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
subprocess.run(["./build.sh"])
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_sed(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("sed", "bin/sed")
|
||||
|
||||
|
||||
package("sed")
|
||||
dep("semi-libc @same-arch")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("libpcre2 @same-arch")
|
||||
on_pack(pack_sed)
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import lib.arch as arch
|
||||
from lib.cpp import *
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.2.6+1")
|
||||
source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz")
|
||||
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
version("1.2.6")
|
||||
source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6.tar.gz")
|
||||
|
||||
def build():
|
||||
configure(["--prefix=/"])
|
||||
make()
|
||||
make_install()
|
||||
cpp.configure(["--prefix=/"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
@@ -20,9 +23,10 @@ def musl_target():
|
||||
|
||||
|
||||
package("semi-libc")
|
||||
use_auto_pack(["lib"])
|
||||
cpp.use_auto_pack(["lib"])
|
||||
link("lib/libc.so", f"/lib/ld-musl-{musl_target()}.so.1")
|
||||
link("lib/libc.so", "/bin/ldd")
|
||||
|
||||
package("semi-libc-dev")
|
||||
use_auto_pack(["dev"])
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("semi-libc (same)")
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import os
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.53.2")
|
||||
source_url("https://sqlite.org/2026/sqlite-autoconf-3530200.tar.gz")
|
||||
|
||||
builddep("shortcut/autotools")
|
||||
builddep("shortcut/c")
|
||||
builddep("linenoise-dev")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "9.2.782"
|
||||
|
||||
version(upstream_version)
|
||||
source_url("https://github.com/vim/vim/archive/refs/tags/v9.2.0782.tar.gz")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libncurses-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('vim')}/bin",
|
||||
"--datarootdir=/share",
|
||||
f"--datadir={get_prefix('vim-data')}/share",
|
||||
"--enable-terminal",
|
||||
"--enable-autoservername",
|
||||
"--enable-multibyte",
|
||||
"--disable-nls",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_data(composer):
|
||||
composer.makedirs("share/vim")
|
||||
composer.add_dir("share/vim/vim92", "share/vim/vim92")
|
||||
|
||||
|
||||
package("vim-data")
|
||||
arch_any()
|
||||
on_pack(pack_data)
|
||||
|
||||
package("vim")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libncurses @same-arch")
|
||||
dep(f"vim-data (={upstream_version}) @any")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
@@ -6,8 +8,12 @@ source_url(
|
||||
"https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
os.environ["FGREP"] = "grep -F"
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
|
||||
@@ -6,6 +6,8 @@ from lib.make import *
|
||||
version("2.3.3")
|
||||
source_url("https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.3.3.tar.gz")
|
||||
|
||||
builddep("shortcut/c++")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.cmake(["-DZLIB_COMPAT=ON", "-DINSTALL_UTILS=ON"])
|
||||
|
||||
@@ -8,6 +8,9 @@ source_url(
|
||||
"https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz"
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"])
|
||||
|
||||
@@ -7,7 +7,9 @@ import typing
|
||||
|
||||
import hooks
|
||||
import lib.arch
|
||||
import lib.atombuild
|
||||
import lib.make
|
||||
import lib.packie
|
||||
import lib.pkgcomposer
|
||||
import lib.sources
|
||||
|
||||
@@ -20,13 +22,19 @@ argparser = argparse.ArgumentParser(
|
||||
argparser.add_argument(
|
||||
"--target", type=str, help="Target architecture to build the package for"
|
||||
)
|
||||
argparser.add_argument("--atombuild", action="store_true", help="Enable Atom Build")
|
||||
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_clean.add_argument("CLEAN_PKGNAME", nargs="*")
|
||||
parser_clean.add_argument("--all", action="store_true")
|
||||
parser_clean.add_argument("--no-artifacts", action="store_true")
|
||||
parser_list = subparsers.add_parser("list")
|
||||
parser_list.add_argument("ITEM", choices=("all", "built", "new"))
|
||||
parser_repo_push = subparsers.add_parser("repo-push")
|
||||
parser_repo_push.add_argument("REPO_DIR")
|
||||
parser_repo_push.add_argument("REPO_PUSH_PKGNAME", nargs="*")
|
||||
args = argparser.parse_args()
|
||||
|
||||
if args.target:
|
||||
@@ -47,7 +55,7 @@ def run_hooks(map, arg: typing.Any = None):
|
||||
os.chdir(current_dir)
|
||||
|
||||
|
||||
def run_build_package(package: str):
|
||||
def cmd_build_package(package: str):
|
||||
try:
|
||||
os.chdir(f"packages/{package}")
|
||||
os.makedirs("target", exist_ok=True)
|
||||
@@ -64,6 +72,9 @@ def run_build_package(package: str):
|
||||
print(f"Architecture {lib.arch.get_target()} is not supported for this package")
|
||||
exit(1)
|
||||
|
||||
if os.environ.get("SEMIOS_PKGBUILD_IN_ATOMIC", "0") == "1":
|
||||
lib.packie.install(lib.make._builddep)
|
||||
|
||||
# Run `pre_build` hooks
|
||||
run_hooks(hooks.pre_build)
|
||||
|
||||
@@ -109,6 +120,7 @@ def run_build_package(package: str):
|
||||
"arch": pkgarch,
|
||||
"dependencies": pkginfo[lib.make._key_dependencies],
|
||||
"provides": pkginfo[lib.make._key_provides],
|
||||
"recommendations": pkginfo[lib.make._key_recommendations],
|
||||
}
|
||||
composer.write_manifest(manifest)
|
||||
composer.write_links(pkginfo[lib.make._key_links])
|
||||
@@ -119,25 +131,37 @@ def run_build_package(package: str):
|
||||
file.write("OK")
|
||||
|
||||
|
||||
def run_clean_package(package: str):
|
||||
try:
|
||||
shutil.rmtree(f"packages/{package}/target")
|
||||
except Exception:
|
||||
pass
|
||||
def cmd_clean_package(package: list[str]):
|
||||
for i in package:
|
||||
targetdir = f"packages/{i}/target"
|
||||
if not os.path.exists(targetdir):
|
||||
continue
|
||||
if args.no_artifacts:
|
||||
for file in os.listdir(targetdir):
|
||||
path = f"{targetdir}/{file}"
|
||||
if file.endswith(".pkg") or file == "build-ok.tag":
|
||||
continue
|
||||
if os.path.isfile(path) or os.path.islink(path):
|
||||
os.remove(path)
|
||||
else:
|
||||
shutil.rmtree(path)
|
||||
|
||||
else:
|
||||
shutil.rmtree(targetdir)
|
||||
|
||||
|
||||
def run_list(item):
|
||||
def do_list(item: str):
|
||||
if item == "all":
|
||||
for i in os.listdir("packages"):
|
||||
if i.startswith("."):
|
||||
continue
|
||||
print(i)
|
||||
yield 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)
|
||||
yield i
|
||||
elif item == "new":
|
||||
for i in os.listdir("packages"):
|
||||
if i.startswith("."):
|
||||
@@ -146,17 +170,87 @@ def run_list(item):
|
||||
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)
|
||||
yield i
|
||||
except Exception:
|
||||
print(i)
|
||||
yield i
|
||||
|
||||
|
||||
def cmd_list(item):
|
||||
for i in do_list(item):
|
||||
print(i)
|
||||
|
||||
|
||||
def cmd_build_atom(pkgname: str):
|
||||
# Declare necessary paths
|
||||
repo_root = os.getcwd()
|
||||
package_dir = f"{repo_root}/packages/{pkgname}"
|
||||
target_dir = f"{package_dir}/target"
|
||||
build_env_root = f"{target_dir}/atombuild_root"
|
||||
|
||||
# Read `pkgbuild.py` of that package
|
||||
lib.make._in_atombuild = True
|
||||
try:
|
||||
os.chdir(package_dir)
|
||||
os.makedirs(target_dir, exist_ok=True)
|
||||
except Exception:
|
||||
print(f"No such package {pkgname}")
|
||||
exit(1)
|
||||
importlib.import_module(f"packages.{pkgname}.pkgbuild")
|
||||
os.chdir(repo_root)
|
||||
|
||||
# Initialize build environment
|
||||
lib.atombuild.prepare_build_env(build_env_root, lib.make._builddep)
|
||||
lib.atombuild.copy_pkgbuild_tree(repo_root, pkgname, build_env_root)
|
||||
lib.atombuild.enter_build_env(
|
||||
build_env_root,
|
||||
["./x", "--target", lib.arch.get_target(), "build", pkgname],
|
||||
chdir="/Atom",
|
||||
)
|
||||
|
||||
# Copy artifacts
|
||||
atom_target_dir = f"{build_env_root}/Atom/packages/{pkgname}/target"
|
||||
try:
|
||||
for i in os.listdir(atom_target_dir):
|
||||
if i.endswith(".pkg"):
|
||||
shutil.copy2(f"{atom_target_dir}/{i}", f"{target_dir}/{i}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Build success
|
||||
with open(f"{target_dir}/build-ok.tag", "wt+") as file:
|
||||
file.write("OK")
|
||||
|
||||
|
||||
def cmd_repo_push(repo_dir: str, pkgname: list[str]):
|
||||
for pkg in pkgname:
|
||||
targetdir = f"packages/{pkg}/target"
|
||||
if not os.path.exists(targetdir):
|
||||
print(f"error: failed to add '{pkg}': package is not built")
|
||||
continue
|
||||
for target_file in os.listdir(targetdir):
|
||||
if not target_file.endswith(".pkg"):
|
||||
continue
|
||||
try:
|
||||
lib.packie.repo_add(repo_dir, f"{targetdir}/{target_file}")
|
||||
except:
|
||||
print(f"error: failed to add '{pkg}': see the output above")
|
||||
|
||||
|
||||
if args.subcommand == "build":
|
||||
run_build_package(args.BUILD_PKGNAME)
|
||||
if args.atombuild:
|
||||
cmd_build_atom(args.BUILD_PKGNAME)
|
||||
else:
|
||||
cmd_build_package(args.BUILD_PKGNAME)
|
||||
elif args.subcommand == "clean":
|
||||
run_clean_package(args.CLEAN_PKGNAME)
|
||||
if args.all:
|
||||
pkgs = os.listdir("packages")
|
||||
else:
|
||||
pkgs = args.CLEAN_PKGNAME
|
||||
cmd_clean_package(pkgs)
|
||||
elif args.subcommand == "list":
|
||||
run_list(args.ITEM)
|
||||
cmd_list(args.ITEM)
|
||||
elif args.subcommand == "repo-push":
|
||||
cmd_repo_push(args.REPO_DIR, args.REPO_PUSH_PKGNAME)
|
||||
else:
|
||||
print("error: no action specified", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user