forked from semios/semios-packages
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f06471aa2 | ||
|
|
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 | ||
|
|
50e41c4c36 | ||
|
|
df1accfb3e | ||
|
|
2fa379760a | ||
|
|
f541a95e49 | ||
|
|
764a7355f0 | ||
|
|
b7d9d9b7d6 | ||
|
|
f55398575a | ||
|
|
2b73f626a1 | ||
|
|
aef0d22091 | ||
|
|
424ff5f6e4 | ||
|
|
3022b06b20 | ||
|
|
dac07d40bb | ||
|
|
f947e27187 | ||
|
|
e0cbdf7a1b | ||
|
|
19659a6b43 | ||
|
|
f7ff9d9742 | ||
|
|
c9627305c2 | ||
|
|
69adb4a599 | ||
|
|
7076f76481 | ||
|
|
83e967f858 | ||
|
|
bc23a14b1a | ||
|
|
5b78c48d8e | ||
|
|
36ceb91590 | ||
|
|
f24ea2d4bf | ||
|
|
b4aa642b52 | ||
|
|
9eb4453f3a | ||
|
|
132c47e419 | ||
|
|
596b055467 | ||
|
|
cc0a73feff | ||
|
|
4b842d43be | ||
|
|
7f1ee4b598 | ||
|
|
15eb054209 | ||
|
|
16a1087785 | ||
|
|
d0186dacb5 | ||
|
|
574f8a5996 | ||
|
|
bb3c5b2741 | ||
|
|
e749a4f1f9 | ||
|
|
10ca4e4931 | ||
|
|
e65eee4bf1 | ||
|
|
7797e7674c | ||
|
|
d9b7a01d01 | ||
|
|
232d8c51d6 | ||
|
|
56998f9787 | ||
|
|
510eca1ab6 | ||
|
|
057330e43f | ||
|
|
0ba3f9a31c | ||
|
|
63c3485f5e | ||
|
|
9835791b4c | ||
|
|
204f650c63 | ||
|
|
e9fe74358f | ||
|
|
962c916ae1 | ||
|
|
248c0bbc66 | ||
|
|
33d3df6dfc | ||
|
|
bffd8e3cdc | ||
|
|
51368da8ff | ||
|
|
f8f18ce917 | ||
|
|
f7242af3a9 | ||
|
|
a3dbac2b67 | ||
|
|
383433a365 | ||
|
|
844b40daaa | ||
|
|
e568b3f8ee | ||
|
|
a1ae78330c | ||
|
|
9ca10cb556 | ||
|
|
95a92ddae2 | ||
|
|
e6dd47ca7f | ||
|
|
2d9586117e | ||
|
|
4df9ac681f | ||
|
|
a47f241569 | ||
|
|
df21a97eb1 | ||
|
|
adea3cc896 | ||
|
|
8fe867991c | ||
|
|
5a36fc628c | ||
|
|
18f624e3c9 | ||
|
|
0cc9a5c843 | ||
|
|
187e56dfef | ||
|
|
a24cf0b528 | ||
|
|
73b1fcd745 | ||
|
|
878a501804 | ||
|
|
eee111823d | ||
|
|
2dfaea6426 | ||
|
|
d61c4ab118 | ||
|
|
a3690e710c | ||
|
|
a1f00f3b4f | ||
|
|
d4a8040a9c | ||
|
|
ddd14ddfda | ||
|
|
e8234fc32a | ||
|
|
1c1b8c0a5f | ||
|
|
35d6dda90a | ||
|
|
3b4bd8274b | ||
|
|
52237e92c3 | ||
|
|
1a88d3cc3f | ||
|
|
cdfa61524c | ||
|
|
5c7754c852 | ||
|
|
d415dd8ea5 | ||
|
|
44ac99e6b9 | ||
|
|
6fba906736 | ||
|
|
1092471a91 | ||
|
|
64e961c02b | ||
|
|
675af1b352 | ||
|
|
41edafea75 | ||
|
|
909f4b009b | ||
|
|
164d9f9006 | ||
|
|
2f204dc5ff | ||
|
|
6f46eb5bc9 | ||
|
|
b084ee0c6b | ||
|
|
fc4a14281c | ||
|
|
86139f1ddc | ||
|
|
95483cedaf | ||
|
|
fb4af908ba | ||
|
|
828e4dcf6d |
+8
-2
@@ -1,14 +1,20 @@
|
||||
from typing import Callable, TypeAlias
|
||||
|
||||
from . import autopatch, autostrip
|
||||
from lib import pkgcomposer
|
||||
|
||||
from . import autolink, autopatch, autostrip
|
||||
|
||||
PreBuild: TypeAlias = Callable[[], None]
|
||||
PostBuild: TypeAlias = Callable[[], None]
|
||||
PostPack: TypeAlias = Callable[[pkgcomposer.PkgComposer], None]
|
||||
|
||||
pre_build: dict[str, PreBuild] = {
|
||||
"autopatch": autopatch.autopatch,
|
||||
}
|
||||
|
||||
post_build: dict[str, PostBuild] = {
|
||||
post_build: dict[str, PostBuild] = {}
|
||||
|
||||
post_pack: dict[str, PostPack] = {
|
||||
"autolink": autolink.autolink,
|
||||
"autostrip": autostrip.autostrip,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
from lib import arch, common, make, pkgcomposer
|
||||
|
||||
|
||||
def autolink(composer: pkgcomposer.PkgComposer):
|
||||
os.chdir(composer.workdir + "/bundle/")
|
||||
|
||||
try:
|
||||
for i in common.treedir("bin"):
|
||||
if i.is_file():
|
||||
make.link(f"bin/{i.name}", "/bin/" + i.name)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
for i in common.treedir("lib"):
|
||||
if i.is_file():
|
||||
make.link(f"lib/{i.name}", "/lib/" + arch.get_target() + "/" + i.name)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
for i in common.treedir("include"):
|
||||
if i.is_file():
|
||||
make.link(
|
||||
f"include/{i.name}",
|
||||
"/lib/" + arch.get_target() + "/include/" + i.name,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
+26
-2
@@ -1,2 +1,26 @@
|
||||
def autostrip():
|
||||
pass
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
|
||||
from lib import common
|
||||
|
||||
strip = os.environ.get("STRIP", "strip")
|
||||
|
||||
|
||||
def _is_elf(filepath):
|
||||
with open(filepath, "rb") as f:
|
||||
return f.read(4) == b"\x7fELF"
|
||||
|
||||
|
||||
def autostrip(composer):
|
||||
for ent in common.treedir(composer.workdir):
|
||||
if not ent.is_file(follow_symlinks=False):
|
||||
continue
|
||||
if not (os.access(ent.path, os.X_OK) or ".so" in ent.name):
|
||||
continue
|
||||
if not _is_elf(ent.path):
|
||||
continue
|
||||
oldperm = stat.S_IMODE(os.stat(ent.path).st_mode)
|
||||
os.chmod(ent.path, 0o777)
|
||||
subprocess.run([strip, ent.path], check=True)
|
||||
os.chmod(ent.path, oldperm)
|
||||
|
||||
+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]
|
||||
|
||||
+41
-2
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from lib.common import treedir
|
||||
@@ -32,11 +33,25 @@ def make(rem: list[str] = []):
|
||||
subprocess.run(["make", f"-j{os.cpu_count()}"] + rem, check=True)
|
||||
|
||||
|
||||
def make_install(rem: list[str] | None = None, chdir: bool = True):
|
||||
def make_install(rem: list[str] | None = None, chdir: bool = True, move: bool = True):
|
||||
default_rem = ["DESTDIR=" + os.getcwd() + "/../cpp_install"]
|
||||
if rem is None:
|
||||
try:
|
||||
shutil.rmtree("../cpp_install")
|
||||
except:
|
||||
pass
|
||||
subprocess.run(["make", "install"] + (rem or default_rem), check=True)
|
||||
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)
|
||||
|
||||
|
||||
def ninja(rem: list[str] = []):
|
||||
@@ -51,6 +66,25 @@ def ninja_install(rem: list[str] = [], chdir: bool = True):
|
||||
os.chdir(os.environ["DESTDIR"])
|
||||
|
||||
|
||||
def meson_setup(rem: list[str] = []):
|
||||
subprocess.run(["meson", "setup", "_meson_build"] + rem, check=True)
|
||||
|
||||
|
||||
def meson_compile(rem: list[str] = []):
|
||||
subprocess.run(["meson", "compile", "-C", "_meson_build"] + rem, check=True)
|
||||
|
||||
|
||||
def meson_install(rem: list[str] | None = None, chdir: bool = True):
|
||||
default_rem = ["--destdir", f"{os.getcwd()}/../cpp_install"]
|
||||
if not rem:
|
||||
os.makedirs("../cpp_install", exist_ok=True)
|
||||
subprocess.run(
|
||||
["meson", "install", "-C", "_meson_build"] + (rem or default_rem), check=True
|
||||
)
|
||||
if chdir:
|
||||
os.chdir("../cpp_install")
|
||||
|
||||
|
||||
def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter):
|
||||
if not os.path.exists(srcdir):
|
||||
return
|
||||
@@ -64,7 +98,10 @@ def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter)
|
||||
pc.makedirs(os.path.dirname(f"{dstdir}/{ent.name}"))
|
||||
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
|
||||
elif ent.is_symlink() and not os.path.isabs(os.readlink(ent.path)):
|
||||
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
|
||||
try:
|
||||
pc.addfile(ent.path, f"{dstdir}/{ent.name}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _is_dev_file(ent) -> bool:
|
||||
@@ -75,6 +112,8 @@ def _is_dev_file(ent) -> bool:
|
||||
or ent.name.endswith(".pc")
|
||||
or ent.name.endswith(".h")
|
||||
or ent.name.endswith(".cmake")
|
||||
or ent.name.endswith(".inc")
|
||||
or ("Makefile" in ent.name)
|
||||
)
|
||||
|
||||
|
||||
|
||||
+46
-1
@@ -1,5 +1,7 @@
|
||||
import typing
|
||||
|
||||
from lib import arch
|
||||
|
||||
from . import pkgcomposer, sources
|
||||
|
||||
_key_global = "@global"
|
||||
@@ -7,10 +9,17 @@ _key_version = "version"
|
||||
_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_global: {
|
||||
_key_links: [],
|
||||
_key_dependencies: [],
|
||||
_key_provides: [],
|
||||
},
|
||||
}
|
||||
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
||||
_on_build: typing.Callable[[], None] | None = None
|
||||
@@ -22,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):
|
||||
@@ -36,6 +48,39 @@ 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] += [
|
||||
{
|
||||
"from": src,
|
||||
"to": dst,
|
||||
"default": default,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def get_prefix(pkgname: str) -> str:
|
||||
pkginfo = _pkginfo[pkgname]
|
||||
if pkginfo.get(_key_arch_any):
|
||||
pkgarch = "any"
|
||||
else:
|
||||
pkgarch = arch.get_target()
|
||||
return f"/pkg/{pkgname}={pkginfo[_key_version]}@{pkgarch}"
|
||||
|
||||
|
||||
def supported_arch(s: list[str] | typing.Callable[[str], bool]):
|
||||
global _supported_arch
|
||||
if isinstance(s, list):
|
||||
|
||||
+19
-2
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
@@ -23,7 +24,13 @@ class PkgComposer:
|
||||
|
||||
def write_manifest(self, manifest: dict):
|
||||
with open(self.workdir + "/PkgManifest.json", "w") as f:
|
||||
json.dump(manifest, f, indent=4)
|
||||
json.dump(manifest, f)
|
||||
|
||||
def write_links(self, links: list[dict]):
|
||||
with open(self.workdir + "/_links", "w") as f:
|
||||
for link in links:
|
||||
json.dump(link, f)
|
||||
f.write("\n")
|
||||
|
||||
def compose(self):
|
||||
shutil.make_archive(self.pkgfile, _archive_format, self.workdir)
|
||||
@@ -39,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}")
|
||||
|
||||
+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]):
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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")
|
||||
@@ -0,0 +1,49 @@
|
||||
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")
|
||||
|
||||
|
||||
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"])
|
||||
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2026.4.26")
|
||||
source_url("https://github.com/onetrueawk/awk/archive/refs/tags/20260426.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("a.out", "bin/awk")
|
||||
|
||||
|
||||
package("awk")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/crypto/x509/x509_def.c
|
||||
+++ b/crypto/x509/x509_def.c
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// TODO(fork): cleanup
|
||||
|
||||
-#define OPENSSLDIR "/etc/ssl"
|
||||
+#define OPENSSLDIR "/var/config/ssl"
|
||||
|
||||
#define X509_CERT_AREA OPENSSLDIR
|
||||
#define X509_CERT_DIR OPENSSLDIR "/certs"
|
||||
@@ -3,8 +3,8 @@ import os
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("5.0.0")
|
||||
source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.0.0.tar.gz")
|
||||
version("5.1.0")
|
||||
source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
@@ -16,11 +16,35 @@ def build():
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("aws-lc")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("aws-lc-bin")
|
||||
def pack_libcrypto(composer):
|
||||
composer.makedir("lib")
|
||||
composer.addfile("lib/libcrypto.so", "lib/libcrypto.so")
|
||||
|
||||
|
||||
def pack_libssl(composer):
|
||||
composer.makedir("lib")
|
||||
composer.addfile("lib/libssl.so", "lib/libssl.so")
|
||||
|
||||
|
||||
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")
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
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")
|
||||
|
||||
|
||||
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,44 @@
|
||||
--- a/unit-tests/Makefile
|
||||
+++ b/unit-tests/Makefile
|
||||
@@ -62,7 +62,6 @@
|
||||
TESTS+= cmd-errors
|
||||
TESTS+= cmd-errors-jobs
|
||||
TESTS+= cmd-errors-lint
|
||||
-TESTS+= cmd-interrupt
|
||||
TESTS+= cmdline
|
||||
TESTS+= cmdline-redirect-stdin
|
||||
TESTS+= cmdline-undefined
|
||||
@@ -139,7 +138,6 @@
|
||||
TESTS+= deptgt-begin-fail
|
||||
TESTS+= deptgt-begin-fail-indirect
|
||||
TESTS+= deptgt-default
|
||||
-TESTS+= deptgt-delete_on_error
|
||||
TESTS+= deptgt-end
|
||||
TESTS+= deptgt-end-fail
|
||||
TESTS+= deptgt-end-fail-all
|
||||
@@ -147,7 +145,6 @@
|
||||
TESTS+= deptgt-end-jobs
|
||||
TESTS+= deptgt-error
|
||||
TESTS+= deptgt-ignore
|
||||
-TESTS+= deptgt-interrupt
|
||||
TESTS+= deptgt-main
|
||||
TESTS+= deptgt-makeflags
|
||||
TESTS+= deptgt-no_parallel
|
||||
@@ -511,8 +508,6 @@
|
||||
|
||||
.if ${.MAKE.OS:NIRIX*} == ""
|
||||
BROKEN_TESTS+= \
|
||||
- cmd-interrupt \
|
||||
- deptgt-interrupt \
|
||||
job-output-null \
|
||||
opt-chdir \
|
||||
opt-debug-x-trace \
|
||||
@@ -538,7 +533,6 @@
|
||||
BROKEN_TESTS+= job-output-null
|
||||
.else
|
||||
BROKEN_TESTS+= \
|
||||
- cmd-interrupt \
|
||||
job-flags \
|
||||
|
||||
.endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
VERSION = "2026.6.19"
|
||||
|
||||
version(VERSION)
|
||||
source_url("https://www.crufty.net/ftp/pub/sjg/bmake-20260619.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--with-default-sys-path=/pkg/bmake={VERSION}@{arch.get_target()}/share/mk",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_bmake(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("bin/bmake", "bin/bmake")
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/mk", "share/mk")
|
||||
|
||||
|
||||
package("bmake")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_bmake)
|
||||
@@ -0,0 +1,29 @@
|
||||
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()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
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,22 @@
|
||||
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")
|
||||
|
||||
|
||||
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")
|
||||
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "1.0.8"
|
||||
|
||||
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")
|
||||
os.chdir("../cpp_install")
|
||||
|
||||
|
||||
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)")
|
||||
@@ -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,16 @@
|
||||
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")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("certutil")
|
||||
dep("semi-libc @same-arch")
|
||||
rust.use_auto_pack(["bin"])
|
||||
@@ -3,14 +3,127 @@ from lib.make import *
|
||||
|
||||
version("0.9.0")
|
||||
source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.9.0.tar.gz")
|
||||
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",
|
||||
"csplit",
|
||||
"cut",
|
||||
"date",
|
||||
"dd",
|
||||
"df",
|
||||
"dir",
|
||||
"dircolors",
|
||||
"dirname",
|
||||
"du",
|
||||
"echo",
|
||||
"env",
|
||||
"expand",
|
||||
"expr",
|
||||
"factor",
|
||||
"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",
|
||||
"ptx",
|
||||
"pwd",
|
||||
"readlink",
|
||||
"realpath",
|
||||
"rm",
|
||||
"rmdir",
|
||||
"seq",
|
||||
"sha1sum",
|
||||
"sha224sum",
|
||||
"sha256sum",
|
||||
"sha384sum",
|
||||
"sha512sum",
|
||||
"shred",
|
||||
"shuf",
|
||||
"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",
|
||||
]
|
||||
|
||||
package("coreutils")
|
||||
for func in functions:
|
||||
link(f"bin/coreutils", f"/bin/{func}")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import lib.rust as rust
|
||||
from lib.make import *
|
||||
|
||||
version("0.5.0")
|
||||
source_url("https://github.com/uutils/diffutils/archive/refs/tags/v0.5.0.tar.gz")
|
||||
|
||||
block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("diffutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
link("bin/diffutils", "/bin/cmp")
|
||||
link("bin/diffutils", "/bin/diff")
|
||||
dep("semi-libc @same-arch")
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2.8.1")
|
||||
source_url(
|
||||
"https://github.com/libexpat/libexpat/releases/download/R_2_8_1/expat-2.8.1.tar.gz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
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)")
|
||||
@@ -0,0 +1,43 @@
|
||||
import subprocess
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
VERSION = "5.48"
|
||||
|
||||
version(VERSION)
|
||||
source_git("https://github.com/file/file.git", "FILE5_48")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["autoreconf", "-fiv"], check=True)
|
||||
cpp.configure(["--prefix=/", f"--datadir=/share/file"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_magic_db(composer):
|
||||
composer.add_dir(f"share/file", "share")
|
||||
|
||||
|
||||
package("file-magic-db")
|
||||
arch_any()
|
||||
link("share/misc/magic.mgc", "/share/file/misc/magic.mgc")
|
||||
on_pack(pack_magic_db)
|
||||
|
||||
|
||||
package("libmagic")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("file-magic-db (same-version) @any")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libmagic-dev")
|
||||
dep("libmagic (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
package("file")
|
||||
dep("libmagic (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -0,0 +1,17 @@
|
||||
import lib.rust as rust
|
||||
from lib.make import *
|
||||
|
||||
version("0.9.0")
|
||||
source_url("https://github.com/uutils/findutils/archive/refs/tags/0.9.0.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
package("findutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
@@ -0,0 +1,23 @@
|
||||
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")
|
||||
|
||||
|
||||
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"])
|
||||
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("0.3.3")
|
||||
source_url(
|
||||
"https://github.com/sabotage-linux/gettext-tiny/releases/download/v0.3.3/gettext-tiny-0.3.3.tar.xz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make(["LIBINTL=musl"])
|
||||
cpp.make_install(
|
||||
["LIBINTL=musl", "DESTDIR=../cpp_install", "prefix=/"], chdir=False, move=False
|
||||
)
|
||||
os.chdir("../cpp_install")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libintl-dev")
|
||||
dep("semi-libc-dev @same-arch")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
package("gettext")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -6,7 +6,7 @@ source_url("https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(["--prefix=/"])
|
||||
cpp.configure([f"--prefix={get_prefix('gnu-make')}"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
@@ -15,3 +15,4 @@ on_build(build)
|
||||
|
||||
package("gnu-make")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
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")
|
||||
|
||||
|
||||
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,26 @@
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("15.1.2")
|
||||
source_url("https://gitea.semilabs.org/semios/grep/archive/v15.1.2.tar.gz")
|
||||
|
||||
|
||||
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")
|
||||
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("2026.4.22")
|
||||
source_url("https://data.iana.org/time-zones/releases/tzdb-2026b.tar.lz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_db(composer):
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/zoneinfo", "share/zoneinfo")
|
||||
|
||||
|
||||
package("iana-timezone-db")
|
||||
arch_any()
|
||||
on_pack(pack_db)
|
||||
|
||||
package("iana-timezone-tools")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("iana-timezone-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,40 @@
|
||||
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=/",
|
||||
f"--bindir={get_prefix('icu4c')}/bin",
|
||||
f"--sbindir={get_prefix('icu4c')}/sbin",
|
||||
f"--libdir={get_prefix('libicu4c')}/lib",
|
||||
f"--includedir={get_prefix('libicu4c-dev')}/include",
|
||||
]
|
||||
)
|
||||
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)")
|
||||
@@ -0,0 +1,34 @@
|
||||
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")
|
||||
|
||||
|
||||
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,31 @@
|
||||
import os
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.34")
|
||||
source_url("https://github.com/kmod-project/kmod/archive/refs/tags/v34.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.meson_setup()
|
||||
cpp.meson_compile()
|
||||
cpp.meson_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
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)")
|
||||
@@ -0,0 +1,46 @@
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.8.7")
|
||||
source_url(
|
||||
"https://github.com/libarchive/libarchive/releases/download/v3.8.7/libarchive-3.8.7.tar.gz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('libarchive-tools')}/bin",
|
||||
f"--libdir={get_prefix('libarchive')}/lib",
|
||||
f"--includedir={get_prefix('libarchive-dev')}/include",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
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("tar")
|
||||
provide("cpio")
|
||||
provide("unzip")
|
||||
link("bin/bsdtar", "/bin/tar")
|
||||
link("bin/bsdcpio", "/bin/cpio")
|
||||
link("bin/bsdunzip", "/bin/unzip")
|
||||
|
||||
package("libarchive-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libarchive (same)")
|
||||
@@ -0,0 +1,32 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.6.0")
|
||||
source_url(
|
||||
"https://github.com/libffi/libffi/releases/download/v3.6.0/libffi-3.6.0.tar.gz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libffi')}/lib",
|
||||
f"--includedir={get_prefix('libffi-dev')}/include",
|
||||
"--enable-portable-binary",
|
||||
"--disable-multi-os-directory",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libffi")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libffi-dev")
|
||||
dep("libffi (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
Binary file not shown.
@@ -0,0 +1,37 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("0.1.0")
|
||||
source_url(f"file://{os.getcwd()}/empty.tar")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(
|
||||
os.environ.get("CC", "cc").split(" ")
|
||||
+ [
|
||||
"-shared",
|
||||
"-o",
|
||||
"libgcc_s.so.1",
|
||||
"-Wl,--no-as-needed",
|
||||
"-lunwind",
|
||||
"-Wl,--no-undefined",
|
||||
"-Wl,-soname,libgcc_s.so.1",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("lib")
|
||||
composer.addfile("libgcc_s.so.1", "lib/libgcc_s.so.1")
|
||||
|
||||
|
||||
package("libgcc-compat")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libunwind @same-arch")
|
||||
on_pack(pack)
|
||||
@@ -0,0 +1,28 @@
|
||||
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")
|
||||
|
||||
|
||||
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,17 @@
|
||||
from lib.make import *
|
||||
|
||||
version("2.0")
|
||||
source_url("https://github.com/antirez/linenoise/archive/refs/tags/2.0.tar.gz")
|
||||
|
||||
on_build(lambda: None)
|
||||
|
||||
|
||||
def pack_dev(composer):
|
||||
composer.addfile("linenoise.c", "linenoise.c")
|
||||
composer.addfile("linenoise.h", "linenoise.h")
|
||||
composer.addfile("Makefile", "Makefile")
|
||||
|
||||
|
||||
package("linenoise-dev")
|
||||
arch_any()
|
||||
on_pack(pack_dev)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import lib.arch as arch
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "6.18.35"
|
||||
|
||||
version(f"{upstream_version}")
|
||||
source_url(
|
||||
f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz"
|
||||
)
|
||||
|
||||
|
||||
def get_arch():
|
||||
return arch.get_target().split("-")[0].replace("aarch64", "arm64")
|
||||
|
||||
|
||||
def build():
|
||||
makeopts = [f"ARCH={get_arch()}", "LLVM=1"]
|
||||
config_name = get_arch()
|
||||
if os.environ.get("LINUX_VARIANT"):
|
||||
config_name += "-" + os.environ["LINUX_VARIANT"]
|
||||
config_file = "../../configs/config." + config_name
|
||||
|
||||
shutil.copy2(config_file, ".config")
|
||||
|
||||
cpp.make(makeopts + ["olddefconfig"])
|
||||
cpp.make(makeopts)
|
||||
cpp.make(["headers_install", "INSTALL_HDR_PATH=../kheaders_install"])
|
||||
cpp.make(["install", "INSTALL_PATH=../kimage_install"])
|
||||
cpp.make(
|
||||
["modules_install", "INSTALL_MOD_STRIP=1", "INSTALL_MOD_PATH=../kmod_install"]
|
||||
)
|
||||
os.remove(f"../kmod_install/lib/modules/{upstream_version}/build")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
base_name = "linux"
|
||||
if os.environ.get("LINUX_VARIANT"):
|
||||
base_name += "-" + os.environ["LINUX_VARIANT"]
|
||||
|
||||
|
||||
def pack_linux_dev(composer):
|
||||
composer.add_dir(
|
||||
"../kheaders_install/include",
|
||||
"include",
|
||||
)
|
||||
|
||||
|
||||
package(f"{base_name}-dev")
|
||||
on_pack(pack_linux_dev)
|
||||
|
||||
|
||||
def pack_linux(composer):
|
||||
try:
|
||||
composer.addfile(f"../kimage_install/vmlinux-{upstream_version}", "vmlinux")
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
composer.addfile(f"../kimage_install/vmlinuz-{upstream_version}", "vmlinuz")
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
composer.addfile(
|
||||
f"../kimage_install/System.map-{upstream_version}", "System.map"
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
composer.add_dir(f"../kmod_install/lib/modules/{upstream_version}", "modules")
|
||||
|
||||
|
||||
package(f"{base_name}")
|
||||
on_pack(pack_linux)
|
||||
@@ -0,0 +1,394 @@
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
upstream_version = "22.1.7"
|
||||
[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")
|
||||
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_ENABLE_LLD=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)
|
||||
|
||||
|
||||
# Begin of helper functions
|
||||
package_dir = os.getcwd()
|
||||
|
||||
|
||||
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")
|
||||
dep("semi-libc @same-arch")
|
||||
use_llvm_runtime_auto_pack("libunwind")
|
||||
|
||||
package("libunwind-dev")
|
||||
dep("libunwind (same)")
|
||||
use_llvm_runtime_dev_auto_pack(
|
||||
["lib:libunwind", "include:mach-o", "include:*unwind*.h"]
|
||||
)
|
||||
|
||||
package("libcxxabi")
|
||||
dep("libunwind (same)")
|
||||
use_llvm_runtime_auto_pack("libc++abi")
|
||||
|
||||
package("libcxxabi-dev")
|
||||
dep("libcxxabi (same)")
|
||||
use_llvm_runtime_dev_auto_pack(["lib:libc++abi"])
|
||||
|
||||
|
||||
package("libcxx")
|
||||
dep("libcxxabi (same)")
|
||||
use_llvm_runtime_auto_pack("libc++")
|
||||
|
||||
package("libcxx-dev")
|
||||
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",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
package("libllvm")
|
||||
dep("libcxx @same-arch")
|
||||
use_llvm_libs_auto_pack(["libLLVM", "libLTO", "libRemarks"])
|
||||
|
||||
package("llvm")
|
||||
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")
|
||||
dep("libcxx @same-arch")
|
||||
use_bin_auto_pack(LLD_BINARIES)
|
||||
link("bin/ld.lld", "/bin/ld")
|
||||
|
||||
package("liblldb")
|
||||
dep("libcxx @same-arch")
|
||||
use_llvm_libs_auto_pack(["liblldb", "liblldbIntelFeatures"])
|
||||
|
||||
|
||||
package("lldb")
|
||||
dep("libcxx @same-arch")
|
||||
dep("liblldb (same)")
|
||||
use_bin_auto_pack(LLDB_BINARIES)
|
||||
|
||||
|
||||
package("libclang")
|
||||
dep("libcxx @same-arch")
|
||||
dep("libllvm (same)")
|
||||
use_llvm_libs_auto_pack(["libclang", "libclang-cpp"])
|
||||
|
||||
|
||||
def pack_clang(composer):
|
||||
auto_pack_bin(composer, CLANG_BINARIES)
|
||||
composer.makedirs("lib/clang/22/lib")
|
||||
composer.add_dir(
|
||||
f"lib/clang/22/lib/{llvm_host_triple()}",
|
||||
f"lib/clang/22/lib/{llvm_host_triple()}",
|
||||
)
|
||||
|
||||
|
||||
package("clang")
|
||||
dep("libclang (same)")
|
||||
on_pack(pack_clang)
|
||||
|
||||
# End of packages
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
LLVM_VERSION=
|
||||
ARCHITECTURE=
|
||||
|
||||
CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang
|
||||
|
||||
exec ${CLANG} -x c++ \
|
||||
-isystem /lib/${ARCHITECTURE}/include \
|
||||
-stdlib=libc++ \
|
||||
-rtlib=compiler-rt \
|
||||
-B /lib/${ARCHITECTURE} \
|
||||
"$@"
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
LLVM_VERSION=
|
||||
ARCHITECTURE=
|
||||
|
||||
CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang
|
||||
|
||||
exec ${CLANG} \
|
||||
-isystem /lib/${ARCHITECTURE}/include \
|
||||
-rtlib=compiler-rt \
|
||||
-B /lib/${ARCHITECTURE} \
|
||||
"$@"
|
||||
@@ -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} "$@"
|
||||
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.14.6")
|
||||
source_url("https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure()
|
||||
cpp.make([f"CC={os.environ['CC']}"])
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("mandoc")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
@@ -20,3 +20,6 @@ def pack_mksh(composer):
|
||||
|
||||
package("mksh")
|
||||
on_pack(pack_mksh)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("sh")
|
||||
link("bin/mksh", "/bin/sh")
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("6.6")
|
||||
source_url("https://invisible-island.net/archives/ncurses/ncurses-6.6.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('ncurses-tools')}/bin",
|
||||
f"--sbindir={get_prefix('ncurses-tools')}/sbin",
|
||||
f"--libdir={get_prefix('libncurses')}/lib",
|
||||
f"--includedir={get_prefix('libncurses')}/include",
|
||||
"--enable-pc-files",
|
||||
"--with-shared",
|
||||
"--with-terminfo-dirs=/share/terminfo",
|
||||
"--enable-symlinks",
|
||||
"--enable-sp-funcs",
|
||||
"--enable-ext-colors",
|
||||
"--enable-rgb-color",
|
||||
"--enable-ext-mouse",
|
||||
"--enable-ext-putwin",
|
||||
"--enable-no-padding",
|
||||
"--enable-sigwinch",
|
||||
"--enable-tcap-names",
|
||||
"--with-pthread",
|
||||
"--enable-pthreads-eintr",
|
||||
"--enable-weak-symbols",
|
||||
"--enable-reentrant",
|
||||
"--without-develop",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
os.unlink("lib/terminfo")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("libncurses")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("ncurses-tools")
|
||||
dep("libncurses (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
|
||||
package("libncurses-dev")
|
||||
dep("libncurses (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
|
||||
def pack_terminfo(composer):
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/tabset", "share/tabset")
|
||||
composer.add_dir("share/terminfo", "share/terminfo")
|
||||
|
||||
|
||||
package("ncurses-terminfo")
|
||||
arch_any()
|
||||
on_pack(pack_terminfo)
|
||||
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("19")
|
||||
source_url("https://github.com/aligrudi/neatvi/archive/refs/tags/19.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make([f"CC={os.environ['CC']}"])
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("vi", "bin/vi")
|
||||
|
||||
|
||||
package("neatvi")
|
||||
provide("vi")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack)
|
||||
@@ -0,0 +1,27 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("5.3")
|
||||
source_url("https://github.com/kyx0r/nextvi/archive/refs/tags/5.3.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
os.environ["PREFIX"] = "/"
|
||||
subprocess.run(["./cbuild.sh"])
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("vi", "bin/vi")
|
||||
|
||||
|
||||
package("nextvi")
|
||||
on_pack(pack)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("vi")
|
||||
@@ -0,0 +1,27 @@
|
||||
import os
|
||||
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.69.0")
|
||||
source_url(
|
||||
"https://github.com/nghttp2/nghttp2/releases/download/v1.69.0/nghttp2-1.69.0.tar.gz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
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")
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("10.3.1")
|
||||
source_url("https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.3p1.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
"--sysconfdir=/var/config",
|
||||
"--disable-etc-default-login",
|
||||
"--with-linux-memlock-onfault",
|
||||
"--without-shadow",
|
||||
"--with-pam",
|
||||
"--with-pie",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_client(composer):
|
||||
composer.add_dir("bin", "bin")
|
||||
composer.makedir("libexec")
|
||||
composer.addfile("libexec/ssh-sk-helper", "libexec/ssh-sk-helper")
|
||||
composer.addfile("libexec/ssh-pkcs11-helper", "libexec/ssh-pkcs11-helper")
|
||||
|
||||
|
||||
package("openssh-client")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libcrypto @same-arch")
|
||||
dep("libz @same-arch")
|
||||
on_pack(pack_client)
|
||||
provide("ssh")
|
||||
|
||||
|
||||
def pack_server(composer):
|
||||
composer.makedir("bin")
|
||||
composer.addfile("sbin/sshd", "bin/sshd")
|
||||
composer.makedir("libexec")
|
||||
composer.addfile("libexec/sftp-server", "libexec/sftp-server")
|
||||
composer.addfile("libexec/ssh-keysign", "libexec/ssh-keysign")
|
||||
composer.addfile("libexec/sshd-auth", "libexec/sshd-auth")
|
||||
composer.addfile("libexec/sshd-session", "libexec/sshd-session")
|
||||
|
||||
|
||||
package("openssh-server")
|
||||
dep("openssh-client (same)")
|
||||
dep("libpam @same-arch")
|
||||
on_pack(pack_server)
|
||||
@@ -0,0 +1,24 @@
|
||||
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")
|
||||
|
||||
|
||||
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,35 @@
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
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"])
|
||||
|
||||
dep("libpcre2-dev")
|
||||
dep("semi-libc @same-arch")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
@@ -0,0 +1,72 @@
|
||||
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")
|
||||
|
||||
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}")
|
||||
@@ -0,0 +1,37 @@
|
||||
import lib.cpp as cpp
|
||||
from lib import arch
|
||||
from lib.make import *
|
||||
|
||||
version("2.5.1")
|
||||
source_url("https://distfiles.ariadne.space/pkgconf/pkgconf-2.5.1.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--bindir={get_prefix('pkgconf')}/bin",
|
||||
f"--libdir={get_prefix('libpkgconf')}/lib",
|
||||
f"--includedir={get_prefix('libpkgconf-dev')}/include",
|
||||
f"--with-system-libdir=/lib:/lib/{arch.get_target()}",
|
||||
f"--with-system-includedir=/lib/{arch.get_target()}/include",
|
||||
f"--with-pkg-config-dir=/lib/{arch.get_target()}/pkgconfig",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
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)")
|
||||
@@ -0,0 +1,97 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
VERSION_BASE = "3.14"
|
||||
VERSION_APPEND = "6"
|
||||
|
||||
VERSION_FULL = f"{VERSION_BASE}.{VERSION_APPEND}"
|
||||
|
||||
version(VERSION_FULL)
|
||||
source_url(
|
||||
f"https://www.python.org/ftp/python/{VERSION_FULL}/Python-{VERSION_FULL}.tar.xz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--with-platlibdir=lib/{arch.get_target()}",
|
||||
"--enable-shared",
|
||||
"--enable-safety",
|
||||
"--enable-optimizations",
|
||||
"--enable-loadable-sqlite-extensions",
|
||||
"--enable-ipv6",
|
||||
"--with-lto=thin",
|
||||
"--with-tzpath=/share/zoneinfo",
|
||||
"--with-system-expat",
|
||||
"--with-system-libmpdec",
|
||||
"--with-readline=editline",
|
||||
"--with-tail-call-interp",
|
||||
"--without-ensurepip",
|
||||
"--with-ssl-default-suites=openssl",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
os.rename(
|
||||
f"lib/{arch.get_target()}/python{VERSION_BASE}", f"lib/python{VERSION_BASE}"
|
||||
)
|
||||
os.rmdir(f"lib/{arch.get_target()}")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def python_config_target():
|
||||
return arch.get_target().replace("-semios-linux", "-linux-musl")
|
||||
|
||||
|
||||
def pack_libpython(composer):
|
||||
# Pack the standard library
|
||||
pystdpath = f"{composer.workdir}/bundle/lib/python{VERSION_BASE}"
|
||||
composer.makedir("lib")
|
||||
composer.add_dir(f"lib/python{VERSION_BASE}", f"lib/python{VERSION_BASE}")
|
||||
shutil.rmtree(f"{pystdpath}/test")
|
||||
os.remove(
|
||||
f"{pystdpath}/config-{VERSION_BASE}-{python_config_target()}/libpython{VERSION_BASE}.a"
|
||||
)
|
||||
os.remove(f"{pystdpath}/config-{VERSION_BASE}-{python_config_target()}/python.o")
|
||||
|
||||
# Pack native libraries
|
||||
composer.addfile(
|
||||
f"lib/libpython{VERSION_BASE}.so", f"lib/libpython{VERSION_BASE}.so"
|
||||
)
|
||||
composer.addfile(
|
||||
f"lib/libpython{VERSION_BASE}.so.1.0", f"lib/libpython{VERSION_BASE}.so.1.0"
|
||||
)
|
||||
composer.addfile("lib/libpython3.so", "lib/libpython3.so")
|
||||
|
||||
|
||||
package("libpython")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_libpython)
|
||||
|
||||
package("python")
|
||||
dep("libpython (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
link(f"bin/python{VERSION_BASE}", "/bin/python3")
|
||||
link(f"bin/python{VERSION_BASE}", "/bin/python")
|
||||
|
||||
package("libpython-dev")
|
||||
dep("libpython (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
|
||||
def pack_test(composer):
|
||||
composer.makedirs(f"lib/python{VERSION_BASE}")
|
||||
composer.add_dir(f"lib/python{VERSION_BASE}/test", f"lib/python{VERSION_BASE}/test")
|
||||
|
||||
|
||||
package("python-test")
|
||||
dep("libpython (same)")
|
||||
on_pack(pack_test)
|
||||
@@ -0,0 +1,33 @@
|
||||
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")
|
||||
|
||||
|
||||
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"])
|
||||
@@ -0,0 +1,16 @@
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
version("15.1.0")
|
||||
source_url("https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.1.0.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("ripgrep")
|
||||
dep("semi-libc @same-arch")
|
||||
rust.use_auto_pack(["bin"])
|
||||
@@ -0,0 +1,24 @@
|
||||
import subprocess
|
||||
|
||||
from lib.make import *
|
||||
|
||||
version("15.1.1")
|
||||
source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz")
|
||||
|
||||
|
||||
def 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")
|
||||
dep("libpcre2 @same-arch")
|
||||
on_pack(pack_sed)
|
||||
@@ -1,21 +1,28 @@
|
||||
from lib.cpp import *
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.5.tar.gz")
|
||||
version("1.2.5")
|
||||
version("1.2.6+1")
|
||||
source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
configure(["--prefix=/"])
|
||||
make()
|
||||
make_install()
|
||||
cpp.configure(["--prefix=/"])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def musl_target():
|
||||
return arch.get_target().split("-")[0]
|
||||
|
||||
|
||||
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)")
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("3.53.2")
|
||||
source_url("https://sqlite.org/2026/sqlite-autoconf-3530200.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libsqlite')}/lib",
|
||||
f"--bindir={get_prefix('sqlite')}/bin",
|
||||
f"--includedir={get_prefix('libsqlite-dev')}/include",
|
||||
"--all",
|
||||
"--with-linenoise=/pkg/linenoise-dev=2.0@any",
|
||||
"--icu-collations",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
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)")
|
||||
@@ -0,0 +1,43 @@
|
||||
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")
|
||||
|
||||
|
||||
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"])
|
||||
@@ -0,0 +1,35 @@
|
||||
from lib import cpp
|
||||
from lib.make import *
|
||||
|
||||
version("5.8.3")
|
||||
source_url(
|
||||
"https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz"
|
||||
)
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure(
|
||||
[
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('liblzma')}/lib",
|
||||
f"--bindir={get_prefix('xz')}/bin",
|
||||
f"--includedir={get_prefix('liblzma-dev')}/include",
|
||||
]
|
||||
)
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
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)")
|
||||
@@ -11,16 +11,20 @@ def build():
|
||||
cpp.cmake(["-DZLIB_COMPAT=ON", "-DINSTALL_UTILS=ON"])
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
os.chdir("usr")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("zlib-ng")
|
||||
package("libz-ng")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
provide("libz@same-arch")
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zlib-ng-bin")
|
||||
package("zlib-ng-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libz-ng (same)")
|
||||
|
||||
package("zlib-ng-dev")
|
||||
package("libz-ng-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libz-ng (same)")
|
||||
provide("libz-dev@same-arch")
|
||||
|
||||
@@ -10,18 +10,20 @@ source_url(
|
||||
|
||||
|
||||
def build():
|
||||
cpp.make()
|
||||
cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"])
|
||||
cpp.make_install()
|
||||
os.chdir("usr/local")
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("zstd")
|
||||
package("libzstd")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zstd-bin")
|
||||
package("zstd")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
package("zstd-dev")
|
||||
package("libzstd-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
@@ -3,6 +3,7 @@ import importlib
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import typing
|
||||
|
||||
import hooks
|
||||
import lib.arch
|
||||
@@ -19,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:
|
||||
@@ -29,6 +35,18 @@ else:
|
||||
lib.arch.set_target(lib.arch.get_target())
|
||||
|
||||
|
||||
def run_hooks(map, arg: typing.Any = None):
|
||||
current_dir = os.getcwd()
|
||||
for n in map.keys():
|
||||
if n in lib.make._blocked_hooks:
|
||||
continue
|
||||
if arg:
|
||||
map[n](arg)
|
||||
else:
|
||||
map[n]()
|
||||
os.chdir(current_dir)
|
||||
|
||||
|
||||
def run_build_package(package: str):
|
||||
try:
|
||||
os.chdir(f"packages/{package}")
|
||||
@@ -47,11 +65,7 @@ def run_build_package(package: str):
|
||||
exit(1)
|
||||
|
||||
# Run `pre_build` hooks
|
||||
for n in hooks.pre_build.keys():
|
||||
if n in lib.make._blocked_hooks:
|
||||
continue
|
||||
hooks.pre_build[n]()
|
||||
os.chdir(package_dir)
|
||||
run_hooks(hooks.pre_build)
|
||||
|
||||
# Build the package
|
||||
if lib.make._on_build:
|
||||
@@ -61,15 +75,12 @@ def run_build_package(package: str):
|
||||
print("on_build(): Not defined")
|
||||
|
||||
# Run `post_build` hooks
|
||||
post_build_dir = os.getcwd()
|
||||
for n in hooks.post_build.keys():
|
||||
if n in lib.make._blocked_hooks:
|
||||
continue
|
||||
hooks.post_build[n]()
|
||||
os.chdir(post_build_dir)
|
||||
run_hooks(hooks.post_build)
|
||||
|
||||
# Pack packages
|
||||
for pkgname in lib.make._pkginfo.keys():
|
||||
lib.make._current_pkgname = pkgname
|
||||
|
||||
if pkgname == lib.make._key_global:
|
||||
continue
|
||||
|
||||
@@ -89,14 +100,24 @@ def run_build_package(package: str):
|
||||
|
||||
pkginfo[lib.make._key_on_pack](composer)
|
||||
|
||||
# Run post_pack hooks
|
||||
run_hooks(hooks.post_pack, composer)
|
||||
|
||||
manifest = {
|
||||
"name": pkgname,
|
||||
"version": pkgver,
|
||||
"arch": pkgarch,
|
||||
"dependencies": pkginfo[lib.make._key_dependencies],
|
||||
"provides": pkginfo[lib.make._key_provides],
|
||||
}
|
||||
composer.write_manifest(manifest)
|
||||
composer.write_links(pkginfo[lib.make._key_links])
|
||||
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:
|
||||
@@ -105,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