Compare commits

..
Author SHA1 Message Date
sisungo 510eca1ab6 feat: add package iana-timezone
Signed-off-by: sisungo <[email protected]>
2026-06-26 16:43:12 +08:00
sisungo 0ba3f9a31c Merge pull request 'feat: add package ripgrep' (#41) from sisungo/semios-packages:ripgrep into master
Reviewed-on: semios/semios-packages#41
2026-06-26 14:12:41 +08:00
sisungo 63c3485f5e Merge pull request 'feat: add package sed' (#42) from sisungo/semios-packages:sed into master
Reviewed-on: semios/semios-packages#42
2026-06-26 14:12:26 +08:00
sisungo 9835791b4c Merge pull request 'feat: add package nextvi' (#40) from sisungo/semios-packages:nextvi into master
Reviewed-on: semios/semios-packages#40
2026-06-26 14:12:15 +08:00
sisungo 204f650c63 Merge pull request 'fix: some dependencies are invalid' (#44) from sisungo/semios-packages:fix-deps into master
Reviewed-on: semios/semios-packages#44
2026-06-26 14:12:01 +08:00
sisungo e9fe74358f Merge pull request 'feat: add link to /bin/sh in mksh' (#39) from sisungo/semios-packages:mksh-link into master
Reviewed-on: semios/semios-packages#39
2026-06-26 14:11:48 +08:00
sisungo 962c916ae1 fix: some dependencies are invalid
Signed-off-by: sisungo <[email protected]>
2026-06-26 13:37:12 +08:00
sisungo 248c0bbc66 Merge pull request 'feat: add unix functions to coreutils' (#38) from sisungo/semios-packages:coreutils-unix into master
Reviewed-on: semios/semios-packages#38
2026-06-25 21:52:24 +08:00
sisungo 33d3df6dfc feat: add package nextvi
Signed-off-by: sisungo <[email protected]>
2026-06-25 06:46:24 +08:00
sisungo bffd8e3cdc feat: add link to /bin/sh in mksh
Signed-off-by: sisungo <[email protected]>
2026-06-25 06:19:26 +08:00
sisungo 51368da8ff feat: add package ripgrep
Signed-off-by: sisungo <[email protected]>
2026-06-25 06:14:38 +08:00
sisungo f8f18ce917 feat: add package sed
Signed-off-by: sisungo <[email protected]>
2026-06-25 06:10:15 +08:00
sisungo f7242af3a9 feat: add unix functions to coreutils
Signed-off-by: sisungo <[email protected]>
2026-06-25 05:57:11 +08:00
sisungo a3dbac2b67 Merge pull request 'feat: add dependencies and provisions' (#37) from sisungo/semios-packages:deps into master
Reviewed-on: semios/semios-packages#37
2026-06-23 15:29:18 +08:00
sisungo 383433a365 feat: add dependencies and provisions
Signed-off-by: sisungo <[email protected]>
2026-06-23 15:27:46 +08:00
sisungo 844b40daaa Merge pull request 'fix: architecture environments overrides inherited' (#36) from sisungo/semios-packages:arches into master
Reviewed-on: semios/semios-packages#36
2026-06-22 19:14:50 +08:00
sisungo e568b3f8ee fix: architecture environments overrides inherited
Signed-off-by: sisungo <[email protected]>
2026-06-22 18:32:41 +08:00
sisungo a1ae78330c Merge pull request 'feat: refactor ./x script' (#35) from sisungo/semios-packages:master into master
Reviewed-on: semios/semios-packages#35
2026-06-22 17:41:40 +08:00
sisungo 9ca10cb556 feat: refactor ./x script
Signed-off-by: sisungo <[email protected]>
2026-06-22 17:38:23 +08:00
sisungo 95a92ddae2 Merge pull request 'feat: add package llvm-project' (#25) from sisungo/semios-packages:llvm-project into master
Reviewed-on: semios/semios-packages#25
2026-06-21 20:36:38 +08:00
27 changed files with 274 additions and 12 deletions
+15 -3
View File
@@ -3,7 +3,18 @@ import os
from . import packie from . import packie
all: dict[str, dict[str, str]] = { 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() _target: str = packie.host_arch()
@@ -15,5 +26,6 @@ def get_target():
def set_target(arch: str): def set_target(arch: str):
global _target global _target
_target = arch _target = arch
for key, val in all[_target]: for key in all[_target].keys():
os.environ[key] = val if not os.environ.get(key):
os.environ[key] = all[_target][key]
+23
View File
@@ -1,5 +1,7 @@
import typing import typing
from lib import arch
from . import pkgcomposer, sources from . import pkgcomposer, sources
_key_global = "@global" _key_global = "@global"
@@ -8,11 +10,15 @@ _key_description = "description"
_key_on_pack = "on_pack" _key_on_pack = "on_pack"
_key_arch_any = "arch_any" _key_arch_any = "arch_any"
_key_links = "links" _key_links = "links"
_key_dependencies = "dependencies"
_key_provides = "provides"
_current_pkgname: str = _key_global _current_pkgname: str = _key_global
_pkginfo: dict[str, dict[str, typing.Any]] = { _pkginfo: dict[str, dict[str, typing.Any]] = {
_key_global: { _key_global: {
_key_links: [], _key_links: [],
_key_dependencies: [],
_key_provides: [],
}, },
} }
_supported_arch: typing.Callable[[str], bool] = lambda x: True _supported_arch: typing.Callable[[str], bool] = lambda x: True
@@ -25,6 +31,9 @@ def package(s: str):
global _current_pkgname global _current_pkgname
_current_pkgname = s _current_pkgname = s
_pkginfo[s] = _pkginfo[_key_global].copy() _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): def version(s: str):
@@ -39,6 +48,20 @@ def arch_any():
_pkginfo[_current_pkgname][_key_arch_any] = True _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): def link(src: str, dst: str, default: bool = True):
_pkginfo[_current_pkgname][_key_links] += [ _pkginfo[_current_pkgname][_key_links] += [
{ {
+1
View File
@@ -27,3 +27,4 @@ def pack_airup(composer):
package("airup") package("airup")
on_pack(pack_airup) on_pack(pack_airup)
dep("semi-libc @same-arch")
+10
View File
@@ -29,12 +29,22 @@ def pack_libssl(composer):
package("aws-lc-libcrypto") package("aws-lc-libcrypto")
on_pack(pack_libcrypto) on_pack(pack_libcrypto)
dep("semi-libc @same-arch")
provide("libcrypto@same-arch")
package("aws-lc-libssl") package("aws-lc-libssl")
on_pack(pack_libssl) on_pack(pack_libssl)
dep("aws-lc-libcrypto (same)")
provide("libssl@same-arch")
package("aws-lc-tools") package("aws-lc-tools")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("aws-lc-libcrypto (same)")
dep("aws-lc-libssl (same)")
package("aws-lc-dev") package("aws-lc-dev")
cpp.use_auto_pack(["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")
+5
View File
@@ -21,9 +21,14 @@ on_build(build)
package("libbzip2") package("libbzip2")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("bzip2") package("bzip2")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libbzip2 (same)")
dep("sh")
dep("coreutils")
package("libbzip2-dev") package("libbzip2-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libbzip2 (same)")
+30 -1
View File
@@ -7,19 +7,24 @@ block_hook("autolink")
def build(): def build():
rust.build() rust.build(["--features", "unix"])
on_build(build) on_build(build)
functions = [ functions = [
"[", "[",
"arch",
"b2sum", "b2sum",
"base32", "base32",
"base64", "base64",
"basename", "basename",
"basenc", "basenc",
"cat", "cat",
"chgrp",
"chmod",
"chown",
"chroot",
"cksum", "cksum",
"comm", "comm",
"cp", "cp",
@@ -40,21 +45,34 @@ functions = [
"false", "false",
"fmt", "fmt",
"fold", "fold",
"groups",
"head", "head",
"hostid",
"hostname",
"id",
"install",
"join", "join",
"kill",
"link", "link",
"ln", "ln",
"logname",
"ls", "ls",
"md5sum", "md5sum",
"mkdir", "mkdir",
"mkfifo",
"mknod",
"mktemp", "mktemp",
"more", "more",
"mv", "mv",
"nice",
"nl", "nl",
"nohup",
"nproc",
"numfmt", "numfmt",
"od", "od",
"paste", "paste",
"pathchk", "pathchk",
"pinky",
"pr", "pr",
"printenv", "printenv",
"printf", "printf",
@@ -75,22 +93,32 @@ functions = [
"sleep", "sleep",
"sort", "sort",
"split", "split",
"stat",
"stdbuf",
"stty",
"sum", "sum",
"sync",
"tac", "tac",
"tail", "tail",
"tee", "tee",
"test", "test",
"timeout",
"touch", "touch",
"tr", "tr",
"true", "true",
"truncate", "truncate",
"tsort", "tsort",
"tty", "tty",
"uname",
"unexpand", "unexpand",
"uniq", "uniq",
"unlink", "unlink",
"uptime",
"users",
"vdir", "vdir",
"wc", "wc",
"who",
"whoami",
"yes", "yes",
] ]
@@ -98,3 +126,4 @@ package("coreutils")
for func in functions: for func in functions:
link(f"bin/coreutils", f"/bin/{func}") link(f"bin/coreutils", f"/bin/{func}")
rust.use_auto_pack(["bin"]) rust.use_auto_pack(["bin"])
dep("semi-libc @same-arch")
+1
View File
@@ -17,3 +17,4 @@ package("diffutils")
rust.use_auto_pack(["bin"]) rust.use_auto_pack(["bin"])
link("bin/diffutils", "/bin/cmp") link("bin/diffutils", "/bin/cmp")
link("bin/diffutils", "/bin/diff") link("bin/diffutils", "/bin/diff")
dep("semi-libc @same-arch")
+3
View File
@@ -20,9 +20,12 @@ on_build(build)
package("libexpat") package("libexpat")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("libexpat-tools") package("libexpat-tools")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libexpat (same)")
package("libexpat-dev") package("libexpat-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libexpat (same)")
+1
View File
@@ -14,3 +14,4 @@ on_build(build)
package("findutils") package("findutils")
rust.use_auto_pack(["bin"]) rust.use_auto_pack(["bin"])
dep("semi-libc @same-arch")
+1
View File
@@ -15,3 +15,4 @@ on_build(build)
package("gnu-make") package("gnu-make")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("semi-libc @same-arch")
+33
View File
@@ -0,0 +1,33 @@
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()
os.chdir("usr")
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"])
+3
View File
@@ -20,9 +20,12 @@ on_build(build)
package("libicu4c") package("libicu4c")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("icu4c") package("icu4c")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libicu4c (same)")
package("libicu4c-dev") package("libicu4c-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libicu4c (same)")
+5
View File
@@ -18,9 +18,14 @@ on_build(build)
package("libkmod") package("libkmod")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
dep("libzstd @same-arch")
dep("libcrypto @same-arch")
package("kmod") package("kmod")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libkmod (same)")
package("libkmod-dev") package("libkmod-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libkmod (same)")
+9
View File
@@ -17,9 +17,18 @@ on_build(build)
package("libarchive") package("libarchive")
cpp.use_auto_pack(["lib"]) 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") package("libarchive-tools")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libarchive (same)")
provide("bsdtar")
package("libarchive-dev") package("libarchive-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libarchive (same)")
+3
View File
@@ -20,3 +20,6 @@ def pack_mksh(composer):
package("mksh") package("mksh")
on_pack(pack_mksh) on_pack(pack_mksh)
dep("semi-libc @same-arch")
provide("sh")
link("bin/mksh", "/bin/sh")
+27
View File
@@ -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")
+2
View File
@@ -20,6 +20,8 @@ on_build(build)
package("libnghttp2") package("libnghttp2")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("libnghttp2-dev") package("libnghttp2-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libnghttp2 (same)")
+2 -1
View File
@@ -1,6 +1,5 @@
import os import os
import lib.cpp as cpp
from lib.make import * from lib.make import *
version("1.13.2") version("1.13.2")
@@ -21,3 +20,5 @@ def pack_ninja(composer):
package("ninja") package("ninja")
on_pack(pack_ninja) on_pack(pack_ninja)
dep("semi-libc @same-arch")
dep("libcxx @same-arch")
+3
View File
@@ -23,9 +23,12 @@ on_build(build)
package("libpkgconf") package("libpkgconf")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("pkgconf") package("pkgconf")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libpkgconf (same)")
package("libpkgconf-dev") package("libpkgconf-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libpkgconf (same)")
+16
View File
@@ -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"])
+16
View File
@@ -0,0 +1,16 @@
from lib import rust
from lib.make import *
version("0.1.1")
source_url("https://github.com/uutils/sed/releases/download/0.1.1/source.tar.gz")
def build():
rust.build()
on_build(build)
package("sed")
dep("semi-libc @same-arch")
rust.use_auto_pack(["bin"])
+1
View File
@@ -25,3 +25,4 @@ link("lib/libc.so", f"/lib/ld-musl-{musl_target()}.so.1")
package("semi-libc-dev") package("semi-libc-dev")
use_auto_pack(["dev"]) use_auto_pack(["dev"])
dep("semi-libc (same)")
+3
View File
@@ -22,9 +22,12 @@ on_build(build)
package("libsqlite") package("libsqlite")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("sqlite") package("sqlite")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libsqlite (same)")
package("libsqlite-dev") package("libsqlite-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libsqlite (same)")
+3
View File
@@ -17,9 +17,12 @@ on_build(build)
package("liblzma") package("liblzma")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("xz") package("xz")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("liblzma (same)")
package("liblzma-dev") package("liblzma-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("liblzma (same)")
+5
View File
@@ -18,9 +18,14 @@ on_build(build)
package("libz-ng") package("libz-ng")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
provide("libz@same-arch")
dep("semi-libc @same-arch")
package("zlib-ng-tools") package("zlib-ng-tools")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libz-ng (same)")
package("libz-ng-dev") package("libz-ng-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libz-ng (same)")
provide("libz-dev@same-arch")
+4 -1
View File
@@ -10,7 +10,7 @@ source_url(
def build(): def build():
cpp.make() cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"])
cpp.make_install() cpp.make_install()
os.chdir("usr/local") os.chdir("usr/local")
@@ -19,9 +19,12 @@ on_build(build)
package("libzstd") package("libzstd")
cpp.use_auto_pack(["lib"]) cpp.use_auto_pack(["lib"])
dep("semi-libc @same-arch")
package("zstd") package("zstd")
cpp.use_auto_pack(["bin"]) cpp.use_auto_pack(["bin"])
dep("libzstd (same)")
package("libzstd-dev") package("libzstd-dev")
cpp.use_auto_pack(["dev"]) cpp.use_auto_pack(["dev"])
dep("libzstd (same)")
+49 -6
View File
@@ -20,8 +20,13 @@ argparser = argparse.ArgumentParser(
argparser.add_argument( argparser.add_argument(
"--target", type=str, help="Target architecture to build the package for" "--target", type=str, help="Target architecture to build the package for"
) )
argparser.add_argument("--build", type=str, help="Package to build") subparsers = argparser.add_subparsers(dest="subcommand")
argparser.add_argument("--clean", type=str, help="Package to clean") 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() args = argparser.parse_args()
if args.target: if args.target:
@@ -74,6 +79,8 @@ def run_build_package(package: str):
# Pack packages # Pack packages
for pkgname in lib.make._pkginfo.keys(): for pkgname in lib.make._pkginfo.keys():
lib.make._current_pkgname = pkgname
if pkgname == lib.make._key_global: if pkgname == lib.make._key_global:
continue continue
@@ -101,10 +108,16 @@ def run_build_package(package: str):
"version": pkgver, "version": pkgver,
"arch": pkgarch, "arch": pkgarch,
"links": pkginfo[lib.make._key_links], "links": pkginfo[lib.make._key_links],
"dependencies": pkginfo[lib.make._key_dependencies],
"provides": pkginfo[lib.make._key_provides],
} }
composer.write_manifest(manifest) composer.write_manifest(manifest)
composer.compose() 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): def run_clean_package(package: str):
try: try:
@@ -113,7 +126,37 @@ def run_clean_package(package: str):
pass pass
if args.build: def run_list(item):
run_build_package(args.build) if item == "all":
if args.clean: for i in os.listdir("packages"):
run_clean_package(args.clean) 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)