From 15eb054209173fe9630e346eec35a689a7294dbe Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 27 Jun 2026 21:31:22 +0800 Subject: [PATCH 01/86] feat: update aws-lc to 5.1.0 Signed-off-by: sisungo --- packages/aws-lc/pkgbuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index 61c824a..33e5296 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -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(): -- 2.55.0 From cc0a73fefffaf3d06502cb9ae91bd27f5bc9f7b9 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 28 Jun 2026 02:46:02 +0800 Subject: [PATCH 02/86] feat: add aws-lc support for python Signed-off-by: sisungo --- packages/python/pkgbuild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/python/pkgbuild.py b/packages/python/pkgbuild.py index 0368cde..b3338b5 100644 --- a/packages/python/pkgbuild.py +++ b/packages/python/pkgbuild.py @@ -33,6 +33,7 @@ def build(): "--with-readline=editline", "--with-tail-call-interp", "--without-ensurepip", + "--with-ssl-default-suites=openssl", ] ) cpp.make() -- 2.55.0 From 596b0554679082725a8d13c1f0ec537506dcc0c3 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 28 Jun 2026 03:35:34 +0800 Subject: [PATCH 03/86] feat: update aws-lc OPENSSLDIR Signed-off-by: sisungo --- packages/aws-lc/patches/0001-openssldir.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/aws-lc/patches/0001-openssldir.patch diff --git a/packages/aws-lc/patches/0001-openssldir.patch b/packages/aws-lc/patches/0001-openssldir.patch new file mode 100644 index 0000000..9782853 --- /dev/null +++ b/packages/aws-lc/patches/0001-openssldir.patch @@ -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" -- 2.55.0 From b4aa642b52ac8faf8a2a54af70e1b80d01f04efc Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 28 Jun 2026 16:31:35 +0800 Subject: [PATCH 04/86] feat: use packie new links format Signed-off-by: sisungo --- lib/pkgcomposer.py | 8 +++++++- x.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/pkgcomposer.py b/lib/pkgcomposer.py index 34a087f..722cc42 100644 --- a/lib/pkgcomposer.py +++ b/lib/pkgcomposer.py @@ -23,7 +23,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) diff --git a/x.py b/x.py index be87220..4460a4f 100644 --- a/x.py +++ b/x.py @@ -107,11 +107,11 @@ def run_build_package(package: str): "name": pkgname, "version": pkgver, "arch": pkgarch, - "links": pkginfo[lib.make._key_links], "dependencies": pkginfo[lib.make._key_dependencies], "provides": pkginfo[lib.make._key_provides], } composer.write_manifest(manifest) + composer.write_links(pkginfo[lib.make._key_links]) composer.compose() # Build success -- 2.55.0 From 36ceb91590d85beba3b8e097d8c560507906ae0a Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 29 Jun 2026 13:56:33 +0800 Subject: [PATCH 05/86] feat: add package neatvi Signed-off-by: sisungo --- packages/neatvi/pkgbuild.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/neatvi/pkgbuild.py diff --git a/packages/neatvi/pkgbuild.py b/packages/neatvi/pkgbuild.py new file mode 100644 index 0000000..8d86872 --- /dev/null +++ b/packages/neatvi/pkgbuild.py @@ -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) -- 2.55.0 From 5b78c48d8ed7b1df31b476f9b9541a506ff5522f Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 29 Jun 2026 14:13:56 +0800 Subject: [PATCH 06/86] feat: add package libffi Signed-off-by: sisungo --- packages/libffi/pkgbuild.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/libffi/pkgbuild.py diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py new file mode 100644 index 0000000..c289d9c --- /dev/null +++ b/packages/libffi/pkgbuild.py @@ -0,0 +1,30 @@ +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=/", + "--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"]) -- 2.55.0 From bc23a14b1a85ee9c49df9f755753f3484e0a7e20 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 29 Jun 2026 15:43:38 +0800 Subject: [PATCH 07/86] feat: add package awk Signed-off-by: sisungo --- packages/awk/pkgbuild.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/awk/pkgbuild.py diff --git a/packages/awk/pkgbuild.py b/packages/awk/pkgbuild.py new file mode 100644 index 0000000..3cb1454 --- /dev/null +++ b/packages/awk/pkgbuild.py @@ -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) -- 2.55.0 From 83e967f858f038b67c9e317c45d7b9369a6dc2fa Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 29 Jun 2026 16:23:56 +0800 Subject: [PATCH 08/86] feat: add package bmake Signed-off-by: sisungo --- packages/bmake/patches/0001-musl-tests.patch | 44 ++++++++++++++++++++ packages/bmake/pkgbuild.py | 36 ++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 packages/bmake/patches/0001-musl-tests.patch create mode 100644 packages/bmake/pkgbuild.py diff --git a/packages/bmake/patches/0001-musl-tests.patch b/packages/bmake/patches/0001-musl-tests.patch new file mode 100644 index 0000000..f010327 --- /dev/null +++ b/packages/bmake/patches/0001-musl-tests.patch @@ -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 + diff --git a/packages/bmake/pkgbuild.py b/packages/bmake/pkgbuild.py new file mode 100644 index 0000000..b4373f9 --- /dev/null +++ b/packages/bmake/pkgbuild.py @@ -0,0 +1,36 @@ +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() + os.chmod("bin/bmake", 0o655) + + +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) -- 2.55.0 From f7ff9d974241c494868294dab45e6cb60200e0e8 Mon Sep 17 00:00:00 2001 From: sisungo Date: Thu, 2 Jul 2026 22:35:03 +0800 Subject: [PATCH 09/86] feat: add prefix support Signed-off-by: sisungo --- lib/cpp.py | 17 ++++++++++++++++- lib/make.py | 9 +++++++++ packages/gnu-make/pkgbuild.py | 2 +- packages/iana-timezone/pkgbuild.py | 1 - packages/icu4c/pkgbuild.py | 11 ++++++++++- packages/libarchive/pkgbuild.py | 9 ++++++++- packages/libffi/pkgbuild.py | 2 ++ packages/mandoc/pkgbuild.py | 1 - packages/ncurses/pkgbuild.py | 5 ++++- packages/pkgconf/pkgbuild.py | 3 +++ packages/python/pkgbuild.py | 4 ---- packages/sqlite/pkgbuild.py | 3 +++ packages/xz/pkgbuild.py | 9 ++++++++- packages/zlib-ng/pkgbuild.py | 1 - packages/zstd/pkgbuild.py | 1 - 15 files changed, 64 insertions(+), 14 deletions(-) diff --git a/lib/cpp.py b/lib/cpp.py index 716f676..f6f4a9a 100644 --- a/lib/cpp.py +++ b/lib/cpp.py @@ -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] = []): diff --git a/lib/make.py b/lib/make.py index 8f9dd06..a045423 100644 --- a/lib/make.py +++ b/lib/make.py @@ -72,6 +72,15 @@ def link(src: str, dst: str, default: bool = True): ] +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): diff --git a/packages/gnu-make/pkgbuild.py b/packages/gnu-make/pkgbuild.py index 64c9f0d..23a1464 100644 --- a/packages/gnu-make/pkgbuild.py +++ b/packages/gnu-make/pkgbuild.py @@ -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() diff --git a/packages/iana-timezone/pkgbuild.py b/packages/iana-timezone/pkgbuild.py index ab711df..0c344e1 100644 --- a/packages/iana-timezone/pkgbuild.py +++ b/packages/iana-timezone/pkgbuild.py @@ -10,7 +10,6 @@ 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) diff --git a/packages/icu4c/pkgbuild.py b/packages/icu4c/pkgbuild.py index 8d68867..d7ec55a 100644 --- a/packages/icu4c/pkgbuild.py +++ b/packages/icu4c/pkgbuild.py @@ -11,7 +11,16 @@ source_url( def build(): os.chdir("source") - cpp.configure(["--enable-plugins", "--prefix=/"]) + 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() diff --git a/packages/libarchive/pkgbuild.py b/packages/libarchive/pkgbuild.py index d08047c..1ffdc51 100644 --- a/packages/libarchive/pkgbuild.py +++ b/packages/libarchive/pkgbuild.py @@ -8,7 +8,14 @@ source_url( def build(): - cpp.configure(["--prefix=/"]) + 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() diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py index c289d9c..da118bf 100644 --- a/packages/libffi/pkgbuild.py +++ b/packages/libffi/pkgbuild.py @@ -11,6 +11,8 @@ 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", ] diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index b349929..c5e19d1 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -12,7 +12,6 @@ def build(): cpp.configure() cpp.make([f"CC={os.environ['CC']}"]) cpp.make_install() - os.chdir("usr/local") subprocess.run(["sh", "-c", "chmod +w bin/* sbin/*"], check=True) diff --git a/packages/ncurses/pkgbuild.py b/packages/ncurses/pkgbuild.py index 4d5960a..7ac48ea 100644 --- a/packages/ncurses/pkgbuild.py +++ b/packages/ncurses/pkgbuild.py @@ -11,6 +11,10 @@ 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", @@ -33,7 +37,6 @@ def build(): cpp.make() cpp.make_install() os.unlink("lib/terminfo") - os.rename("usr/lib/pkgconfig", "lib/pkgconfig") on_build(build) diff --git a/packages/pkgconf/pkgbuild.py b/packages/pkgconf/pkgbuild.py index f4c843f..91955ac 100644 --- a/packages/pkgconf/pkgbuild.py +++ b/packages/pkgconf/pkgbuild.py @@ -10,6 +10,9 @@ 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", diff --git a/packages/python/pkgbuild.py b/packages/python/pkgbuild.py index b3338b5..19b1a1d 100644 --- a/packages/python/pkgbuild.py +++ b/packages/python/pkgbuild.py @@ -37,10 +37,6 @@ def build(): ] ) cpp.make() - try: - shutil.rmtree("../cpp_install") - except: - pass cpp.make_install() os.rename( f"lib/{arch.get_target()}/python{VERSION_BASE}", f"lib/python{VERSION_BASE}" diff --git a/packages/sqlite/pkgbuild.py b/packages/sqlite/pkgbuild.py index 4457c35..8d8d8f3 100644 --- a/packages/sqlite/pkgbuild.py +++ b/packages/sqlite/pkgbuild.py @@ -9,6 +9,9 @@ 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", diff --git a/packages/xz/pkgbuild.py b/packages/xz/pkgbuild.py index 12a377e..c368342 100644 --- a/packages/xz/pkgbuild.py +++ b/packages/xz/pkgbuild.py @@ -8,7 +8,14 @@ source_url( def build(): - cpp.configure(["--prefix=/"]) + 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() diff --git a/packages/zlib-ng/pkgbuild.py b/packages/zlib-ng/pkgbuild.py index e7fabef..1acdf4c 100644 --- a/packages/zlib-ng/pkgbuild.py +++ b/packages/zlib-ng/pkgbuild.py @@ -11,7 +11,6 @@ def build(): cpp.cmake(["-DZLIB_COMPAT=ON", "-DINSTALL_UTILS=ON"]) cpp.ninja() cpp.ninja_install() - os.chdir("usr") on_build(build) diff --git a/packages/zstd/pkgbuild.py b/packages/zstd/pkgbuild.py index ed63e4f..7ae1452 100644 --- a/packages/zstd/pkgbuild.py +++ b/packages/zstd/pkgbuild.py @@ -12,7 +12,6 @@ source_url( def build(): cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"]) cpp.make_install() - os.chdir("usr/local") on_build(build) -- 2.55.0 From f947e271876350ca35480f381a192536b2df9c4d Mon Sep 17 00:00:00 2001 From: sisungo Date: Thu, 2 Jul 2026 22:40:43 +0800 Subject: [PATCH 10/86] feat: add package alsa-lib Signed-off-by: sisungo --- packages/alsa-lib/pkgbuild.py | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 packages/alsa-lib/pkgbuild.py diff --git a/packages/alsa-lib/pkgbuild.py b/packages/alsa-lib/pkgbuild.py new file mode 100644 index 0000000..d43be2d --- /dev/null +++ b/packages/alsa-lib/pkgbuild.py @@ -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"]) -- 2.55.0 From dac07d40bbbe822ee0c13d90ce7b007f7f17c894 Mon Sep 17 00:00:00 2001 From: sisungo Date: Thu, 2 Jul 2026 22:44:17 +0800 Subject: [PATCH 11/86] feat: add package iproute2 Signed-off-by: sisungo --- packages/iproute2/pkgbuild.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/iproute2/pkgbuild.py diff --git a/packages/iproute2/pkgbuild.py b/packages/iproute2/pkgbuild.py new file mode 100644 index 0000000..6741049 --- /dev/null +++ b/packages/iproute2/pkgbuild.py @@ -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"]) -- 2.55.0 From 3022b06b20c32a9ef56a6df7d1e5b632017fc94e Mon Sep 17 00:00:00 2001 From: sisungo Date: Thu, 2 Jul 2026 22:46:48 +0800 Subject: [PATCH 12/86] feat: add package libopus Signed-off-by: sisungo --- packages/libopus/pkgbuild.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/libopus/pkgbuild.py diff --git a/packages/libopus/pkgbuild.py b/packages/libopus/pkgbuild.py new file mode 100644 index 0000000..da895ab --- /dev/null +++ b/packages/libopus/pkgbuild.py @@ -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"]) -- 2.55.0 From 424ff5f6e40ef14062d634b9a94a9d488b0620ef Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 09:54:29 +0800 Subject: [PATCH 13/86] feat: add links to libarchive-tools Signed-off-by: sisungo --- packages/libarchive/pkgbuild.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/libarchive/pkgbuild.py b/packages/libarchive/pkgbuild.py index d08047c..ba483a0 100644 --- a/packages/libarchive/pkgbuild.py +++ b/packages/libarchive/pkgbuild.py @@ -27,7 +27,12 @@ dep("libzstd @same-arch") package("libarchive-tools") cpp.use_auto_pack(["bin"]) dep("libarchive (same)") -provide("bsdtar") +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"]) -- 2.55.0 From 2b73f626a1dc322586f71dbcbd20284f5331cac4 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 11:09:53 +0800 Subject: [PATCH 14/86] feat: add package rhash Signed-off-by: sisungo --- packages/rhash/pkgbuild.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/rhash/pkgbuild.py diff --git a/packages/rhash/pkgbuild.py b/packages/rhash/pkgbuild.py new file mode 100644 index 0000000..14baffd --- /dev/null +++ b/packages/rhash/pkgbuild.py @@ -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"]) -- 2.55.0 From 3a4307f811cee89bb2686e188909e9199068576f Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 12:32:14 +0800 Subject: [PATCH 15/86] feat: add package c-ares Signed-off-by: sisungo --- packages/c-ares/pkgbuild.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/c-ares/pkgbuild.py diff --git a/packages/c-ares/pkgbuild.py b/packages/c-ares/pkgbuild.py new file mode 100644 index 0000000..f5d33fc --- /dev/null +++ b/packages/c-ares/pkgbuild.py @@ -0,0 +1,30 @@ +from lib import cpp +from lib.make import * + +version("1.34.6") +source_url( + "https://github.com/c-ares/c-ares/releases/download/v1.34.6/c-ares-1.34.6.tar.gz" +) + + +def build(): + cpp.configure( + [ + "--prefix=/", + f"--libdir={get_prefix('libcares')}/lib", + f"--includedir={get_prefix('libcares-dev')}/include", + ] + ) + cpp.make() + cpp.make_install() + + +on_build(build) + +package("libcares") +dep("semi-libc @same-arch") +cpp.use_auto_pack(["lib"]) + +package("libcares-dev") +dep("libcares (same)") +cpp.use_auto_pack(["dev"]) -- 2.55.0 From f55398575ac09187c23b7b51c5e24f3e879800cf Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 12:36:35 +0800 Subject: [PATCH 16/86] feat: add package brotli Signed-off-by: sisungo --- packages/brotli/pkgbuild.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/brotli/pkgbuild.py diff --git a/packages/brotli/pkgbuild.py b/packages/brotli/pkgbuild.py new file mode 100644 index 0000000..4a0149f --- /dev/null +++ b/packages/brotli/pkgbuild.py @@ -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"]) -- 2.55.0 From b7d9d9b7d66256be1ac138f1a5fdc5453b60dc2a Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 22:30:54 +0800 Subject: [PATCH 17/86] feat: add package perl Signed-off-by: sisungo --- packages/perl/pkgbuild.py | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 packages/perl/pkgbuild.py diff --git a/packages/perl/pkgbuild.py b/packages/perl/pkgbuild.py new file mode 100644 index 0000000..06e5719 --- /dev/null +++ b/packages/perl/pkgbuild.py @@ -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}") -- 2.55.0 From 764a7355f046ddc8cefa077001688839bd57e213 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 3 Jul 2026 22:44:19 +0800 Subject: [PATCH 18/86] fix: autostrip fails on read-only permissions Signed-off-by: sisungo --- hooks/autostrip.py | 4 ++++ packages/bmake/pkgbuild.py | 1 - packages/mandoc/pkgbuild.py | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hooks/autostrip.py b/hooks/autostrip.py index a7edcfe..8f93261 100644 --- a/hooks/autostrip.py +++ b/hooks/autostrip.py @@ -1,4 +1,5 @@ import os +import stat import subprocess from lib import common @@ -19,4 +20,7 @@ def autostrip(composer): 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) diff --git a/packages/bmake/pkgbuild.py b/packages/bmake/pkgbuild.py index b4373f9..f0ea4a4 100644 --- a/packages/bmake/pkgbuild.py +++ b/packages/bmake/pkgbuild.py @@ -18,7 +18,6 @@ def build(): ) cpp.make() cpp.make_install() - os.chmod("bin/bmake", 0o655) on_build(build) diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index c5e19d1..587d5d9 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -12,7 +12,6 @@ def build(): cpp.configure() cpp.make([f"CC={os.environ['CC']}"]) cpp.make_install() - subprocess.run(["sh", "-c", "chmod +w bin/* sbin/*"], check=True) on_build(build) -- 2.55.0 From b0b40ef77407499335cd2183ee6175857bb8effb Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 11:27:01 +0800 Subject: [PATCH 19/86] feat: add package git Signed-off-by: sisungo --- packages/git/pkgbuild.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 packages/git/pkgbuild.py diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py new file mode 100644 index 0000000..93a63b3 --- /dev/null +++ b/packages/git/pkgbuild.py @@ -0,0 +1,37 @@ +import subprocess + +from lib import cpp +from lib.make import * + +version("2.55.0") +source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") + + +def build(): + cpp.configure( + [ + "--prefix=", + "--with-gitconfig=/var/config/git/config.ini", + "--with-gitattributes=/var/config/git/attributes.txt", + ] + ) + cpp.make(["RUNTIME_PREFIX=YesPlease"]) + cpp.make_install() + + +on_build(build) + + +def pack_git(composer): + composer.add_dir("bin", "bin") + composer.add_dir("libexec", "libexec") + composer.makedir("share") + composer.add_dir("share/git-core", "share/git-core") + composer.add_dir("share/gitweb", "share/gitweb") + composer.add_dir("share/perl5", "share/perl5") + + +package("git") +dep("semi-libc @same-arch") +dep("libz @same-arch") +on_pack(pack_git) -- 2.55.0 From 50e41c4c36a47319d99516d60e0ae3abc096e944 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 11:40:00 +0800 Subject: [PATCH 20/86] feat: add package gettext-tiny Signed-off-by: sisungo --- packages/gettext-tiny/pkgbuild.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/gettext-tiny/pkgbuild.py diff --git a/packages/gettext-tiny/pkgbuild.py b/packages/gettext-tiny/pkgbuild.py new file mode 100644 index 0000000..94b24e9 --- /dev/null +++ b/packages/gettext-tiny/pkgbuild.py @@ -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"]) -- 2.55.0 From 2938e9e969e2b8a3e0eb3686a050182a4a357865 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 12:35:05 +0800 Subject: [PATCH 21/86] feat: add package ca-certificates Signed-off-by: sisungo --- packages/ca-certificates/pkgbuild.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/ca-certificates/pkgbuild.py diff --git a/packages/ca-certificates/pkgbuild.py b/packages/ca-certificates/pkgbuild.py new file mode 100644 index 0000000..a1aeef3 --- /dev/null +++ b/packages/ca-certificates/pkgbuild.py @@ -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) -- 2.55.0 From e3d032623f239b8a382967590c3495f03f17bf3f Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 18:35:57 +0800 Subject: [PATCH 22/86] feat: improve llvm packaging Signed-off-by: sisungo --- packages/llvm-project/pkgbuild.py | 570 +++++++++--------- packages/llvm-project/wrapper/clang++.wrapper | 13 + packages/llvm-project/wrapper/clang.wrapper | 12 + packages/llvm-project/wrapper/ld.lld.wrapper | 8 + 4 files changed, 332 insertions(+), 271 deletions(-) create mode 100644 packages/llvm-project/wrapper/clang++.wrapper create mode 100644 packages/llvm-project/wrapper/clang.wrapper create mode 100644 packages/llvm-project/wrapper/ld.lld.wrapper diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index dc7161a..a9989ef 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -1,6 +1,154 @@ +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 * @@ -37,6 +185,7 @@ def build(): "-DLLVM_BUILD_LLVM_DYLIB=ON", "-DLLVM_ENABLE_LIBCXX=ON", "-DLLVM_ENABLE_LIBEDIT=ON", + "-DLLVM_ENABLE_LLD=ON", "-DLLVM_LINK_LLVM_DYLIB=ON", "-DLIBCXX_HAS_MUSL_LIBC=ON", "-DCOMPILER_RT_BUILD_GWP_ASAN=OFF", @@ -52,315 +201,194 @@ def build(): on_build(build) -def pack_runtime_lib(composer, files): - composer.makedir("lib") - for file in files: - composer.addfile(f"lib/{llvm_host_triple()}/{file}", f"lib/{file}") +# Begin of helper functions +package_dir = os.getcwd() -def pack_runtime_dev(composer, files: list[str]): - for file in files: - if file.startswith("lib/"): - composer.makedirs("lib") - composer.addfile(file.replace("lib/", f"lib/{llvm_host_triple()}/"), file) - elif file.startswith("include/"): - realpath = file.replace("include/", "usr/include/") - composer.makedirs(os.path.dirname(file)) - if os.path.isfile(realpath): - composer.addfile(realpath, file) - elif os.path.isdir(realpath): - composer.add_dir(realpath, file) +def install_wrapper(composer, name: str, dst: str): + composer.addfile(f"{package_dir}/wrapper/{name}.wrapper", dst) + with open(f"{composer.workdir}/bundle/{dst}", "r") as f: + s = f.read() + s = s.replace("LLVM_VERSION=", f"LLVM_VERSION={upstream_version}").replace( + "ARCHITECTURE=", "ARCHITECTURE=" + arch.get_target() + ) + with open(f"{composer.workdir}/bundle/{dst}", "w") as f: + f.write(s) + os.chmod(f"{composer.workdir}/bundle/{dst}", 0o755) +def auto_pack_llvm_runtime(composer, prefix, dev): + composer.makedirs("lib") + parent_dir = f"./lib/{llvm_host_triple()}" + for i in os.listdir(parent_dir): + fullpath = f"{parent_dir}/{i}" + if i.split(".")[0] != prefix: + continue + if dev: + if ".so" in i: + continue + else: + if not ".so" in i: + continue + composer.addfile(fullpath, f"lib/{i}") + if not dev: + return + + +def auto_pack_llvm_runtime_dev(composer, condition): + composer.makedir("include") + parent_include = f"./usr/include" + for i in condition: + if i.startswith("lib:"): + auto_pack_llvm_runtime(composer, i.replace("lib:", ""), True) + continue + i = i.replace("include:", "") + for file in glob.glob(f"{parent_include}/{i}"): + name = file.replace(f"{parent_include}/", "") + if "/" in name: + composer.makedirs(f"include/{os.path.dirname(name)}") + if os.path.isdir(file): + composer.add_dir(file, f"include/{name}") + else: + composer.addfile(file, f"include/{name}") + + +def use_llvm_runtime_auto_pack(prefix: str): + on_pack(lambda composer: auto_pack_llvm_runtime(composer, prefix, False)) + + +def use_llvm_runtime_dev_auto_pack(des: list[str]): + on_pack(lambda composer: auto_pack_llvm_runtime_dev(composer, des)) + + +def auto_pack_llvm_libs(composer, prefixes: list[str]): + composer.makedirs("lib") + parent_dir = f"./lib/" + for i in os.listdir(parent_dir): + fullpath = f"{parent_dir}/{i}" + if not i.split(".")[0] in prefixes: + continue + if not ".so" in i: + continue + composer.addfile(fullpath, f"lib/{i}") + + +def use_llvm_libs_auto_pack(prefixes: list[str]): + on_pack(lambda composer: auto_pack_llvm_libs(composer, prefixes)) + + +def auto_pack_bin(composer, conditions: list[str]): + for i in conditions: + prefix = "bin" + if i.startswith("libexec/"): + i = i.replace("libexec/", "") + prefix = "libexec" + composer.makedirs(prefix) + src = i + dst = f"{prefix}/{i}" + if len(i.split("~")) == 2: + src = i.split("~")[0] + dst = f"bin/{i.split('~')[1]}" + if src.startswith("wrapper://"): + src = src.replace("wrapper://", "") + if len(i.split("~")) == 1: + dst = f"bin/{src}.wrapper" + install_wrapper(composer, src, dst) + continue + if os.path.exists(f"{prefix}/{src}"): + src = f"{prefix}/{src}" + elif os.path.exists(f"usr/{prefix}/{src}"): + src = f"usr/{prefix}/{src}" + composer.addfile(src, dst) + + +def use_bin_auto_pack(conditions: list[str]): + on_pack(lambda composer: auto_pack_bin(composer, conditions)) + + +# End of helper functions + +# Begin of packages + package("libunwind") -on_pack( - lambda composer: pack_runtime_lib( - composer, ["libunwind.so.1.0", "libunwind.so.1", "libunwind.so"] - ) -) +dep("semi-libc @same-arch") +use_llvm_runtime_auto_pack("libunwind") package("libunwind-dev") -on_pack( - lambda composer: pack_runtime_dev( - composer, - [ - "lib/libunwind.a", - "include/mach-o/compact_unwind_encoding.h", - "include/__libunwind_config.h", - "include/libunwind.h", - "include/libunwind.modulemap", - "include/unwind.h", - "include/unwind_arm_ehabi.h", - "include/unwind_itanium.h", - ], - ) +dep("libunwind (same)") +use_llvm_runtime_dev_auto_pack( + ["lib:libunwind", "include:mach-o", "include:*unwind*.h"] ) package("libcxxabi") -on_pack( - lambda composer: pack_runtime_lib( - composer, ["libc++abi.so", "libc++abi.so.1", "libc++abi.so.1.0"] - ) -) +dep("libunwind (same)") +use_llvm_runtime_auto_pack("libc++abi") package("libcxxabi-dev") -on_pack(lambda composer: pack_runtime_dev(composer, ["lib/libc++abi.a"])) +dep("libcxxabi (same)") +use_llvm_runtime_dev_auto_pack(["lib:libc++abi"]) package("libcxx") -on_pack( - lambda composer: pack_runtime_lib( - composer, ["libc++.so", "libc++.so.1", "libc++.so.1.0"] - ) -) +dep("libcxxabi (same)") +use_llvm_runtime_auto_pack("libc++") package("libcxx-dev") -on_pack( - lambda composer: pack_runtime_dev( - composer, - [ - "lib/libc++.a", - "lib/libc++experimental.a", - "lib/libc++.modules.json", - f"include/{llvm_host_triple()}/c++/v1", - "include/c++/v1", - ], - ) -) - - -def pack_libllvm(composer): - LIBRARIES = [ - "libLLVM.so.22.1", - "libLLVM.so", - "libLLVM-22.so", - "libLTO.so", - "libLTO.so.22.1", - "libRemarks.so", - "libRemarks.so.22.1", +dep("libcxx (same)") +use_llvm_runtime_dev_auto_pack( + [ + "lib:libc++", + "lib:libc++experimental", + f"include:{llvm_host_triple()}/c++/v1/__config_site", + "include:c++/v1", ] - composer.makedir("lib") - for lib in LIBRARIES: - composer.addfile(f"lib/{lib}", f"lib/{lib}") +) package("libllvm") -on_pack(pack_libllvm) - - -def pack_llvm(composer): - BINARIES = [ - "bugpoint", - "dsymutil", - "llc", - "lli", - "llvm-addr2line", - "llvm-ar", - "llvm-as", - "llvm-bcanalyzer", - "llvm-bitcode-strip", - "llvm-bolt", - "llvm-bolt-binary-analysis", - "llvm-bolt-heatmap", - "llvm-boltdiff", - "llvm-c-test", - "llvm-cas", - "llvm-cat", - "llvm-cfi-verify", - "llvm-cgdata", - "llvm-config", - "llvm-cov", - "llvm-ctxprof-util", - "llvm-cvtres", - "llvm-cxxdump", - "llvm-cxxfilt", - "llvm-cxxmap", - "llvm-debuginfo-analyzer", - "llvm-debuginfod", - "llvm-debuginfod-find", - "llvm-diff", - "llvm-dis", - "llvm-dlltool", - "llvm-dwarfdump", - "llvm-dwarfutil", - "llvm-dwp", - "llvm-exegesis", - "llvm-extract", - "llvm-gsymutil", - "llvm-ifs", - "llvm-install-name-tool", - "llvm-ir2vec", - "llvm-jitlink", - "llvm-lib", - "llvm-libtool-darwin", - "llvm-link", - "llvm-lipo", - "llvm-lto", - "llvm-lto2", - "llvm-mc", - "llvm-mca", - "llvm-ml", - "llvm-ml64", - "llvm-modextract", - "llvm-nm", - "llvm-objcopy", - "llvm-objdump", - "llvm-offload-binary", - "llvm-offload-wrapper", - "llvm-opt-report", - "llvm-otool", - "llvm-pdbutil", - "llvm-profdata", - "llvm-profgen", - "llvm-ranlib", - "llvm-rc", - "llvm-readelf", - "llvm-readobj", - "llvm-readtapi", - "llvm-reduce", - "llvm-remarkutil", - "llvm-rtdyld", - "llvm-sim", - "llvm-size", - "llvm-split", - "llvm-stress", - "llvm-strings", - "llvm-strip", - "llvm-symbolizer", - "llvm-tblgen", - "llvm-tli-checker", - "llvm-undname", - "llvm-windres", - "llvm-xray", - "merge-fdata", - "opt", - "perf2bolt", - "reduce-chunk-list", - "sancov", - "sanstats", - "verify-uselistorder", - ] - composer.makedir("bin") - for bin in BINARIES: - composer.addfile(f"usr/bin/{bin}", f"bin/{bin}") - +dep("libcxx @same-arch") +use_llvm_libs_auto_pack(["libLLVM", "libLTO", "libRemarks"]) package("llvm") -on_pack(pack_llvm) - - -def pack_lld(composer): - BINARIES = ["lld", "lld-link", "ld.lld", "ld64.lld", "wasm-ld"] - composer.makedir("bin") - for bin in BINARIES: - composer.addfile(f"usr/bin/{bin}", f"bin/{bin}") +dep("libllvm (same)") +use_bin_auto_pack(LLVM_TOOLS) +for i in ["strip", "ar", "ranlib", "readelf", "objcopy", "objdump", "strings", "nm"]: + link(f"bin/llvm-{i}", f"/bin/{i}") package("lld") -on_pack(pack_lld) - - -def pack_liblldb(composer): - LIBRARIES = [ - "liblldb.so", - "liblldb.so.22.1", - "liblldb.so.22.1.7", - "liblldbIntelFeatures.so", - "liblldbIntelFeatures.so.22.1", - ] - composer.makedir("lib") - for lib in LIBRARIES: - composer.addfile(f"lib/{lib}", f"lib/{lib}") - +dep("libcxx @same-arch") +use_bin_auto_pack(LLD_BINARIES) +link("bin/ld.lld", "/bin/ld") package("liblldb") -on_pack(pack_liblldb) - - -def pack_lldb(composer): - BINARIES = [ - "lldb", - "lldb-argdumper", - "lldb-dap", - "lldb-instr", - "lldb-mcp", - "lldb-server", - "yaml2macho-core", - ] - composer.makedir("bin") - for bin in BINARIES: - composer.addfile(f"bin/{bin}", f"bin/{bin}") +dep("libcxx @same-arch") +use_llvm_libs_auto_pack(["liblldb", "liblldbIntelFeatures"]) package("lldb") -on_pack(pack_lldb) - - -def pack_libclang(composer): - LIBRARIES = [ - "libclang.so", - "libclang-cpp.so", - "libclang-cpp.so.22.1", - "libclang.so.22.1", - "libclang.so.22.1.7", - ] - composer.makedir("lib") - for lib in LIBRARIES: - composer.addfile(f"lib/{lib}", f"lib/{lib}") +dep("libcxx @same-arch") +dep("liblldb (same)") +use_bin_auto_pack(LLDB_BINARIES) package("libclang") -on_pack(pack_libclang) +dep("libcxx @same-arch") +dep("libllvm (same)") +use_llvm_libs_auto_pack(["libclang", "libclang-cpp"]) def pack_clang(composer): - BINARIES = [ - "clang", - "clang++", - "clang-22", - "clang-check", - "clang-cl", - "clang-cpp", - "clang-extdef-mapping", - "clang-format", - "clang-installapi", - "clang-linker-wrapper", - "clang-nvlink-wrapper", - "clang-offload-bundler", - "clang-offload-packager", - "clang-refactor", - "clang-repl", - "clang-scan-deps", - "clang-sycl-linker", - "clang-tblgen", - "diagtool", - "git-clang-format", - "hmaptool", - "intercept-build", - "amdgpu-arch", - "c-index-test", - "analyze-build", - "nvptx-arch", - "offload-arch", - "scan-build", - "scan-build-py", - "scan-view", - ] - LIBEXEC = [ - "analyze-c++", - "analyze-cc", - "c++-analyzer", - "ccc-analyzer", - "intercept-c++", - "intercept-cc", - ] - composer.makedir("bin") - for bin in BINARIES: - composer.addfile(f"usr/bin/{bin}", f"bin/{bin}") - composer.makedir("libexec") - for libexec in LIBEXEC: - composer.addfile(f"usr/libexec/{libexec}", f"libexec/{libexec}") + auto_pack_bin(composer, CLANG_BINARIES) + composer.makedirs("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 diff --git a/packages/llvm-project/wrapper/clang++.wrapper b/packages/llvm-project/wrapper/clang++.wrapper new file mode 100644 index 0000000..19e3cf3 --- /dev/null +++ b/packages/llvm-project/wrapper/clang++.wrapper @@ -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} \ + "$@" diff --git a/packages/llvm-project/wrapper/clang.wrapper b/packages/llvm-project/wrapper/clang.wrapper new file mode 100644 index 0000000..42d1035 --- /dev/null +++ b/packages/llvm-project/wrapper/clang.wrapper @@ -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} \ + "$@" diff --git a/packages/llvm-project/wrapper/ld.lld.wrapper b/packages/llvm-project/wrapper/ld.lld.wrapper new file mode 100644 index 0000000..e07ef92 --- /dev/null +++ b/packages/llvm-project/wrapper/ld.lld.wrapper @@ -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} "$@" -- 2.55.0 From bfd454886985af8a9093669a1975dca516d84e6e Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 19:01:53 +0800 Subject: [PATCH 23/86] feat: add package certutil Signed-off-by: sisungo --- packages/certutil/pkgbuild.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/certutil/pkgbuild.py diff --git a/packages/certutil/pkgbuild.py b/packages/certutil/pkgbuild.py new file mode 100644 index 0000000..bff2aaf --- /dev/null +++ b/packages/certutil/pkgbuild.py @@ -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"]) -- 2.55.0 From 66626cf702f97628f78f7b7c8c63ffbca2188c91 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 19:16:36 +0800 Subject: [PATCH 24/86] feat: add package libgcc-compat Signed-off-by: sisungo --- packages/libgcc-compat/empty.tar | Bin 0 -> 10240 bytes packages/libgcc-compat/pkgbuild.py | 37 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 packages/libgcc-compat/empty.tar create mode 100644 packages/libgcc-compat/pkgbuild.py diff --git a/packages/libgcc-compat/empty.tar b/packages/libgcc-compat/empty.tar new file mode 100644 index 0000000000000000000000000000000000000000..6de001425961c082a8577696afc19e815781fa30 GIT binary patch literal 10240 zcmeIuI}XAy5CuRVB{v|pvgAAz2vHCaP6}?1BT>*qG^Cr?tfl9l=6rk1uS423eaje; z+Q?({-*c_jq#UJ`e2ige`*K^A)Wxp9`dq%$`Sk3%RIhcJF89qRfAyOO6$A(nAV7cs p0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAVA>%0&nC{6u$rf literal 0 HcmV?d00001 diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py new file mode 100644 index 0000000..0f04528 --- /dev/null +++ b/packages/libgcc-compat/pkgbuild.py @@ -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) -- 2.55.0 From ed7d0b5680718e25048318555ab5069278ba7373 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 19:17:40 +0800 Subject: [PATCH 25/86] fix: source_url does not support file:// Signed-off-by: sisungo --- lib/sources.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/sources.py b/lib/sources.py index eff3475..c643024 100644 --- a/lib/sources.py +++ b/lib/sources.py @@ -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" -- 2.55.0 From bbe4604406cc5b188200558ebf387d1f7accd1d5 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 22:26:20 +0800 Subject: [PATCH 26/86] feat: update semi-libc to v1.2.6-1 Signed-off-by: sisungo --- packages/semi-libc/pkgbuild.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/semi-libc/pkgbuild.py b/packages/semi-libc/pkgbuild.py index 5beccfc..04c629c 100644 --- a/packages/semi-libc/pkgbuild.py +++ b/packages/semi-libc/pkgbuild.py @@ -1,15 +1,14 @@ -import lib.arch as arch -from lib.cpp import * +from lib import arch, cpp from lib.make import * +version("1.2.6-1") +source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz") -version("1.2.6") -source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6.tar.gz") def build(): - configure(["--prefix=/"]) - make() - make_install() + cpp.configure(["--prefix=/"]) + cpp.make() + cpp.make_install() on_build(build) @@ -20,9 +19,10 @@ def musl_target(): package("semi-libc") -use_auto_pack(["lib"]) +cpp.use_auto_pack(["lib"]) link("lib/libc.so", f"/lib/ld-musl-{musl_target()}.so.1") +link("lib/libc.so", "/bin/ldd") package("semi-libc-dev") -use_auto_pack(["dev"]) +cpp.use_auto_pack(["dev"]) dep("semi-libc (same)") -- 2.55.0 From 868a631c9358d02e648b5202ef2fa0c156137eed Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 4 Jul 2026 22:30:05 +0800 Subject: [PATCH 27/86] fix: invalid semi-libc version format Signed-off-by: sisungo --- packages/semi-libc/pkgbuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/semi-libc/pkgbuild.py b/packages/semi-libc/pkgbuild.py index 04c629c..1a0da63 100644 --- a/packages/semi-libc/pkgbuild.py +++ b/packages/semi-libc/pkgbuild.py @@ -1,7 +1,7 @@ from lib import arch, cpp from lib.make import * -version("1.2.6-1") +version("1.2.6+1") source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz") -- 2.55.0 From fea89673edc36d72059c29c4cd11c4d072e24843 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 5 Jul 2026 10:47:55 +0800 Subject: [PATCH 28/86] feat: add package vim Signed-off-by: sisungo --- packages/vim/pkgbuild.py | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/vim/pkgbuild.py diff --git a/packages/vim/pkgbuild.py b/packages/vim/pkgbuild.py new file mode 100644 index 0000000..df86422 --- /dev/null +++ b/packages/vim/pkgbuild.py @@ -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"]) -- 2.55.0 From 9f623be2e5e6d3c7f9216a5a030f37ce59bdf2f2 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 6 Jul 2026 15:07:21 +0800 Subject: [PATCH 29/86] feat: add package gnu-sed Signed-off-by: sisungo --- packages/gnu-sed/pkgbuild.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/gnu-sed/pkgbuild.py diff --git a/packages/gnu-sed/pkgbuild.py b/packages/gnu-sed/pkgbuild.py new file mode 100644 index 0000000..5c7506d --- /dev/null +++ b/packages/gnu-sed/pkgbuild.py @@ -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") -- 2.55.0 From 57578dcb059ebf315200b6a60e610499c650d876 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 6 Jul 2026 19:01:54 +0800 Subject: [PATCH 30/86] feat: add package pcre2 Signed-off-by: sisungo --- packages/pcre2/pkgbuild.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/pcre2/pkgbuild.py diff --git a/packages/pcre2/pkgbuild.py b/packages/pcre2/pkgbuild.py new file mode 100644 index 0000000..c8763b6 --- /dev/null +++ b/packages/pcre2/pkgbuild.py @@ -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"]) -- 2.55.0 From 0178b369887de28fa657d7affaa67c8a438b4a3a Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 6 Jul 2026 20:05:16 +0800 Subject: [PATCH 31/86] feat: add package sed Signed-off-by: sisungo --- packages/sed/pkgbuild.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/sed/pkgbuild.py b/packages/sed/pkgbuild.py index 8d7957f..8d721e1 100644 --- a/packages/sed/pkgbuild.py +++ b/packages/sed/pkgbuild.py @@ -1,16 +1,24 @@ -from lib import rust +import subprocess + from lib.make import * -version("0.1.1") -source_url("https://github.com/uutils/sed/releases/download/0.1.1/source.tar.gz") +version("15.1.1") +source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz") def build(): - rust.build() + subprocess.run(["./build.sh"]) on_build(build) + +def pack_sed(composer): + composer.makedir("bin") + composer.addfile("sed", "bin/sed") + + package("sed") dep("semi-libc @same-arch") -rust.use_auto_pack(["bin"]) +dep("libpcre2 @same-arch") +on_pack(pack_sed) -- 2.55.0 From e9f52ee363b631da0c30dd3e1a8aedafdd043906 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 6 Jul 2026 20:30:57 +0800 Subject: [PATCH 32/86] feat: add package grep Signed-off-by: sisungo --- packages/grep/pkgbuild.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/grep/pkgbuild.py diff --git a/packages/grep/pkgbuild.py b/packages/grep/pkgbuild.py new file mode 100644 index 0000000..7eb0327 --- /dev/null +++ b/packages/grep/pkgbuild.py @@ -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") -- 2.55.0 From 3b78c450c5025c8f81e23972d7de183b3ad7eb60 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 08:03:32 +0800 Subject: [PATCH 33/86] feat: add package byacc Signed-off-by: sisungo --- packages/byacc/pkgbuild.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/byacc/pkgbuild.py diff --git a/packages/byacc/pkgbuild.py b/packages/byacc/pkgbuild.py new file mode 100644 index 0000000..3fee848 --- /dev/null +++ b/packages/byacc/pkgbuild.py @@ -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") -- 2.55.0 From 3994b0d9a305fccfb5446705aa4863de6deb8c65 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 08:04:26 +0800 Subject: [PATCH 34/86] feat: add package flex Signed-off-by: sisungo --- packages/flex/pkgbuild.py | 23 +++++++++++++++++++++ packages/vim/pkgbuild.py | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 packages/flex/pkgbuild.py create mode 100644 packages/vim/pkgbuild.py diff --git a/packages/flex/pkgbuild.py b/packages/flex/pkgbuild.py new file mode 100644 index 0000000..16719dd --- /dev/null +++ b/packages/flex/pkgbuild.py @@ -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"]) diff --git a/packages/vim/pkgbuild.py b/packages/vim/pkgbuild.py new file mode 100644 index 0000000..df86422 --- /dev/null +++ b/packages/vim/pkgbuild.py @@ -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"]) -- 2.55.0 From 23394f785e066e3ef510f65244c53de5cd8683d7 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 10:53:07 +0800 Subject: [PATCH 35/86] feat: add package patch Signed-off-by: sisungo --- packages/patch/pkgbuild.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/patch/pkgbuild.py diff --git a/packages/patch/pkgbuild.py b/packages/patch/pkgbuild.py new file mode 100644 index 0000000..c4cd529 --- /dev/null +++ b/packages/patch/pkgbuild.py @@ -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) -- 2.55.0 From c0e9573a413a03356f4de173c681ab3833b0b19f Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 11:16:49 +0800 Subject: [PATCH 36/86] feat: add package bc Signed-off-by: sisungo --- packages/bc/pkgbuild.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/bc/pkgbuild.py diff --git a/packages/bc/pkgbuild.py b/packages/bc/pkgbuild.py new file mode 100644 index 0000000..c3a864c --- /dev/null +++ b/packages/bc/pkgbuild.py @@ -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"]) -- 2.55.0 From 4f06471aa254f21a741c1727d68a19b29171fb98 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 12:06:00 +0800 Subject: [PATCH 37/86] feat: support hard links when packaging Signed-off-by: sisungo --- lib/pkgcomposer.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/pkgcomposer.py b/lib/pkgcomposer.py index 722cc42..28aace4 100644 --- a/lib/pkgcomposer.py +++ b/lib/pkgcomposer.py @@ -1,6 +1,7 @@ import json import os import shutil +import subprocess import sys if sys.version_info >= (3, 14): @@ -45,4 +46,14 @@ class PkgComposer: shutil.copy2(src, f"{self.workdir}/bundle/{dst}", follow_symlinks=False) def add_dir(self, src: str, dst: str, merge: bool = False): - shutil.copytree(src, f"{self.workdir}/bundle/{dst}", dirs_exist_ok=merge) + target = f"{self.workdir}/bundle/{dst}" + if not os.path.exists(src): + raise FileNotFoundError(f"Source directory not found: {src}") + os.makedirs(os.path.dirname(target), exist_ok=True) + if merge and os.path.exists(target) and os.path.isdir(target): + cmd = ["cp", "-a", f"{src}/.", target] + else: + cmd = ["cp", "-a", src, target] + result = subprocess.run(cmd, capture_output=True, text=True) + if result.returncode != 0: + raise RuntimeError(f"cp command failed: {result.stderr}") -- 2.55.0 From 37da18439bd0d6c20a7751a143c8a1313fa8d0fd Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 16:10:33 +0800 Subject: [PATCH 38/86] fix: bzip2 soname is invalid Signed-off-by: sisungo --- packages/bzip2/pkgbuild.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/bzip2/pkgbuild.py b/packages/bzip2/pkgbuild.py index cc18c8c..78d015a 100644 --- a/packages/bzip2/pkgbuild.py +++ b/packages/bzip2/pkgbuild.py @@ -12,8 +12,18 @@ source_url(f"https://sourceware.org/pub/bzip2/bzip2-{upstream_version}.tar.gz") def build(): cpp.make(["-f", "Makefile-libbz2_so"]) + try: + shutil.rmtree("../cpp_install") + except Exception: + pass cpp.make_install(["PREFIX=../cpp_install"], chdir=False) - shutil.copy2(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so") + shutil.copy2( + f"libbz2.so.{upstream_version}", + f"../cpp_install/lib/libbz2.so.{upstream_version}", + ) + os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so.1.0") + os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so.1") + os.symlink(f"libbz2.so.{upstream_version}", "../cpp_install/lib/libbz2.so") os.chdir("../cpp_install") -- 2.55.0 From b9533a5c6e4856a40efdb36ca659e8b3a2adefb9 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 7 Jul 2026 16:12:17 +0800 Subject: [PATCH 39/86] fix: pkg-config link is not defined Signed-off-by: sisungo --- packages/pkgconf/pkgbuild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pkgconf/pkgbuild.py b/packages/pkgconf/pkgbuild.py index 91955ac..3f75137 100644 --- a/packages/pkgconf/pkgbuild.py +++ b/packages/pkgconf/pkgbuild.py @@ -31,6 +31,7 @@ dep("semi-libc @same-arch") package("pkgconf") cpp.use_auto_pack(["bin"]) dep("libpkgconf (same)") +link("bin/pkgconf", "/bin/pkg-config") package("libpkgconf-dev") cpp.use_auto_pack(["dev"]) -- 2.55.0 From bd16d6d218ae08897d6918ef6815d48701ef2d28 Mon Sep 17 00:00:00 2001 From: sisungo Date: Wed, 8 Jul 2026 00:48:59 +0800 Subject: [PATCH 40/86] feat: add support of atom builds Signed-off-by: sisungo --- lib/atombuild.py | 136 +++++++++++++++++++++++++++++ lib/cpp.py | 22 +++-- lib/make.py | 25 +++++- lib/packie.py | 24 ++++- packages/airup/pkgbuild.py | 2 + packages/alsa-lib/pkgbuild.py | 3 + packages/awk/pkgbuild.py | 4 + packages/aws-lc/pkgbuild.py | 11 ++- packages/bc/pkgbuild.py | 3 + packages/bmake/pkgbuild.py | 4 + packages/brotli/pkgbuild.py | 1 - packages/byacc/pkgbuild.py | 3 + packages/bzip2/pkgbuild.py | 8 +- packages/c-ares/pkgbuild.py | 3 + packages/certutil/pkgbuild.py | 2 + packages/coreutils/pkgbuild.py | 2 + packages/diffutils/pkgbuild.py | 2 + packages/expat/pkgbuild.py | 1 - packages/file/pkgbuild.py | 3 + packages/findutils/pkgbuild.py | 2 + packages/flex/pkgbuild.py | 4 + packages/gettext-tiny/pkgbuild.py | 3 + packages/git/pkgbuild.py | 6 +- packages/gnu-make/pkgbuild.py | 3 + packages/gnu-sed/pkgbuild.py | 3 + packages/grep/pkgbuild.py | 6 ++ packages/iana-timezone/pkgbuild.py | 3 + packages/icu4c/pkgbuild.py | 3 + packages/iproute2/pkgbuild.py | 4 + packages/libarchive/pkgbuild.py | 8 ++ packages/libffi/pkgbuild.py | 3 + packages/libgcc-compat/pkgbuild.py | 5 ++ packages/libopus/pkgbuild.py | 3 + packages/linux/pkgbuild.py | 6 ++ packages/mandoc/pkgbuild.py | 6 +- packages/mksh/pkgbuild.py | 11 ++- packages/ncurses/pkgbuild.py | 3 + packages/neatvi/pkgbuild.py | 3 + packages/nextvi/pkgbuild.py | 3 + packages/nghttp2/pkgbuild.py | 1 - packages/ninja/pkgbuild.py | 2 + packages/openssh/pkgbuild.py | 5 ++ packages/patch/pkgbuild.py | 2 + packages/pcre2/pkgbuild.py | 2 +- packages/perl/pkgbuild.py | 3 + packages/pkgconf/pkgbuild.py | 3 + packages/python/pkgbuild.py | 14 ++- packages/rhash/pkgbuild.py | 3 + packages/ripgrep/pkgbuild.py | 2 + packages/sed/pkgbuild.py | 4 + packages/semi-libc/pkgbuild.py | 4 + packages/sqlite/pkgbuild.py | 6 ++ packages/vim/pkgbuild.py | 4 + packages/xz/pkgbuild.py | 6 ++ packages/zlib-ng/pkgbuild.py | 2 + packages/zstd/pkgbuild.py | 3 + x.py | 48 +++++++++- 57 files changed, 433 insertions(+), 28 deletions(-) create mode 100644 lib/atombuild.py diff --git a/lib/atombuild.py b/lib/atombuild.py new file mode 100644 index 0000000..88f8a99 --- /dev/null +++ b/lib/atombuild.py @@ -0,0 +1,136 @@ +import os +import shutil +import subprocess + +from . import packie + +BASE_REQUIREMENTS = [ + # Basic packages for running shell scripts + "mksh", + "coreutils", + "findutils", + "diffutils", + # Packages for running `semios-packages` scripts + "python", + "packie", + "patch", + "zstd", + # Basic libraries + "sqlite", + "libgcc-compat", + "libcxx", + "semi-libc", + "libz-ng", + # Networking + "ca-certificates", + "certutil", + "aws-lc-libssl", + "aws-lc-tools", +] + + +def _prepare_build_env_base_files(root: str): + os.makedirs(root, exist_ok=True) + os.mkdir(f"{root}/var") + os.mkdir(f"{root}/var/tmp") + os.mkdir(f"{root}/var/run") + os.mkdir(f"{root}/tmp") + os.mkdir(f"{root}/run") + os.makedirs(f"{root}/var/db/packie") + shutil.copytree("/var/config/packie/repos.d", f"{root}/var/config/packie/repos.d") + os.mkdir(f"{root}/dev") + os.mkdir(f"{root}/sys") + os.mkdir(f"{root}/proc") + os.makedirs(f"{root}/home/root") + + +def prepare_build_env(root: str, extreq: list[str] = []): + # Skip if the environment is already initialized + if os.path.exists(f"{root}/.INIT"): + return + try: + shutil.rmtree(root) + except: + pass + + # Prepare basic filesystem hierarchy + _prepare_build_env_base_files(root) + + # Install packages + packie.chroot_update(root) + packie.chroot_install(root, BASE_REQUIREMENTS + extreq) + + # Refresh certificates + enter_build_env(root, ["certutil", "refresh"]) + + # Copy DNS config + os.makedirs(f"{root}/etc", exist_ok=True) + shutil.copy2("/etc/resolv.conf", f"{root}/etc/resolv.conf") + + # Create initialized tag + with open(f"{root}/.INIT", "wt+") as file: + file.write("OK") + + +def enter_build_env(root: str, cmd: list[str], chdir: str = "/"): + reserve_env = ["https_proxy", "http_proxy", "all_proxy"] + reserve_env_args = [] + for i in reserve_env: + if os.environ.get(i): + reserve_env_args += ["--setenv", i, os.environ[i]] + subprocess.run( + [ + "bwrap", + "--bind", + root, + "/", + "--unshare-pid", + "--unshare-user", + "--uid", + "0", + "--gid", + "0", + "--dev", + "/dev", + "--bind", + "/sys", + "/sys", + "--proc", + "/proc", + "--clearenv", + "--setenv", + "HOME", + "/home/root", + "--setenv", + "PATH", + "/bin", + "--setenv", + "SEMIOS_PKGBUILD_IN_ATOMIC", + "1", + "--chdir", + chdir, + ] + + reserve_env_args + + cmd + ) + + +def copy_pkgbuild_tree(repo_root: str, pkgname: str, build_env_root: str): + build_dir = f"{build_env_root}/Atom" + if os.path.exists(build_dir): + return + os.mkdir(build_dir) + shutil.copytree(f"{repo_root}/hooks", f"{build_dir}/hooks") + shutil.copytree(f"{repo_root}/lib", f"{build_dir}/lib") + shutil.copy2(f"{repo_root}/x", f"{build_dir}/x") + shutil.copy2(f"{repo_root}/x.py", f"{build_dir}/x.py") + os.makedirs(f"{build_dir}/packages/{pkgname}") + for i in os.listdir(f"{repo_root}/packages/{pkgname}"): + srcpath = f"{repo_root}/packages/{pkgname}/{i}" + dstpath = f"{build_dir}/packages/{pkgname}/{i}" + if i in ["target", "__pycache__"]: + continue + if os.path.isdir(srcpath): + shutil.copytree(srcpath, dstpath) + elif os.path.isfile(srcpath): + shutil.copy2(srcpath, dstpath) diff --git a/lib/cpp.py b/lib/cpp.py index f6f4a9a..68af147 100644 --- a/lib/cpp.py +++ b/lib/cpp.py @@ -29,6 +29,15 @@ def cmake(rem: list[str] = []): ) +def _move_install(): + subprocess.run(["sh", "-c", "cp -r ./pkg/*@*/* . 2>/dev/null || true"], check=False) + subprocess.run( + ["sh", "-c", "cp -r ./usr/local/* . 2>/dev/null || true"], check=False + ) + subprocess.run(["sh", "-c", "cp -r ./usr/* . 2>/dev/null || true"], check=False) + subprocess.run(["rm", "-rf", "./pkg", "./usr"], check=False) + + def make(rem: list[str] = []): subprocess.run(["make", f"-j{os.cpu_count()}"] + rem, check=True) @@ -44,26 +53,21 @@ def make_install(rem: list[str] | None = None, chdir: bool = True, move: bool = if rem is None and chdir: os.chdir("../cpp_install") if chdir and move: - subprocess.run( - ["sh", "-c", "cp -r ./pkg/*@*/* . 2>/dev/null || true"], check=False - ) - subprocess.run( - ["sh", "-c", "cp -r ./usr/local/* . 2>/dev/null || true"], check=False - ) - subprocess.run(["sh", "-c", "cp -r ./usr/* . 2>/dev/null || true"], check=False) - subprocess.run(["rm", "-rf", "./pkg", "./usr"], check=False) + _move_install() def ninja(rem: list[str] = []): subprocess.run(["ninja"] + rem, check=True) -def ninja_install(rem: list[str] = [], chdir: bool = True): +def ninja_install(rem: list[str] = [], chdir: bool = True, move: bool = True): if chdir: os.environ["DESTDIR"] = os.getcwd() + "/../cpp_install" subprocess.run(["ninja", "install"] + rem, check=True) if chdir: os.chdir(os.environ["DESTDIR"]) + if chdir and move: + _move_install() def meson_setup(rem: list[str] = []): diff --git a/lib/make.py b/lib/make.py index a045423..433a5ea 100644 --- a/lib/make.py +++ b/lib/make.py @@ -24,9 +24,28 @@ _pkginfo: dict[str, dict[str, typing.Any]] = { _supported_arch: typing.Callable[[str], bool] = lambda x: True _on_build: typing.Callable[[], None] | None = None +_in_atombuild = False +_builddep: list[str] = [] + _blocked_hooks: list[str] = [] +def builddep(s: str): + global _builddep + if s == "shortcut/c": + _builddep += ["semi-libc-dev", "clang", "llvm", "lld"] + elif s == "shortcut/c++": + builddep("shortcut/c") + _builddep += ["libcxx-dev"] + elif s == "shortcut/autotools": + _builddep += ["gnu-make", "gnu-sed", "awk", "grep"] + elif s == "shortcut/rust": + builddep("shortcut/c") + _builddep += ["cargo", "rustc"] + else: + _builddep += [s] + + def package(s: str): global _current_pkgname _current_pkgname = s @@ -103,8 +122,10 @@ def block_hook(hook: str): def source_url(url: str): - sources.source_url(url) + if not _in_atombuild: + sources.source_url(url) def source_git(url: str, branch: str | None = None): - sources.source_git(url, branch) + if not _in_atombuild: + sources.source_git(url, branch) diff --git a/lib/packie.py b/lib/packie.py index 5ed847f..35c012a 100644 --- a/lib/packie.py +++ b/lib/packie.py @@ -1,11 +1,31 @@ -import subprocess import os +import subprocess PACKIE_EXEC = os.getenv("PACKIE", "packie") + def host_arch() -> str: result = subprocess.run( [PACKIE_EXEC, "print", "profile.host_arch"], - check=True, capture_output=True, + check=True, + capture_output=True, ) return result.stdout.decode().strip() + + +def chroot_update(root: str): + subprocess.run([PACKIE_EXEC, "--chroot", root, "update"], check=True) + + +def chroot_install(root: str, requirements: list[str]): + subprocess.run( + [PACKIE_EXEC, "--chroot", root, "install", "--yes"] + requirements, check=True + ) + + +def update(): + subprocess.run([PACKIE_EXEC, "update"], check=True) + + +def install(requirements: list[str]): + subprocess.run([PACKIE_EXEC, "install", "--yes"] + requirements, check=True) diff --git a/packages/airup/pkgbuild.py b/packages/airup/pkgbuild.py index 80561af..7303294 100644 --- a/packages/airup/pkgbuild.py +++ b/packages/airup/pkgbuild.py @@ -7,6 +7,8 @@ from lib.make import * version("0.10.9") source_url("https://github.com/sisungo/airup/archive/refs/tags/v0.10.9.tar.gz") +builddep("shortcut/rust") + def build(): shutil.copy2("../../build_manifest.json", "build_manifest.json") diff --git a/packages/alsa-lib/pkgbuild.py b/packages/alsa-lib/pkgbuild.py index d43be2d..538dc8e 100644 --- a/packages/alsa-lib/pkgbuild.py +++ b/packages/alsa-lib/pkgbuild.py @@ -6,6 +6,9 @@ upstream_version = "1.2.16.1" version(upstream_version) source_url("https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/awk/pkgbuild.py b/packages/awk/pkgbuild.py index 3cb1454..66d60f5 100644 --- a/packages/awk/pkgbuild.py +++ b/packages/awk/pkgbuild.py @@ -6,6 +6,10 @@ from lib.make import * version("2026.4.26") source_url("https://github.com/onetrueawk/awk/archive/refs/tags/20260426.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("bison") + def build(): cpp.make() diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index 33e5296..b0729d1 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -6,12 +6,19 @@ from lib.make import * version("5.1.0") source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz") +builddep("shortcut/c") + def build(): - cpp.cmake(["-DBUILD_SHARED_LIBS=1"]) + cpp.cmake( + [ + "-DBUILD_SHARED_LIBS=1", + "-DCMAKE_INSTALL_PREFIX=/", + f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('aws-lc-dev')}", + ] + ) cpp.ninja() cpp.ninja_install() - os.chdir("usr") on_build(build) diff --git a/packages/bc/pkgbuild.py b/packages/bc/pkgbuild.py index c3a864c..74b5bd7 100644 --- a/packages/bc/pkgbuild.py +++ b/packages/bc/pkgbuild.py @@ -4,6 +4,9 @@ from lib.make import * version("7.0.3") source_url("https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): predefined_build_type = "GDH" diff --git a/packages/bmake/pkgbuild.py b/packages/bmake/pkgbuild.py index f0ea4a4..d34f501 100644 --- a/packages/bmake/pkgbuild.py +++ b/packages/bmake/pkgbuild.py @@ -8,6 +8,10 @@ VERSION = "2026.6.19" version(VERSION) source_url("https://www.crufty.net/ftp/pub/sjg/bmake-20260619.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("bc") + def build(): cpp.configure( diff --git a/packages/brotli/pkgbuild.py b/packages/brotli/pkgbuild.py index 4a0149f..dbca5a2 100644 --- a/packages/brotli/pkgbuild.py +++ b/packages/brotli/pkgbuild.py @@ -11,7 +11,6 @@ def build(): cpp.cmake() cpp.ninja() cpp.ninja_install() - os.chdir("usr") on_build(build) diff --git a/packages/byacc/pkgbuild.py b/packages/byacc/pkgbuild.py index 3fee848..a7dbcb2 100644 --- a/packages/byacc/pkgbuild.py +++ b/packages/byacc/pkgbuild.py @@ -6,6 +6,9 @@ from lib.make import * version("2.0") source_url("https://www.invisible-island.net/archives/byacc/byacc-2.0.tgz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure([f"--prefix={get_prefix('byacc')}", "--enable-btyacc"]) diff --git a/packages/bzip2/pkgbuild.py b/packages/bzip2/pkgbuild.py index 78d015a..5fd7bd5 100644 --- a/packages/bzip2/pkgbuild.py +++ b/packages/bzip2/pkgbuild.py @@ -6,17 +6,21 @@ from lib.make import * upstream_version = "1.0.8" +builddep("shortcut/c") +builddep("shortcut/autotools") + version(f"{upstream_version}") source_url(f"https://sourceware.org/pub/bzip2/bzip2-{upstream_version}.tar.gz") def build(): - cpp.make(["-f", "Makefile-libbz2_so"]) + makevars = [f"CC={os.environ.get('CC', 'cc')}"] + cpp.make(["-f", "Makefile-libbz2_so"] + makevars) try: shutil.rmtree("../cpp_install") except Exception: pass - cpp.make_install(["PREFIX=../cpp_install"], chdir=False) + cpp.make_install(["PREFIX=../cpp_install" + makevars], chdir=False) shutil.copy2( f"libbz2.so.{upstream_version}", f"../cpp_install/lib/libbz2.so.{upstream_version}", diff --git a/packages/c-ares/pkgbuild.py b/packages/c-ares/pkgbuild.py index f5d33fc..146925a 100644 --- a/packages/c-ares/pkgbuild.py +++ b/packages/c-ares/pkgbuild.py @@ -6,6 +6,9 @@ source_url( "https://github.com/c-ares/c-ares/releases/download/v1.34.6/c-ares-1.34.6.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/certutil/pkgbuild.py b/packages/certutil/pkgbuild.py index bff2aaf..1e64a2c 100644 --- a/packages/certutil/pkgbuild.py +++ b/packages/certutil/pkgbuild.py @@ -4,6 +4,8 @@ from lib.make import * version("0.1.0") source_url("https://gitea.semilabs.org/semios/certutil/archive/v0.1.0.tar.gz") +builddep("shortcut/rust") + def build(): rust.build() diff --git a/packages/coreutils/pkgbuild.py b/packages/coreutils/pkgbuild.py index 0f4689c..4b900bf 100644 --- a/packages/coreutils/pkgbuild.py +++ b/packages/coreutils/pkgbuild.py @@ -5,6 +5,8 @@ version("0.9.0") source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.9.0.tar.gz") block_hook("autolink") +builddep("shortcut/rust") + def build(): rust.build(["--features", "unix"]) diff --git a/packages/diffutils/pkgbuild.py b/packages/diffutils/pkgbuild.py index 578b827..12d6d2f 100644 --- a/packages/diffutils/pkgbuild.py +++ b/packages/diffutils/pkgbuild.py @@ -4,6 +4,8 @@ from lib.make import * version("0.5.0") source_url("https://github.com/uutils/diffutils/archive/refs/tags/v0.5.0.tar.gz") +builddep("shortcut/rust") + block_hook("autolink") diff --git a/packages/expat/pkgbuild.py b/packages/expat/pkgbuild.py index 08d5da9..89feaa6 100644 --- a/packages/expat/pkgbuild.py +++ b/packages/expat/pkgbuild.py @@ -13,7 +13,6 @@ def build(): cpp.cmake() cpp.ninja() cpp.ninja_install() - os.chdir("usr") on_build(build) diff --git a/packages/file/pkgbuild.py b/packages/file/pkgbuild.py index a0098c5..e72d3c5 100644 --- a/packages/file/pkgbuild.py +++ b/packages/file/pkgbuild.py @@ -8,6 +8,9 @@ VERSION = "5.48" version(VERSION) source_git("https://github.com/file/file.git", "FILE5_48") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): subprocess.run(["autoreconf", "-fiv"], check=True) diff --git a/packages/findutils/pkgbuild.py b/packages/findutils/pkgbuild.py index 0a9ec04..27f25dc 100644 --- a/packages/findutils/pkgbuild.py +++ b/packages/findutils/pkgbuild.py @@ -4,6 +4,8 @@ from lib.make import * version("0.9.0") source_url("https://github.com/uutils/findutils/archive/refs/tags/0.9.0.tar.gz") +builddep("shortcut/rust") + def build(): rust.build() diff --git a/packages/flex/pkgbuild.py b/packages/flex/pkgbuild.py index 16719dd..9806644 100644 --- a/packages/flex/pkgbuild.py +++ b/packages/flex/pkgbuild.py @@ -4,6 +4,10 @@ from lib.make import * version("2.6.4") source_url("https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("m4") + def build(): cpp.configure( diff --git a/packages/gettext-tiny/pkgbuild.py b/packages/gettext-tiny/pkgbuild.py index 94b24e9..aa82d4e 100644 --- a/packages/gettext-tiny/pkgbuild.py +++ b/packages/gettext-tiny/pkgbuild.py @@ -8,6 +8,9 @@ source_url( "https://github.com/sabotage-linux/gettext-tiny/releases/download/v0.3.3/gettext-tiny-0.3.3.tar.xz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.make(["LIBINTL=musl"]) diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index 93a63b3..3dc11a5 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -1,11 +1,15 @@ import subprocess -from lib import cpp +from lib import arch, cpp from lib.make import * version("2.55.0") source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libz-dev {arch.get_target()}") + def build(): cpp.configure( diff --git a/packages/gnu-make/pkgbuild.py b/packages/gnu-make/pkgbuild.py index 23a1464..749ec3a 100644 --- a/packages/gnu-make/pkgbuild.py +++ b/packages/gnu-make/pkgbuild.py @@ -4,6 +4,9 @@ from lib.make import * version("4.4.1") source_url("https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure([f"--prefix={get_prefix('gnu-make')}"]) diff --git a/packages/gnu-sed/pkgbuild.py b/packages/gnu-sed/pkgbuild.py index 5c7506d..634d4fe 100644 --- a/packages/gnu-sed/pkgbuild.py +++ b/packages/gnu-sed/pkgbuild.py @@ -8,6 +8,9 @@ source_url("https://ftp.gnu.org/gnu/sed/sed-4.10.tar.gz") block_hook("autolink") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/grep/pkgbuild.py b/packages/grep/pkgbuild.py index 7eb0327..7b6565d 100644 --- a/packages/grep/pkgbuild.py +++ b/packages/grep/pkgbuild.py @@ -5,6 +5,12 @@ from lib.make import * version("15.1.2") source_url("https://gitea.semilabs.org/semios/grep/archive/v15.1.2.tar.gz") +builddep("shortcut/c") +builddep(f"libpcre2-dev @{arch.get_target()}") +builddep("pcre2-tools") +builddep(f"libbzip2-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") + def build(): subprocess.run(["./build.sh"], check=True) diff --git a/packages/iana-timezone/pkgbuild.py b/packages/iana-timezone/pkgbuild.py index 0c344e1..5d0dfad 100644 --- a/packages/iana-timezone/pkgbuild.py +++ b/packages/iana-timezone/pkgbuild.py @@ -6,6 +6,9 @@ from lib.make import * version("2026.4.22") source_url("https://data.iana.org/time-zones/releases/tzdb-2026b.tar.lz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.make() diff --git a/packages/icu4c/pkgbuild.py b/packages/icu4c/pkgbuild.py index d7ec55a..c8c7cdc 100644 --- a/packages/icu4c/pkgbuild.py +++ b/packages/icu4c/pkgbuild.py @@ -8,6 +8,9 @@ source_url( "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz" ) +builddep("shortcut/c++") +builddep("shortcut/autotools") + def build(): os.chdir("source") diff --git a/packages/iproute2/pkgbuild.py b/packages/iproute2/pkgbuild.py index 6741049..e2d3e09 100644 --- a/packages/iproute2/pkgbuild.py +++ b/packages/iproute2/pkgbuild.py @@ -7,6 +7,10 @@ from lib.make import * version("7.1.0") source_git("https://git.kernel.org/pub/scm/network/iproute2/iproute2.git", "v7.1.0") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("git") + def build(): cpp.configure() diff --git a/packages/libarchive/pkgbuild.py b/packages/libarchive/pkgbuild.py index 198e0a9..1975474 100644 --- a/packages/libarchive/pkgbuild.py +++ b/packages/libarchive/pkgbuild.py @@ -6,6 +6,14 @@ source_url( "https://github.com/libarchive/libarchive/releases/download/v3.8.7/libarchive-3.8.7.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"libbzip2-dev @{arch.get_target()}") +builddep(f"liblzma-dev @{arch.get_target()}") + def build(): cpp.configure( diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py index da118bf..11a3d71 100644 --- a/packages/libffi/pkgbuild.py +++ b/packages/libffi/pkgbuild.py @@ -6,6 +6,9 @@ source_url( "https://github.com/libffi/libffi/releases/download/v3.6.0/libffi-3.6.0.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py index 0f04528..9f07397 100644 --- a/packages/libgcc-compat/pkgbuild.py +++ b/packages/libgcc-compat/pkgbuild.py @@ -1,11 +1,16 @@ import os import subprocess +from lib import arch from lib.make import * version("0.1.0") source_url(f"file://{os.getcwd()}/empty.tar") +builddep("shortcut/c") +builddep(f"libunwind-dev {arch.get_target()}") +builddep(f"linux-dev {arch.get_target()}") + def build(): subprocess.run( diff --git a/packages/libopus/pkgbuild.py b/packages/libopus/pkgbuild.py index da895ab..ea39a12 100644 --- a/packages/libopus/pkgbuild.py +++ b/packages/libopus/pkgbuild.py @@ -4,6 +4,9 @@ from lib.make import * version("1.6.1") source_url("https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/linux/pkgbuild.py b/packages/linux/pkgbuild.py index ff15dab..84badfe 100644 --- a/packages/linux/pkgbuild.py +++ b/packages/linux/pkgbuild.py @@ -12,6 +12,12 @@ source_url( f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("libncurses-dev") +builddep("aws-lc-dev") +builddep("aws-lc-tools") + def get_arch(): return arch.get_target().split("-")[0].replace("aarch64", "arm64") diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index 587d5d9..95f2ded 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -1,12 +1,16 @@ import os import subprocess -from lib import cpp +from lib import arch, cpp from lib.make import * version("1.14.6") source_url("https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libz-ng-dev @{arch.get_target()}") + def build(): cpp.configure() diff --git a/packages/mksh/pkgbuild.py b/packages/mksh/pkgbuild.py index b6e6e68..8a54259 100644 --- a/packages/mksh/pkgbuild.py +++ b/packages/mksh/pkgbuild.py @@ -1,13 +1,18 @@ -import os +import subprocess from lib.make import * version("1.59.2") -source_git("https://github.com/mirabilos/mksh-cvs2git.git", "mksh-R59c") +source_url( + "https://github.com/mirabilos/mksh-cvs2git/archive/refs/tags/mksh-R59c.tar.gz" +) + +builddep("shortcut/c") +builddep("sed") def build(): - os.system("sh ./Build.sh") + subprocess.run(["sh", "./Build.sh"], check=True) on_build(build) diff --git a/packages/ncurses/pkgbuild.py b/packages/ncurses/pkgbuild.py index 7ac48ea..7a6fa8b 100644 --- a/packages/ncurses/pkgbuild.py +++ b/packages/ncurses/pkgbuild.py @@ -6,6 +6,9 @@ from lib.make import * version("6.6") source_url("https://invisible-island.net/archives/ncurses/ncurses-6.6.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/neatvi/pkgbuild.py b/packages/neatvi/pkgbuild.py index 8d86872..971461b 100644 --- a/packages/neatvi/pkgbuild.py +++ b/packages/neatvi/pkgbuild.py @@ -6,6 +6,9 @@ from lib.make import * version("19") source_url("https://github.com/aligrudi/neatvi/archive/refs/tags/19.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.make([f"CC={os.environ['CC']}"]) diff --git a/packages/nextvi/pkgbuild.py b/packages/nextvi/pkgbuild.py index b7fab6e..580a1e0 100644 --- a/packages/nextvi/pkgbuild.py +++ b/packages/nextvi/pkgbuild.py @@ -7,6 +7,9 @@ from lib.make import * version("5.3") source_url("https://github.com/kyx0r/nextvi/archive/refs/tags/5.3.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): os.environ["PREFIX"] = "/" diff --git a/packages/nghttp2/pkgbuild.py b/packages/nghttp2/pkgbuild.py index cf3ee3b..f95ce79 100644 --- a/packages/nghttp2/pkgbuild.py +++ b/packages/nghttp2/pkgbuild.py @@ -13,7 +13,6 @@ def build(): cpp.cmake() cpp.ninja() cpp.ninja_install() - os.chdir("usr") on_build(build) diff --git a/packages/ninja/pkgbuild.py b/packages/ninja/pkgbuild.py index 685380d..1771e06 100644 --- a/packages/ninja/pkgbuild.py +++ b/packages/ninja/pkgbuild.py @@ -5,6 +5,8 @@ from lib.make import * version("1.13.2") source_url("https://github.com/ninja-build/ninja/archive/refs/tags/v1.13.2.tar.gz") +builddep("shortcut/c++") + def build(): os.system("./configure.py --bootstrap") diff --git a/packages/openssh/pkgbuild.py b/packages/openssh/pkgbuild.py index d55f8fb..b65e0d2 100644 --- a/packages/openssh/pkgbuild.py +++ b/packages/openssh/pkgbuild.py @@ -4,6 +4,11 @@ from lib.make import * version("10.3.1") source_url("https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.3p1.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") + def build(): cpp.configure( diff --git a/packages/patch/pkgbuild.py b/packages/patch/pkgbuild.py index c4cd529..b00a10e 100644 --- a/packages/patch/pkgbuild.py +++ b/packages/patch/pkgbuild.py @@ -6,6 +6,8 @@ from lib.make import * version("15.1.1") source_url("https://gitea.semilabs.org/semios/patch/archive/v15.1.1.tar.gz") +builddep("shortcut/c") + def build(): subprocess.run(["./build.sh"], check=True) diff --git a/packages/pcre2/pkgbuild.py b/packages/pcre2/pkgbuild.py index c8763b6..348ba7b 100644 --- a/packages/pcre2/pkgbuild.py +++ b/packages/pcre2/pkgbuild.py @@ -30,6 +30,6 @@ package("pcre2-tools") dep("libpcre2 (same)") cpp.use_auto_pack(["bin"]) -dep("libpcre2-dev") +package("libpcre2-dev") dep("semi-libc @same-arch") cpp.use_auto_pack(["dev"]) diff --git a/packages/perl/pkgbuild.py b/packages/perl/pkgbuild.py index 06e5719..4496bad 100644 --- a/packages/perl/pkgbuild.py +++ b/packages/perl/pkgbuild.py @@ -9,6 +9,9 @@ upstream_version = "5.42.2" version(upstream_version) source_url("https://www.cpan.org/src/5.0/perl-5.42.2.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + block_hook("autolink") diff --git a/packages/pkgconf/pkgbuild.py b/packages/pkgconf/pkgbuild.py index 3f75137..07b1cd3 100644 --- a/packages/pkgconf/pkgbuild.py +++ b/packages/pkgconf/pkgbuild.py @@ -5,6 +5,9 @@ from lib.make import * version("2.5.1") source_url("https://distfiles.ariadne.space/pkgconf/pkgconf-2.5.1.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/python/pkgbuild.py b/packages/python/pkgbuild.py index 19b1a1d..1a893f0 100644 --- a/packages/python/pkgbuild.py +++ b/packages/python/pkgbuild.py @@ -1,6 +1,5 @@ import os import shutil -import subprocess from lib import arch, cpp from lib.make import * @@ -15,6 +14,19 @@ source_url( f"https://www.python.org/ftp/python/{VERSION_FULL}/Python-{VERSION_FULL}.tar.xz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"liblzma-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"libexpat-dev @{arch.get_target()}") +builddep(f"libsqlite-dev @{arch.get_target()}") +builddep(f"libncurses-dev @{arch.get_target()}") +builddep(f"libbzip2-dev @{arch.get_target()}") +builddep(f"libffi-dev @{arch.get_target()}") +builddep("pkgconf") + def build(): cpp.configure( diff --git a/packages/rhash/pkgbuild.py b/packages/rhash/pkgbuild.py index 14baffd..af2d8c9 100644 --- a/packages/rhash/pkgbuild.py +++ b/packages/rhash/pkgbuild.py @@ -4,6 +4,9 @@ from lib.make import * version("1.4.6") source_url("https://github.com/rhash/RHash/archive/refs/tags/v1.4.6.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( diff --git a/packages/ripgrep/pkgbuild.py b/packages/ripgrep/pkgbuild.py index e2e60a1..c1e4502 100644 --- a/packages/ripgrep/pkgbuild.py +++ b/packages/ripgrep/pkgbuild.py @@ -4,6 +4,8 @@ from lib.make import * version("15.1.0") source_url("https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.1.0.tar.gz") +builddep("shortcut/rust") + def build(): rust.build() diff --git a/packages/sed/pkgbuild.py b/packages/sed/pkgbuild.py index 8d721e1..933b63f 100644 --- a/packages/sed/pkgbuild.py +++ b/packages/sed/pkgbuild.py @@ -5,6 +5,10 @@ from lib.make import * version("15.1.1") source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz") +builddep("shortcut/c") +builddep(f"libpcre2-dev @{arch.get_target()}") +builddep("pcre2-tools") + def build(): subprocess.run(["./build.sh"]) diff --git a/packages/semi-libc/pkgbuild.py b/packages/semi-libc/pkgbuild.py index 1a0da63..aebdc6d 100644 --- a/packages/semi-libc/pkgbuild.py +++ b/packages/semi-libc/pkgbuild.py @@ -5,6 +5,10 @@ version("1.2.6+1") source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") + + def build(): cpp.configure(["--prefix=/"]) cpp.make() diff --git a/packages/sqlite/pkgbuild.py b/packages/sqlite/pkgbuild.py index 8d8d8f3..621be52 100644 --- a/packages/sqlite/pkgbuild.py +++ b/packages/sqlite/pkgbuild.py @@ -1,9 +1,15 @@ +import os + import lib.cpp as cpp from lib.make import * version("3.53.2") source_url("https://sqlite.org/2026/sqlite-autoconf-3530200.tar.gz") +builddep("shortcut/autotools") +builddep("shortcut/c") +builddep("linenoise-dev") + def build(): cpp.configure( diff --git a/packages/vim/pkgbuild.py b/packages/vim/pkgbuild.py index df86422..b8abdd7 100644 --- a/packages/vim/pkgbuild.py +++ b/packages/vim/pkgbuild.py @@ -6,6 +6,10 @@ upstream_version = "9.2.782" version(upstream_version) source_url("https://github.com/vim/vim/archive/refs/tags/v9.2.0782.tar.gz") +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libncurses-dev @{arch.get_target()}") + def build(): cpp.configure( diff --git a/packages/xz/pkgbuild.py b/packages/xz/pkgbuild.py index c368342..a98fae2 100644 --- a/packages/xz/pkgbuild.py +++ b/packages/xz/pkgbuild.py @@ -1,3 +1,5 @@ +import os + from lib import cpp from lib.make import * @@ -6,8 +8,12 @@ source_url( "https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): + os.environ["FGREP"] = "grep -F" cpp.configure( [ "--prefix=/", diff --git a/packages/zlib-ng/pkgbuild.py b/packages/zlib-ng/pkgbuild.py index 1acdf4c..29de6fe 100644 --- a/packages/zlib-ng/pkgbuild.py +++ b/packages/zlib-ng/pkgbuild.py @@ -6,6 +6,8 @@ from lib.make import * version("2.3.3") source_url("https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.3.3.tar.gz") +builddep("shortcut/c++") + def build(): cpp.cmake(["-DZLIB_COMPAT=ON", "-DINSTALL_UTILS=ON"]) diff --git a/packages/zstd/pkgbuild.py b/packages/zstd/pkgbuild.py index 7ae1452..aa43df5 100644 --- a/packages/zstd/pkgbuild.py +++ b/packages/zstd/pkgbuild.py @@ -8,6 +8,9 @@ source_url( "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.make(["HAVE_ZLIB=0", "HAVE_LZMA=0", "HAVE_LZ4=0"]) diff --git a/x.py b/x.py index 4460a4f..f1ebe41 100644 --- a/x.py +++ b/x.py @@ -7,7 +7,9 @@ import typing import hooks import lib.arch +import lib.atombuild import lib.make +import lib.packie import lib.pkgcomposer import lib.sources @@ -20,6 +22,7 @@ argparser = argparse.ArgumentParser( argparser.add_argument( "--target", type=str, help="Target architecture to build the package for" ) +argparser.add_argument("--atombuild", action="store_true", help="Enable Atom Build") subparsers = argparser.add_subparsers(dest="subcommand") parser_build = subparsers.add_parser("build") parser_build.add_argument("BUILD_PKGNAME") @@ -64,6 +67,9 @@ def run_build_package(package: str): print(f"Architecture {lib.arch.get_target()} is not supported for this package") exit(1) + if os.environ.get("SEMIOS_PKGBUILD_IN_ATOMIC", "0") == "1": + lib.packie.install(lib.make._builddep) + # Run `pre_build` hooks run_hooks(hooks.pre_build) @@ -151,8 +157,48 @@ def run_list(item): print(i) +def run_build_atom(pkgname: str): + # Declare necessary paths + repo_root = os.getcwd() + package_dir = f"{repo_root}/packages/{pkgname}" + target_dir = f"{package_dir}/target" + build_env_root = f"{target_dir}/atombuild_root" + + # Read `pkgbuild.py` of that package + lib.make._in_atombuild = True + try: + os.chdir(package_dir) + os.makedirs(target_dir, exist_ok=True) + except Exception: + print(f"No such package {pkgname}") + exit(1) + importlib.import_module(f"packages.{pkgname}.pkgbuild") + os.chdir(repo_root) + + # Initialize build environment + lib.atombuild.prepare_build_env(build_env_root, lib.make._builddep) + lib.atombuild.copy_pkgbuild_tree(repo_root, pkgname, build_env_root) + lib.atombuild.enter_build_env( + build_env_root, + ["./x", "--target", lib.arch.get_target(), "build", pkgname], + chdir="/Atom", + ) + + # Copy artifacts + atom_target_dir = f"{build_env_root}/Atom/packages/{pkgname}/target" + try: + for i in os.listdir(atom_target_dir): + if i.endswith(".pkg"): + shutil.copy2(f"{atom_target_dir}/{i}", f"{target_dir}/{i}") + except Exception: + pass + + if args.subcommand == "build": - run_build_package(args.BUILD_PKGNAME) + if args.atombuild: + run_build_atom(args.BUILD_PKGNAME) + else: + run_build_package(args.BUILD_PKGNAME) elif args.subcommand == "clean": run_clean_package(args.CLEAN_PKGNAME) elif args.subcommand == "list": -- 2.55.0 From b0185d379b448af3a37e187a99ce7049a5e5257a Mon Sep 17 00:00:00 2001 From: sisungo Date: Wed, 8 Jul 2026 01:00:53 +0800 Subject: [PATCH 41/86] feat: add pkgmanifest recommendations support Signed-off-by: sisungo --- lib/make.py | 16 +++++++++++++--- x.py | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/make.py b/lib/make.py index 433a5ea..c87fbbe 100644 --- a/lib/make.py +++ b/lib/make.py @@ -11,6 +11,7 @@ _key_on_pack = "on_pack" _key_arch_any = "arch_any" _key_links = "links" _key_dependencies = "dependencies" +_key_recommendations = "recommendations" _key_provides = "provides" _current_pkgname: str = _key_global @@ -19,6 +20,7 @@ _pkginfo: dict[str, dict[str, typing.Any]] = { _key_links: [], _key_dependencies: [], _key_provides: [], + _key_recommendations: [], }, } _supported_arch: typing.Callable[[str], bool] = lambda x: True @@ -73,12 +75,20 @@ def provide(s: str): ] -def dep(s: str): - _pkginfo[_current_pkgname][_key_dependencies] += [ +def _translate_dep_spec(s: str) -> str: + return ( s.replace("(same)", "(same-version) @same-arch") .replace("(same-version)", f"(={_pkginfo[_current_pkgname][_key_version]})") .replace("@same-arch", f"@{arch.get_target()}") - ] + ) + + +def dep(s: str): + _pkginfo[_current_pkgname][_key_dependencies] += [_translate_dep_spec(s)] + + +def recommend(s: str): + _pkginfo[_current_pkgname][_key_recommendations] += [_translate_dep_spec(s)] def link(src: str, dst: str, default: bool = True): diff --git a/x.py b/x.py index f1ebe41..7215caf 100644 --- a/x.py +++ b/x.py @@ -115,6 +115,7 @@ def run_build_package(package: str): "arch": pkgarch, "dependencies": pkginfo[lib.make._key_dependencies], "provides": pkginfo[lib.make._key_provides], + "recommendations": pkginfo[lib.make._key_recommendations], } composer.write_manifest(manifest) composer.write_links(pkginfo[lib.make._key_links]) -- 2.55.0 From 5dece05466d0d0be07d2590352d358f25d8784ab Mon Sep 17 00:00:00 2001 From: sisungo Date: Wed, 8 Jul 2026 16:42:22 +0800 Subject: [PATCH 42/86] feat: support adding package to repository Signed-off-by: sisungo --- lib/packie.py | 6 +++++ x.py | 65 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/lib/packie.py b/lib/packie.py index 35c012a..d50ded9 100644 --- a/lib/packie.py +++ b/lib/packie.py @@ -29,3 +29,9 @@ def update(): def install(requirements: list[str]): subprocess.run([PACKIE_EXEC, "install", "--yes"] + requirements, check=True) + + +def repo_add(repo: str, pkgfile: str): + subprocess.run( + [PACKIE_EXEC, "repo-admin", repo, "--add-package", pkgfile], check=True + ) diff --git a/x.py b/x.py index f1ebe41..5ff5fd0 100644 --- a/x.py +++ b/x.py @@ -27,9 +27,13 @@ subparsers = argparser.add_subparsers(dest="subcommand") parser_build = subparsers.add_parser("build") parser_build.add_argument("BUILD_PKGNAME") parser_clean = subparsers.add_parser("clean") -parser_clean.add_argument("CLEAN_PKGNAME") +parser_clean.add_argument("CLEAN_PKGNAME", nargs="*") +parser_clean.add_argument("--all", action="store_true") parser_list = subparsers.add_parser("list") parser_list.add_argument("ITEM", choices=("all", "built", "new")) +parser_repo_push = subparsers.add_parser("repo-push") +parser_repo_push.add_argument("REPO_DIR") +parser_repo_push.add_argument("REPO_PUSH_PKGNAME", nargs="*") args = argparser.parse_args() if args.target: @@ -50,7 +54,7 @@ def run_hooks(map, arg: typing.Any = None): os.chdir(current_dir) -def run_build_package(package: str): +def cmd_build_package(package: str): try: os.chdir(f"packages/{package}") os.makedirs("target", exist_ok=True) @@ -125,25 +129,26 @@ def run_build_package(package: str): file.write("OK") -def run_clean_package(package: str): - try: - shutil.rmtree(f"packages/{package}/target") - except Exception: - pass +def cmd_clean_package(package: list[str]): + for i in package: + try: + shutil.rmtree(f"packages/{i}/target") + except Exception: + pass -def run_list(item): +def do_list(item: str): if item == "all": for i in os.listdir("packages"): if i.startswith("."): continue - print(i) + yield i elif item == "built": for i in os.listdir("packages"): if i.startswith("."): continue if os.path.exists(f"packages/{i}/target/build-ok.tag"): - print(i) + yield i elif item == "new": for i in os.listdir("packages"): if i.startswith("."): @@ -152,12 +157,17 @@ def run_list(item): pkgbuild_mtime = os.path.getmtime(f"packages/{i}/pkgbuild.py") target_mtime = os.path.getmtime(f"packages/{i}/target/build-ok.tag") if target_mtime < pkgbuild_mtime: - print(i) + yield i except Exception: - print(i) + yield i -def run_build_atom(pkgname: str): +def cmd_list(item): + for i in do_list(item): + print(i) + + +def cmd_build_atom(pkgname: str): # Declare necessary paths repo_root = os.getcwd() package_dir = f"{repo_root}/packages/{pkgname}" @@ -194,15 +204,36 @@ def run_build_atom(pkgname: str): pass +def cmd_repo_push(repo_dir: str, pkgname: list[str]): + for pkg in pkgname: + targetdir = f"packages/{pkg}/target" + if not os.path.exists(targetdir): + print(f"error: failed to add '{pkg}': package is not built") + continue + for target_file in os.listdir(targetdir): + if not target_file.endswith(".pkg"): + continue + try: + lib.packie.repo_add(repo_dir, f"{targetdir}/{target_file}") + except: + print(f"error: failed to add '{pkg}': see the output above") + + if args.subcommand == "build": if args.atombuild: - run_build_atom(args.BUILD_PKGNAME) + cmd_build_atom(args.BUILD_PKGNAME) else: - run_build_package(args.BUILD_PKGNAME) + cmd_build_package(args.BUILD_PKGNAME) elif args.subcommand == "clean": - run_clean_package(args.CLEAN_PKGNAME) + if args.all: + pkgs = os.listdir("packages") + else: + pkgs = args.CLEAN_PKGNAME + cmd_clean_package(pkgs) elif args.subcommand == "list": - run_list(args.ITEM) + cmd_list(args.ITEM) +elif args.subcommand == "repo-push": + cmd_repo_push(args.REPO_DIR, args.REPO_PUSH_PKGNAME) else: print("error: no action specified", file=sys.stderr) exit(1) -- 2.55.0 From 07c93dac59e2dc23181d303f55002895e6026f27 Mon Sep 17 00:00:00 2001 From: sisungo Date: Wed, 8 Jul 2026 17:15:21 +0800 Subject: [PATCH 43/86] feat: add package less Signed-off-by: sisungo --- packages/less/pkgbuild.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/less/pkgbuild.py diff --git a/packages/less/pkgbuild.py b/packages/less/pkgbuild.py new file mode 100644 index 0000000..2bbfb1c --- /dev/null +++ b/packages/less/pkgbuild.py @@ -0,0 +1,23 @@ +from lib import arch, cpp +from lib.make import * + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libncurses-dev @{arch.get_target()}") + +version("704") +source_url("https://www.greenwoodsoftware.com/less/less-704.tar.gz") + + +def build(): + cpp.configure([f"--prefix={get_prefix('less')}", "--with-regex=posix"]) + cpp.make() + cpp.make_install() + + +on_build(build) + +package("less") +dep("semi-libc @same-arch") +dep("libncurses @same-arch") +cpp.use_auto_pack(["bin"]) -- 2.55.0 From e567c27db8cf91b6366eb95ab5b3efbd1e823f93 Mon Sep 17 00:00:00 2001 From: sisungo Date: Wed, 8 Jul 2026 18:57:44 +0800 Subject: [PATCH 44/86] feat: support cleaning without removing artifacts Signed-off-by: sisungo --- packages/bzip2/pkgbuild.py | 2 +- x.py | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/bzip2/pkgbuild.py b/packages/bzip2/pkgbuild.py index 5fd7bd5..606973c 100644 --- a/packages/bzip2/pkgbuild.py +++ b/packages/bzip2/pkgbuild.py @@ -20,7 +20,7 @@ def build(): shutil.rmtree("../cpp_install") except Exception: pass - cpp.make_install(["PREFIX=../cpp_install" + makevars], chdir=False) + cpp.make_install(["PREFIX=../cpp_install"] + makevars, chdir=False) shutil.copy2( f"libbz2.so.{upstream_version}", f"../cpp_install/lib/libbz2.so.{upstream_version}", diff --git a/x.py b/x.py index ff3a37a..3484849 100644 --- a/x.py +++ b/x.py @@ -29,6 +29,7 @@ parser_build.add_argument("BUILD_PKGNAME") parser_clean = subparsers.add_parser("clean") parser_clean.add_argument("CLEAN_PKGNAME", nargs="*") parser_clean.add_argument("--all", action="store_true") +parser_clean.add_argument("--no-artifacts", action="store_true") parser_list = subparsers.add_parser("list") parser_list.add_argument("ITEM", choices=("all", "built", "new")) parser_repo_push = subparsers.add_parser("repo-push") @@ -132,10 +133,21 @@ def cmd_build_package(package: str): def cmd_clean_package(package: list[str]): for i in package: - try: - shutil.rmtree(f"packages/{i}/target") - except Exception: - pass + targetdir = f"packages/{i}/target" + if not os.path.exists(targetdir): + continue + if args.no_artifacts: + for file in os.listdir(targetdir): + path = f"{targetdir}/{file}" + if file.endswith(".pkg") or file == "build-ok.tag": + continue + if os.path.isfile(path) or os.path.islink(path): + os.remove(path) + else: + shutil.rmtree(path) + + else: + shutil.rmtree(targetdir) def do_list(item: str): @@ -204,6 +216,10 @@ def cmd_build_atom(pkgname: str): except Exception: pass + # Build success + with open(f"{target_dir}/build-ok.tag", "wt+") as file: + file.write("OK") + def cmd_repo_push(repo_dir: str, pkgname: list[str]): for pkg in pkgname: -- 2.55.0 From 7e888b840886d0812730e067a6182b6b2125f69c Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 10 Jul 2026 00:59:02 +0800 Subject: [PATCH 45/86] feat: update multiple packages Signed-off-by: sisungo --- packages/file/pkgbuild.py | 10 +++++++++- packages/git/pkgbuild.py | 3 ++- packages/libffi/pkgbuild.py | 3 ++- packages/libgcc-compat/pkgbuild.py | 4 ++-- packages/linux/pkgbuild.py | 2 +- packages/llvm-project/pkgbuild.py | 13 +++++++------ packages/llvm-project/wrapper/clang++.wrapper | 6 +++++- packages/llvm-project/wrapper/clang.wrapper | 2 ++ packages/mksh/pkgbuild.py | 2 +- packages/ninja/pkgbuild.py | 3 ++- packages/pcre2/pkgbuild.py | 3 +++ 11 files changed, 36 insertions(+), 15 deletions(-) diff --git a/packages/file/pkgbuild.py b/packages/file/pkgbuild.py index e72d3c5..bd9ee70 100644 --- a/packages/file/pkgbuild.py +++ b/packages/file/pkgbuild.py @@ -1,6 +1,6 @@ import subprocess -from lib import cpp +from lib import arch, cpp from lib.make import * VERSION = "5.48" @@ -10,6 +10,10 @@ source_git("https://github.com/file/file.git", "FILE5_48") builddep("shortcut/c") builddep("shortcut/autotools") +builddep(f"libz-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"liblzma-dev @{arch.get_target()}") +builddep(f"libbzip2-dev @{arch.get_target()}") def build(): @@ -35,6 +39,10 @@ on_pack(pack_magic_db) package("libmagic") dep("semi-libc @same-arch") dep("file-magic-db (same-version) @any") +dep("libz @same-arch") +dep("libzstd @same-arch") +dep("liblzma @same-arch") +dep("libbzip2 @same-arch") cpp.use_auto_pack(["lib"]) package("libmagic-dev") diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index 3dc11a5..8220896 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -8,7 +8,8 @@ source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") builddep("shortcut/c") builddep("shortcut/autotools") -builddep(f"libz-dev {arch.get_target()}") +builddep(f"libintl-dev @{arch.get_target()}") +builddep(f"libz-dev @{arch.get_target()}") def build(): diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py index 11a3d71..fddee80 100644 --- a/packages/libffi/pkgbuild.py +++ b/packages/libffi/pkgbuild.py @@ -1,4 +1,4 @@ -from lib import cpp +from lib import arch, cpp from lib.make import * version("3.6.0") @@ -8,6 +8,7 @@ source_url( builddep("shortcut/c") builddep("shortcut/autotools") +builddep(f"linux-dev @{arch.get_target()}") def build(): diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py index 9f07397..4a1920d 100644 --- a/packages/libgcc-compat/pkgbuild.py +++ b/packages/libgcc-compat/pkgbuild.py @@ -8,8 +8,8 @@ version("0.1.0") source_url(f"file://{os.getcwd()}/empty.tar") builddep("shortcut/c") -builddep(f"libunwind-dev {arch.get_target()}") -builddep(f"linux-dev {arch.get_target()}") +builddep(f"libunwind-dev @{arch.get_target()}") +builddep(f"linux-dev @{arch.get_target()}") def build(): diff --git a/packages/linux/pkgbuild.py b/packages/linux/pkgbuild.py index 84badfe..3f20c90 100644 --- a/packages/linux/pkgbuild.py +++ b/packages/linux/pkgbuild.py @@ -5,7 +5,7 @@ import lib.arch as arch import lib.cpp as cpp from lib.make import * -upstream_version = "6.18.35" +upstream_version = "6.18.38" version(f"{upstream_version}") source_url( diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index a9989ef..d5c9ce5 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -2,7 +2,7 @@ import glob import os import subprocess -upstream_version = "22.1.7" +upstream_version = "22.1.8" [upstream_major, upstream_minor, upstream_rev] = upstream_version.split(".") # Begin of file lists @@ -153,9 +153,9 @@ import lib.cpp as cpp from lib import arch from lib.make import * -version("22.1.7") +version(upstream_version) source_url( - "https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.7/llvm-project-22.1.7.src.tar.xz" + f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{upstream_version}/llvm-project-{upstream_version}.src.tar.xz" ) @@ -164,6 +164,7 @@ def llvm_host_triple(): def build(): + os.environ["CXXFLAGS"] = os.environ.get("CXXFLAGS", "") + " --rtlib=compiler-rt" subprocess.run( [ "cmake", @@ -380,10 +381,10 @@ 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.makedirs(f"lib/clang/{upstream_major}/lib") composer.add_dir( - f"lib/clang/22/lib/{llvm_host_triple()}", - f"lib/clang/22/lib/{llvm_host_triple()}", + f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}", + f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}", ) diff --git a/packages/llvm-project/wrapper/clang++.wrapper b/packages/llvm-project/wrapper/clang++.wrapper index 19e3cf3..214df0f 100644 --- a/packages/llvm-project/wrapper/clang++.wrapper +++ b/packages/llvm-project/wrapper/clang++.wrapper @@ -5,9 +5,13 @@ ARCHITECTURE= CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang -exec ${CLANG} -x c++ \ +exec ${CLANG} \ + -Wno-unused-command-line-argument \ + -isystem /lib/${ARCHITECTURE}/include/c++/v1 \ -isystem /lib/${ARCHITECTURE}/include \ -stdlib=libc++ \ -rtlib=compiler-rt \ -B /lib/${ARCHITECTURE} \ + -lc++ \ + -Wunused-command-line-argument \ "$@" diff --git a/packages/llvm-project/wrapper/clang.wrapper b/packages/llvm-project/wrapper/clang.wrapper index 42d1035..a582d25 100644 --- a/packages/llvm-project/wrapper/clang.wrapper +++ b/packages/llvm-project/wrapper/clang.wrapper @@ -6,7 +6,9 @@ ARCHITECTURE= CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang exec ${CLANG} \ + -Wno-unused-command-line-argument \ -isystem /lib/${ARCHITECTURE}/include \ -rtlib=compiler-rt \ -B /lib/${ARCHITECTURE} \ + -Wunused-command-line-argument \ "$@" diff --git a/packages/mksh/pkgbuild.py b/packages/mksh/pkgbuild.py index 8a54259..8e0e248 100644 --- a/packages/mksh/pkgbuild.py +++ b/packages/mksh/pkgbuild.py @@ -8,7 +8,7 @@ source_url( ) builddep("shortcut/c") -builddep("sed") +builddep("gnu-sed") def build(): diff --git a/packages/ninja/pkgbuild.py b/packages/ninja/pkgbuild.py index 1771e06..5f02134 100644 --- a/packages/ninja/pkgbuild.py +++ b/packages/ninja/pkgbuild.py @@ -6,10 +6,11 @@ version("1.13.2") source_url("https://github.com/ninja-build/ninja/archive/refs/tags/v1.13.2.tar.gz") builddep("shortcut/c++") +builddep("sed") def build(): - os.system("./configure.py --bootstrap") + os.system("python3 ./configure.py --bootstrap") on_build(build) diff --git a/packages/pcre2/pkgbuild.py b/packages/pcre2/pkgbuild.py index 348ba7b..aa9b7d0 100644 --- a/packages/pcre2/pkgbuild.py +++ b/packages/pcre2/pkgbuild.py @@ -6,6 +6,9 @@ source_url( "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/pcre2-10.47.tar.gz" ) +builddep("shortcut/c") +builddep("shortcut/autotools") + def build(): cpp.configure( -- 2.55.0 From eea8869aa5116a6b8163e945c06759040f8e1f17 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 10 Jul 2026 03:05:02 +0800 Subject: [PATCH 46/86] feat: add package bison Signed-off-by: sisungo --- packages/bison/pkgbuild.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 packages/bison/pkgbuild.py diff --git a/packages/bison/pkgbuild.py b/packages/bison/pkgbuild.py new file mode 100644 index 0000000..148b55b --- /dev/null +++ b/packages/bison/pkgbuild.py @@ -0,0 +1,36 @@ +from lib import cpp +from lib.make import * + +version("3.7.91") +source_url("https://alpha.gnu.org/gnu/bison/bison-3.7.91.tar.xz") + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("gnu-m4") + +block_hook("autolink") + + +def build(): + cpp.configure(["--enable-relocatable"]) + cpp.make() + cpp.make_install() + + +on_build(build) + + +def pack_bison(composer): + composer.add_dir("bin", "bin") + composer.add_dir("lib", "lib") + composer.makedir("share") + composer.add_dir("share/aclocal", "share/aclocal") + composer.add_dir("share/bison", "share/bison") + + +package("bison") +dep("semi-libc @same-arch") +dep("gnu-m4") +on_pack(pack_bison) +link("bin/bison", "/bin/bison") +link("bin/yacc", "/bin/yacc", default=False) -- 2.55.0 From 6704ec11ea10efadc7fce7514f8508658aec8103 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 10 Jul 2026 16:00:19 +0800 Subject: [PATCH 47/86] fix: aws-lc pkg-config is invalid Signed-off-by: sisungo --- packages/aws-lc/pkgbuild.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index b0729d1..2cf1fd5 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -8,18 +8,26 @@ source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz") builddep("shortcut/c") +def _fix_pc(name, prefix): + filepath = f"lib/pkgconfig/{name}.pc" + with open(filepath, "r") as f: + content = f.read() + new_content = content.replace("prefix=/", f"prefix={prefix}").replace("libdir=${prefix}/usr/lib", "libdir=${prefix}/lib") + with open(filepath, "w") as f: + f.write(new_content) def build(): cpp.cmake( [ "-DBUILD_SHARED_LIBS=1", "-DCMAKE_INSTALL_PREFIX=/", - f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('aws-lc-dev')}", + f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('aws-lc-dev')}/include", ] ) cpp.ninja() cpp.ninja_install() - + _fix_pc("libssl", get_prefix("aws-lc-libssl")) + _fix_pc("libcrypto", get_prefix("aws-lc-libcrypto")) on_build(build) -- 2.55.0 From 6dd8c911a148268c6e2518a74df06efa64c0a803 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 10 Jul 2026 16:30:31 +0800 Subject: [PATCH 48/86] feat: update libgcc-compat to 0.2.0 Signed-off-by: sisungo --- packages/libgcc-compat/empty.tar | Bin 10240 -> 0 bytes packages/libgcc-compat/pkgbuild.py | 19 ++++--------------- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 packages/libgcc-compat/empty.tar diff --git a/packages/libgcc-compat/empty.tar b/packages/libgcc-compat/empty.tar deleted file mode 100644 index 6de001425961c082a8577696afc19e815781fa30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10240 zcmeIuI}XAy5CuRVB{v|pvgAAz2vHCaP6}?1BT>*qG^Cr?tfl9l=6rk1uS423eaje; z+Q?({-*c_jq#UJ`e2ige`*K^A)Wxp9`dq%$`Sk3%RIhcJF89qRfAyOO6$A(nAV7cs p0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAVA>%0&nC{6u$rf diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py index 4a1920d..70b1f2f 100644 --- a/packages/libgcc-compat/pkgbuild.py +++ b/packages/libgcc-compat/pkgbuild.py @@ -4,8 +4,8 @@ import subprocess from lib import arch from lib.make import * -version("0.1.0") -source_url(f"file://{os.getcwd()}/empty.tar") +version("0.2.0") +source_url("https://gitea.semilabs.org/semios/libgcc-compat/archive/v0.2.0.tar.gz") builddep("shortcut/c") builddep(f"libunwind-dev @{arch.get_target()}") @@ -13,19 +13,7 @@ builddep(f"linux-dev @{arch.get_target()}") 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, - ) + subprocess.run(["./build.sh"], check=True) on_build(build) @@ -34,6 +22,7 @@ on_build(build) def pack(composer): composer.makedir("lib") composer.addfile("libgcc_s.so.1", "lib/libgcc_s.so.1") + composer.addfile("libatomic.so.1", "lib/libatomic.so.1") package("libgcc-compat") -- 2.55.0 From b3d71e0a3aac54914d3242a32b6e1d2790ccd730 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 11 Jul 2026 05:45:21 +0800 Subject: [PATCH 49/86] feat: add package gnu-m4 Signed-off-by: sisungo --- packages/gnu-m4/pkgbuild.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/gnu-m4/pkgbuild.py diff --git a/packages/gnu-m4/pkgbuild.py b/packages/gnu-m4/pkgbuild.py new file mode 100644 index 0000000..1baa8e7 --- /dev/null +++ b/packages/gnu-m4/pkgbuild.py @@ -0,0 +1,29 @@ +import os + +from lib import cpp, arch +from lib.make import * + +version("1.4.21") +source_url("https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz") + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"linux-dev @{arch.get_target()}") + + +def build(): + cpp.configure( + [f"--prefix={get_prefix('gnu-m4')}", "--enable-changeword", "--disable-nls"] + ) + cpp.make() + cpp.make_install() + os.rename("bin/m4", "bin/gnu-m4") + + +on_build(build) + +package("gnu-m4") +provide("m4") +dep("semi-libc @same-arch") +cpp.use_auto_pack(["bin"]) +link("bin/gnu-m4", "/bin/m4") -- 2.55.0 From a903430180540b3ebf8afdabbadb6d2e31f70398 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 11 Jul 2026 05:46:14 +0800 Subject: [PATCH 50/86] feat: add xz and bz2 to atom basedep Signed-off-by: sisungo --- lib/atombuild.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/atombuild.py b/lib/atombuild.py index 88f8a99..ea74bd2 100644 --- a/lib/atombuild.py +++ b/lib/atombuild.py @@ -15,12 +15,14 @@ BASE_REQUIREMENTS = [ "packie", "patch", "zstd", + "libz-ng", + "liblzma", + "libbzip2", # Basic libraries "sqlite", "libgcc-compat", "libcxx", "semi-libc", - "libz-ng", # Networking "ca-certificates", "certutil", -- 2.55.0 From 6abf94ba6cbf0dbec2a780348a7537cee93144f9 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 11 Jul 2026 05:59:50 +0800 Subject: [PATCH 51/86] feat: add package libpsl Signed-off-by: sisungo --- packages/libpsl/pkgbuild.py | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packages/libpsl/pkgbuild.py diff --git a/packages/libpsl/pkgbuild.py b/packages/libpsl/pkgbuild.py new file mode 100644 index 0000000..f294dc8 --- /dev/null +++ b/packages/libpsl/pkgbuild.py @@ -0,0 +1,41 @@ +from lib import cpp, arch +from lib.make import * + +version("0.22.0") +source_url( + "https://github.com/rockdaboot/libpsl/releases/download/0.22.0/libpsl-0.22.0.tar.gz" +) + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libicu4c-dev @{arch.get_target()}") +builddep("pkgconf") + +def build(): + cpp.configure( + [ + "--prefix=/", + f"--libdir={get_prefix('libpsl')}/lib", + f"--includedir={get_prefix('libpsl-dev')}/include", + "--disable-nls", + "--enable-runtime=libicu", + ] + ) + cpp.make() + cpp.make_install() + + +on_build(build) + +package("libpsl") +dep("semi-libc @same-arch") +dep("libicu4c @same-arch") +cpp.use_auto_pack(["lib"]) + +package("libpsl-tools") +dep("libpsl (same)") +cpp.use_auto_pack(["bin"]) + +package("libpsl-dev") +dep("libpsl (same)") +cpp.use_auto_pack(["dev"]) -- 2.55.0 From 0743d92327ead936b28296e83eef2026314e8c55 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 11 Jul 2026 09:14:55 +0800 Subject: [PATCH 52/86] feat: add package curl Signed-off-by: sisungo --- packages/curl/pkgbuild.py | 102 ++++++++++++++++++ packages/llvm-project/pkgbuild.py | 2 +- packages/llvm-project/wrapper/clang++.wrapper | 2 + 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 packages/curl/pkgbuild.py diff --git a/packages/curl/pkgbuild.py b/packages/curl/pkgbuild.py new file mode 100644 index 0000000..23b94d0 --- /dev/null +++ b/packages/curl/pkgbuild.py @@ -0,0 +1,102 @@ +from lib import cpp, arch +from lib.make import * + +version("8.21.0") +source_url("https://curl.se/download/curl-8.21.0.tar.gz") + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libnghttp2-dev @{arch.get_target()}") +builddep(f"libcares-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"libbrotli-dev @{arch.get_target()}") +builddep(f"libz-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"libpsl-dev @{arch.get_target()}") + +def build(): + cpp.configure( + [ + "--prefix=/", + f"--bindir={get_prefix('curl')}/bin", + f"--libdir={get_prefix('libcurl')}/lib", + f"--includedir={get_prefix('libcurl-dev')}/include", + "--enable-optimize", + "--disable-debug", + "--enable-warnings", + "--enable-symbol-hiding", + "--enable-ares", + "--enable-http", + "--enable-ftp", + "--enable-file", + "--enable-ipfs", + "--disable-ldap", + "--disable-ldaps", + "--enable-rtsp", + "--enable-proxy", + "--enable-dict", + "--enable-telnet", + "--enable-tftp", + "--enable-pop3", + "--enable-imap", + "--enable-smb", + "--enable-smtp", + "--enable-gopher", + "--enable-mqtt", + "--disable-init-mem-debug", + "--enable-manual", + "--enable-docs", + "--enable-libcurl-option", + "--enable-ipv6", + "--enable-openssl-auto-load-config", + "--enable-ca-native", + "--enable-versioned-symbols", + "--enable-typecheck", + "--enable-verbose", + "--disable-tls-srp", + "--enable-unix-sockets", + "--enable-cookies", + "--enable-socketpair", + "--enable-http-auth", + "--enable-doh", + "--enable-mime", + "--enable-bindlocal", + "--enable-form-api", + "--enable-dateparse", + "--enable-netrc", + "--enable-progress-meter", + "--enable-get-easy-options", + "--enable-alt-svc", + "--enable-headers-api", + "--enable-hsts", + "--enable-websockets", + "--with-openssl", + "--with-nghttp2", + "--without-libidn2", + ] + ) + cpp.make() + cpp.make_install() + + +on_build(build) + +package("libcurl") +dep("semi-libc @same-arch") +dep("libpsl @same-arch") +dep("libz @same-arch") +dep("libcares @same-arch") +dep("libnghttp2 @same-arch") +dep("libssl @same-arch") +dep("libcrypto @same-arch") +dep("libzstd @same-arch") +dep("libbrotli @same-arch") +cpp.use_auto_pack(["lib"]) + +package("curl") +dep("libcurl (same)") +cpp.use_auto_pack(["bin"]) + +package("libcurl-dev") +dep("libcurl (same)") +cpp.use_auto_pack(["dev"]) diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index d5c9ce5..96f495d 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -212,7 +212,7 @@ def install_wrapper(composer, name: str, dst: str): s = f.read() s = s.replace("LLVM_VERSION=", f"LLVM_VERSION={upstream_version}").replace( "ARCHITECTURE=", "ARCHITECTURE=" + arch.get_target() - ) + ).replace("LLVM_ARCH=", "LLVM_ARCH=" + llvm_host_triple()) with open(f"{composer.workdir}/bundle/{dst}", "w") as f: f.write(s) os.chmod(f"{composer.workdir}/bundle/{dst}", 0o755) diff --git a/packages/llvm-project/wrapper/clang++.wrapper b/packages/llvm-project/wrapper/clang++.wrapper index 214df0f..bcc1b79 100644 --- a/packages/llvm-project/wrapper/clang++.wrapper +++ b/packages/llvm-project/wrapper/clang++.wrapper @@ -2,12 +2,14 @@ LLVM_VERSION= ARCHITECTURE= +LLVM_ARCH= CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang exec ${CLANG} \ -Wno-unused-command-line-argument \ -isystem /lib/${ARCHITECTURE}/include/c++/v1 \ + -isystem /lib/${ARCHITECTURE}/include/${LLVM_ARCH}/c++/v1 \ -isystem /lib/${ARCHITECTURE}/include \ -stdlib=libc++ \ -rtlib=compiler-rt \ -- 2.55.0 From 8d99e1d12a25644a5b9d2f59ec03f52a0dcf08ac Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 11 Jul 2026 16:17:17 +0800 Subject: [PATCH 53/86] feat: add package cmake Signed-off-by: sisungo --- lib/make.py | 2 + packages/cmake/pkgbuild.py | 63 ++++++++++++++++++++++++++++++++ packages/rhash/files/librhash.pc | 11 ++++++ packages/rhash/pkgbuild.py | 20 +++++++++- 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 packages/cmake/pkgbuild.py create mode 100644 packages/rhash/files/librhash.pc diff --git a/lib/make.py b/lib/make.py index c87fbbe..2638653 100644 --- a/lib/make.py +++ b/lib/make.py @@ -44,6 +44,8 @@ def builddep(s: str): elif s == "shortcut/rust": builddep("shortcut/c") _builddep += ["cargo", "rustc"] + elif s == "shortcut/cmake": + _builddep += ["cmake", "ninja"] else: _builddep += [s] diff --git a/packages/cmake/pkgbuild.py b/packages/cmake/pkgbuild.py new file mode 100644 index 0000000..bd895da --- /dev/null +++ b/packages/cmake/pkgbuild.py @@ -0,0 +1,63 @@ +import subprocess +import os + +from lib import cpp, arch +from lib.make import * + +upstream_version = "4.3.4" +[upstream_major, upstream_minor, upstream_rev] = upstream_version.split(".") + +version(upstream_version) +source_url( + "https://github.com/Kitware/CMake/releases/download/v4.3.4/cmake-4.3.4.tar.gz" +) + +builddep("shortcut/c++") +builddep("shortcut/autotools") +builddep("shortcut/cmake") +builddep(f"libcurl-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"libcurl-dev @{arch.get_target()}") +builddep(f"libexpat-dev @{arch.get_target()}") +builddep(f"libz-dev @{arch.get_target()}") +builddep(f"libbzip2-dev @{arch.get_target()}") +builddep(f"liblzma-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"libnghttp2-dev @{arch.get_target()}") +builddep(f"librhash-dev @{arch.get_target()}") +builddep(f"libarchive-dev @{arch.get_target()}") +builddep(f"linux-dev @{arch.get_target()}") + + +def build(): + os.environ["CMAKE_PREFIX_PATH"] = f"/lib/{arch.get_target()}" + cpp.cmake([ + f"-DCMAKE_INSTALL_PREFIX={get_prefix('cmake')}", + "-DCMAKE_USE_SYSTEM_CURL=ON", + "-DCMAKE_USE_SYSTEM_ZLIB=ON", + "-DCMAKE_USE_SYSTEM_ZSTD=ON", + "-DCMAKE_USE_SYSTEM_LIBRHASH=ON", + "-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON", + "-DCMAKE_USE_SYSTEM_LIBLZMA=ON", + "-DCMAKE_USE_SYSTEM_EXPAT=ON", + "-DCMAKE_USE_SYSTEM_BZIP2=ON", + ]) + cpp.ninja() + cpp.ninja_install() + + +on_build(build) + +def pack_cmake(composer): + composer.add_dir("bin", "bin") + composer.makedir("share") + composer.add_dir( + f"share/cmake-{upstream_major}.{upstream_minor}", + f"share/cmake-{upstream_major}.{upstream_minor}", + ) + +package("cmake") +dep("semi-libc @same-arch") +dep("libcxx @same-arch") +dep("libcurl @same-arch") +on_pack(pack_cmake) diff --git a/packages/rhash/files/librhash.pc b/packages/rhash/files/librhash.pc new file mode 100644 index 0000000..1f201da --- /dev/null +++ b/packages/rhash/files/librhash.pc @@ -0,0 +1,11 @@ +prefix=/ +exec_prefix=${prefix} +libdir= +includedir= + +Name: librhash +Description: LibRHash shared library +Version: +Cflags: -I${includedir} +Libs: -L${libdir} -lrhash +Libs.private: diff --git a/packages/rhash/pkgbuild.py b/packages/rhash/pkgbuild.py index af2d8c9..79c5346 100644 --- a/packages/rhash/pkgbuild.py +++ b/packages/rhash/pkgbuild.py @@ -1,25 +1,43 @@ from lib import cpp from lib.make import * -version("1.4.6") +import os + +upstream_version = "1.4.6" + +version(upstream_version) source_url("https://github.com/rhash/RHash/archive/refs/tags/v1.4.6.tar.gz") builddep("shortcut/c") builddep("shortcut/autotools") +with open("files/librhash.pc") as f: + librhash_pc = f.read() def build(): + global librhash_pc cpp.configure( [ "--prefix=/", f"--bindir={get_prefix('rhash-tools')}/bin", f"--libdir={get_prefix('librhash')}/lib", "--disable-gettext", + "--enable-lib-static", ] ) cpp.make() cpp.make_install() + os.symlink("librhash.so.1", "./lib/librhash.so") + os.makedirs("./lib/pkgconfig", exist_ok=True) + with open("./lib/pkgconfig/librhash.pc", "w+") as file: + librhash_pc = (librhash_pc + .replace("libdir=", f"libdir={get_prefix('librhash')}/lib") + .replace("includedir=", f"includedir={get_prefix('librhash-dev')}/include") + .replace("Version:", f"Version: {upstream_version}") + ) + file.write(librhash_pc) + on_build(build) -- 2.55.0 From 2b3204cb9afc96d6df7ef6d4594b74c04990e772 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 12 Jul 2026 15:05:03 +0800 Subject: [PATCH 54/86] feat: add package alsa-utils Signed-off-by: sisungo --- packages/alsa-lib/pkgbuild.py | 1 + packages/alsa-utils/pkgbuild.py | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/alsa-utils/pkgbuild.py diff --git a/packages/alsa-lib/pkgbuild.py b/packages/alsa-lib/pkgbuild.py index 538dc8e..865ae1a 100644 --- a/packages/alsa-lib/pkgbuild.py +++ b/packages/alsa-lib/pkgbuild.py @@ -8,6 +8,7 @@ source_url("https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2 builddep("shortcut/c") builddep("shortcut/autotools") +builddep(f"linux-dev @{arch.get_target()}") def build(): diff --git a/packages/alsa-utils/pkgbuild.py b/packages/alsa-utils/pkgbuild.py new file mode 100644 index 0000000..4199441 --- /dev/null +++ b/packages/alsa-utils/pkgbuild.py @@ -0,0 +1,35 @@ +from lib.make import * +from lib import cpp + +version("1.2.16") +source_url("https://www.alsa-project.org/files/pub/utils/alsa-utils-1.2.16.tar.bz2") + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("pkgconf") +builddep(f"libncurses-dev @{arch.get_target()}") +builddep(f"alsa-lib-dev @{arch.get_target()}") +builddep(f"libintl-dev @{arch.get_target()}") +builddep("gettext") + +def build(): + cpp.configure([f"--prefix={get_prefix('alsa-utils')}", "--disable-nls"]) + cpp.make() + cpp.make_install() + +on_build(build) + + +def pack_alsa_utils(composer): + composer.add_dir("bin", "bin") + composer.add_dir("sbin", "bin", merge=True) + composer.add_dir("lib", "lib") + composer.makedir("share") + composer.add_dir("share/alsa", "share/alsa") + composer.add_dir("share/sounds", "share/sounds") + +package("alsa-utils") +dep("semi-libc @same-arch") +dep("alsa-lib @same-arch") +dep("libncurses @same-arch") +on_pack(pack_alsa_utils) -- 2.55.0 From 1b2f8a2295ccd6531347d817dbf1d07958076e20 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 14 Jul 2026 15:48:08 +0800 Subject: [PATCH 55/86] feat: add package meson Signed-off-by: sisungo --- packages/meson/pkgbuild.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/meson/pkgbuild.py diff --git a/packages/meson/pkgbuild.py b/packages/meson/pkgbuild.py new file mode 100644 index 0000000..344ea7c --- /dev/null +++ b/packages/meson/pkgbuild.py @@ -0,0 +1,30 @@ +import subprocess + +from lib.make import * + +version("1.11.2") +source_url("https://github.com/mesonbuild/meson/releases/download/1.11.2/meson-1.11.2.tar.gz") + +builddep("python") + + +def build(): + subprocess.run([ + "python3", + "./packaging/create_zipapp.py", + "--outfile", + "meson", + "--interpreter", + "/bin/python3" + ]) + +on_build(build) + +def pack_meson(composer): + composer.makedir("bin") + composer.addfile("meson", "bin/meson") + +package("meson") +dep("python @same-arch") +recommend("ninja") +on_pack(pack_meson) -- 2.55.0 From e421add41de86e1247b9a0327c37213110b9309b Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 14 Jul 2026 15:56:17 +0800 Subject: [PATCH 56/86] feat (lib): add meson/cmake shortcuts Signed-off-by: sisungo --- lib/make.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/make.py b/lib/make.py index 2638653..82f0c2e 100644 --- a/lib/make.py +++ b/lib/make.py @@ -46,6 +46,8 @@ def builddep(s: str): _builddep += ["cargo", "rustc"] elif s == "shortcut/cmake": _builddep += ["cmake", "ninja"] + elif s == "shortcut/meson": + _builddep += ["meson", "ninja"] else: _builddep += [s] -- 2.55.0 From 05cb5c94c5aa06f2c5f3eed02a7b7d2f1071dd0b Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 17 Jul 2026 13:01:21 +0800 Subject: [PATCH 57/86] feat: add package glib Signed-off-by: sisungo --- lib/cpp.py | 4 +- packages/glib/pkgbuild.py | 122 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 packages/glib/pkgbuild.py diff --git a/lib/cpp.py b/lib/cpp.py index 68af147..fd9ad4b 100644 --- a/lib/cpp.py +++ b/lib/cpp.py @@ -78,7 +78,7 @@ 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): +def meson_install(rem: list[str] | None = None, chdir: bool = True, move: bool = True): default_rem = ["--destdir", f"{os.getcwd()}/../cpp_install"] if not rem: os.makedirs("../cpp_install", exist_ok=True) @@ -87,6 +87,8 @@ def meson_install(rem: list[str] | None = None, chdir: bool = True): ) if chdir: os.chdir("../cpp_install") + if chdir and move: + _move_install() def _do_auto_pack(pc: pkgcomposer.PkgComposer, srcdir: str, dstdir: str, filter): diff --git a/packages/glib/pkgbuild.py b/packages/glib/pkgbuild.py new file mode 100644 index 0000000..23affba --- /dev/null +++ b/packages/glib/pkgbuild.py @@ -0,0 +1,122 @@ +import shutil +import os + +from lib.make import * +from lib import cpp + +upstream_version = "2.89.2" + +version(upstream_version) +source_url("https://download.gnome.org/sources/glib/2.89/glib-2.89.2.tar.xz") + +builddep("shortcut/c++") +builddep("shortcut/meson") +builddep("gettext") +builddep(f"libintl-dev @{arch.get_target()}") +builddep("pcre2-tools") +builddep(f"libpcre2-dev @{arch.get_target()}") +builddep(f"libffi-dev @{arch.get_target()}") +builddep("pkgconf") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep("libexpat") + + +def build(): + os.environ["CFLAGS"] = os.environ.get("CFLAGS", "") + " -Wno-missing-include-dirs" + os.environ["CXXFLAGS"] = os.environ.get("CXXLAGS", "") + os.environ["CFLAGS"] + cpp.meson_setup([ + "-Druntime_dir=/run", + f"-Dgio_module_dir=/lib/{arch.get_target()}/gio/modules", + "--prefix=/", + f"--bindir={get_prefix('glib-tools')}/bin", + f"--libdir={get_prefix('glib')}/lib", + f"--includedir={get_prefix('glib-dev')}/include", + f"--libexecdir={get_prefix('libglib')}/libexec", + f"--datadir={get_prefix('glib')}/share", + ]) + cpp.meson_compile() + cpp.meson_install() + +on_build(build) + + +def pack_libxxx(composer, prefix): + composer.makedirs("lib") + for i in os.listdir("lib"): + if not i.startswith(prefix): + continue + composer.addfile(f"lib/{i}", f"lib/{i}") + + +def pack_libglib(composer): + composer.add_dir("libexec", "libexec") + pack_libxxx(composer, "libglib") + + +package("libglib") +dep("semi-libc @same-arch") +dep("libpcre2 @same-arch") +on_pack(pack_libglib) + + +package("libgobject") +dep("libglib (same)") +dep("libffi @same-arch") +on_pack(lambda composer: pack_libxxx(composer, "libgobject")) + +package("libgthread") +dep("libglib (same)") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_libxxx(composer, "libgthread")) + +package("libgmodule") +dep("libglib (same)") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_libxxx(composer, "libgmodule")) + +package("libgio") +dep("libglib (same)") +dep("libgobject (same)") +dep("libgmodule (same)") +dep("libz @same-arch") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_libxxx(composer, "libgio")) + +package("libgirepository") +dep("libglib (same)") +dep("libgobject (same)") +dep("libgmodule (same)") +dep("libffi @same-arch") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_libxxx(composer, "libgirepository")) + + +def pack_glib(composer): + composer.makedir("lib") + for i in os.listdir("lib"): + if not i.endswith(".so"): + continue + pkgname = i.split("-")[0] + os.symlink(f"{get_prefix(pkgname)}/lib/{i}", f"{composer.workdir}/bundle/lib/{i}") + os.symlink(f"{get_prefix('glib-dev')}/lib/glib-2.0", f"{composer.workdir}/bundle/lib/glib-2.0") + composer.add_dir("share", "share") + +package("glib") +dep("libglib (same)") +dep("libgobject (same)") +dep("libgthread (same)") +dep("libgmodule (same)") +dep("libgio (same)") +dep("libgirepository (same)") +on_pack(pack_glib) + +package("glib-tools") +dep("glib (same)") +cpp.use_auto_pack(["bin"]) + +package("glib-dev") +dep("glib (same)") +dep("libz-dev @same-arch") +dep("libpcre2-dev @same-arch") +dep("libffi-dev @same-arch") +cpp.use_auto_pack(["dev"]) -- 2.55.0 From aa19be566b221fcdc553cbc6ab2cfd619188095f Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 17 Jul 2026 13:44:09 +0800 Subject: [PATCH 58/86] feat: add package dbus Signed-off-by: sisungo --- packages/dbus/pkgbuild.py | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 packages/dbus/pkgbuild.py diff --git a/packages/dbus/pkgbuild.py b/packages/dbus/pkgbuild.py new file mode 100644 index 0000000..f0f5630 --- /dev/null +++ b/packages/dbus/pkgbuild.py @@ -0,0 +1,53 @@ +import os + +from lib.make import * +from lib import cpp + +version("1.16.2") +source_url("https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz") + +builddep("shortcut/c") +builddep("shortcut/meson") +builddep("gettext") +builddep(f"libintl-dev @{arch.get_target()}") +builddep(f"glib-dev @{arch.get_target()}") +builddep("pkgconf") + + +def build(): + cpp.meson_setup([ + "-Dapparmor=disabled", + "-Dmessage_bus=false", + "-Druntime_dir=/run", + "-Dsystemd=disabled", + "--prefix=/", + f"--libdir={get_prefix('libdbus')}/lib", + f"--bindir={get_prefix('dbus-tools')}/bin", + f"--includedir={get_prefix('libdbus-dev')}/include", + "--sysconfdir=/var/config", + "--localstatedir=/var/db/dbus", + ]) + cpp.meson_compile() + cpp.meson_install() + +on_build(build) + +def pack_libdbus(composer): + composer.makedir("lib") + for i in os.listdir("lib"): + if not ".so" in i: + continue + composer.addfile(f"lib/{i}", f"lib/{i}") + os.symlink(f"{get_prefix('libdbus-dev')}/lib/dbus-1.0", f"{composer.workdir}/bundle/lib/dbus-1.0") + +package("libdbus") +dep("semi-libc @same-arch") +on_pack(pack_libdbus) + +package("dbus-tools") +dep("libdbus (same)") +cpp.use_auto_pack(["bin"]) + +package("libdbus-dev") +dep("libdbus (same)") +cpp.use_auto_pack(["dev"]) -- 2.55.0 From a7afab336bbe3efe57922714deb0a7ea68488242 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 24 Jul 2026 15:49:11 +0800 Subject: [PATCH 59/86] feat: add package util-linux Signed-off-by: sisungo --- packages/util-linux/pkgbuild.py | 323 ++++++++++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 packages/util-linux/pkgbuild.py diff --git a/packages/util-linux/pkgbuild.py b/packages/util-linux/pkgbuild.py new file mode 100644 index 0000000..4ee7b4f --- /dev/null +++ b/packages/util-linux/pkgbuild.py @@ -0,0 +1,323 @@ +import os + +from lib.make import * +from lib import cpp + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep("gettext") +builddep("bash") +builddep(f"linux-dev @{arch.get_target()}") +builddep(f"libintl-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"libncurses-dev @{arch.get_target()}") + +version("2.42.2") +source_url("https://www.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz") + +def build(): + cpp.configure([ + "--prefix=/", + "--enable-fs-paths-default=/bin", + "--disable-su", + "--disable-sulogin", + "--disable-chfn-chsh", + "--disable-login", + "--without-systemd", + "--disable-makeinstall-setuid", + "--disable-makeinstall-chown", + "--disable-makeinstall-tty-setgid", + ]) + cpp.make() + cpp.make_install() + +on_build(build) + + +def fix_pc(libname: str): + pkgname_lib = f"lib{libname}" + pkgname_dev = f"lib{libname}-dev" + pc_path = f"lib/pkgconfig/{libname}.pc" + with open(pc_path, "r") as file: + pc_content = file.read() + pc_content = pc_content.replace( + "libdir=//lib", f"libdir={get_prefix(pkgname_lib)}/lib" + ).replace( + "includedir=//include", f"includedir={get_prefix(pkgname_dev)}/include" + ) + with open(pc_path, "wt") as file: + file.write(pc_content) + + +def pack_lib(composer, name): + composer.makedir("lib") + for i in os.listdir("lib"): + if name in i and "so" in i: + composer.addfile(f"lib/{i}", f"lib/{i}") + +def pack_dev(composer, name): + fix_pc(name) + composer.makedir("lib") + for i in os.listdir("lib"): + if name in i and "so" not in i: + composer.addfile(f"lib/{i}", f"lib/{i}") + composer.makedir("lib/pkgconfig") + composer.addfile(f"lib/pkgconfig/{name}.pc", f"lib/pkgconfig/{name}.pc") + composer.makedir("include") + for i in os.listdir("include"): + if name in i: + composer.add_dir(f"include/{i}", f"include/{i}") + +def pack_bin(composer, list): + composer.makedir("bin") + for i in list: + if i.startswith("sbin/"): + i = i.replace("sbin/", "") + composer.addfile(f"sbin/{i}", f"bin/{i}") + else: + composer.addfile(f"bin/{i}", f"bin/{i}") + +package("libblkid") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_lib(composer, "blkid")) + +package("libblkid-dev") +dep("libblkid (same)") +on_pack(lambda composer: pack_dev(composer, "blkid")) + +package("libfdisk") +dep("libuuid (same)") +dep("libblkid (same)") +on_pack(lambda composer: pack_lib(composer, "fdisk")) + +package("libfdisk-dev") +dep("libfdisk (same)") +on_pack(lambda composer: pack_dev(composer, "fdisk")) + +package("libmount") +dep("libblkid (same)") +on_pack(lambda composer: pack_lib(composer, "mount")) + +package("libmount-dev") +dep("libmount (same)") +on_pack(lambda composer: pack_dev(composer, "mount")) + +package("libsmartcols") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_lib(composer, "smartcols")) + +package("libsmartcols-dev") +dep("libsmartcols (same)") +on_pack(lambda composer: pack_dev(composer, "smartcols")) + +package("libuuid") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_lib(composer, "uuid")) + +package("libuuid-dev") +dep("libuuid (same)") +on_pack(lambda composer: pack_dev(composer, "uuid")) + +package("util-linux-swap") +dep("libblkid (same)") +dep("libmount (same)") +dep("libsmartcols (same)") +on_pack(lambda composer: pack_bin(composer, ["sbin/swaplabel", "sbin/swapoff", "sbin/swapon", "sbin/mkswap"])) + +package("util-linux-mount") +provide("mount") +dep("libmount (same)") +on_pack(lambda composer: pack_bin(composer, ["mount", "umount"])) + +package("util-linux-fdisk") +provide("fdisk") +dep("libfdisk (same)") +dep("libsmartcols (same)") +dep("libncurses @same-arch") +on_pack(lambda composer: pack_bin(composer, ["sbin/fdisk"])) + +package("util-linux-sfdisk") +provide("sfdisk") +dep("libfdisk (same)") +dep("libsmartcols (same)") +dep("libncurses @same-arch") +on_pack(lambda composer: pack_bin(composer, ["sbin/sfdisk"])) + +package("util-linux-cfdisk") +provide("cfdisk") +dep("libfdisk (same)") +dep("libsmartcols (same)") +dep("libncurses @same-arch") +on_pack(lambda composer: pack_bin(composer, ["sbin/cfdisk"])) + +package("util-linux-mkfs") +dep("semi-libc @same-arch") +dep("libz @same-arch") +provide("mkfs") +on_pack(lambda composer: pack_bin(composer, ["sbin/mkfs", "sbin/mkfs.bfs", "sbin/mkfs.cramfs", "sbin/mkfs.minix"])) + +package("util-linux-fsck") +dep("libmount (same)") +dep("libblkid (same)") +dep("libz @same-arch") +provide("fsck") +on_pack(lambda composer: pack_bin(composer, ["sbin/fsck", "sbin/fsck.cramfs", "sbin/fsck.minix"])) + +package("util-linux-fs") +dep("libblkid (same)") +dep("libsmartcols (same)") +dep("libmount (same)") +on_pack(lambda composer: pack_bin(composer, [ + "sbin/addpart", + "sbin/resizepart", + "sbin/delpart", + "sbin/partx", + "sbin/losetup", + "sbin/blkdiscard", + "sbin/blkid", + "sbin/blkpr", + "sbin/blkzone", + "sbin/blockdev", + "sbin/findfs", + "sbin/fsfreeze", + "sbin/fstrim", + "copyfilerange", + "exch", + "fadvise", + "fallocate", + "fincore", + "flock", + "getino", + "hardlink", + "mountpoint", + "namei", + "rename", + "whereis", + "sbin/pivot_root", + "sbin/switch_root", + "sbin/wipefs", + "sbin/zramctl", + "findmnt", +])) + +package("util-linux-security") +dep("libsmartcols (same)") +dep("libmount (same)") +on_pack(lambda composer: pack_bin(composer, [ + "utmpdump", + "unshare", + "last", + "lastb", + "nsenter", + "lsns", + "sbin/nologin", +])) + +package("util-linux-proc") +dep("libsmartcols (same)") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_bin(composer, [ + "uclampset", + "waitpid", + "setsid", + "setpgid", + "taskset", + "chrt", + "coresched", + "prlimit", + "renice", + "ionice", +])) + +package("util-linux-text") +dep("libncurses @same-arch") +dep("libsmartcols (same)") +on_pack(lambda composer: pack_bin(composer, [ + "bits", + "cal", + "colcrt", + "colrm", + "column", + "getopt", + "hexdump", + "look", + "mcookie", + "rev", + "ul", +])) + +package("util-linux-term") +dep("libncurses @same-arch") +on_pack(lambda composer: pack_bin(composer, [ + "setterm", + "mesg", + "script", + "scriptlive", + "scriptreplay", + "wall", + "sbin/agetty", + "sbin/ldattach", +])) + +package("util-linux-ipc") +dep("libmount (same)") +dep("libsmartcols (same)") +on_pack(lambda composer: pack_bin(composer, [ + "ipcmk", + "ipcrm", + "ipcs", + "lslocks", + "pipesz", + "dmesg", +])) + +package("util-linux-hardware") +dep("libsmartcols (same)") +dep("libncurses @same-arch") +on_pack(lambda composer: pack_bin(composer, [ + "irqtop", + "lsirq", + "lsmem", + "wdctl", + "sbin/hwclock", + "sbin/readprofile", + "sbin/rfkill", + "sbin/rtcwake", +])) + +package("isosize") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_bin(composer, ["isosize"])) + +package("util-linux-arch") +dep("semi-libc @same-arch") +on_pack(lambda composer: pack_bin(composer, ["setarch", "uname26", "linux32", "linux64"])) + +package("util-linux-uuid") +dep("libuuid (same)") +dep("libsmartcols (same)") +on_pack(lambda composer: pack_bin(composer, [ + "uuidgen", + "uuidparse", + "sbin/uuidd", +])) + +package("util-linux") +dep("util-linux-swap (same)") +dep("util-linux-mount (same)") +dep("util-linux-fdisk (same)") +dep("util-linux-sfdisk (same)") +dep("util-linux-cfdisk (same)") +dep("util-linux-mkfs (same)") +dep("util-linux-fsck (same)") +dep("util-linux-fs (same)") +dep("util-linux-security (same)") +dep("util-linux-proc (same)") +dep("util-linux-text (same)") +dep("util-linux-term (same)") +dep("util-linux-ipc (same)") +dep("util-linux-hardware (same)") +dep("isosize (same)") +dep("util-linux-arch (same)") +dep("util-linux-uuid (same)") +on_pack(lambda _composer: None) -- 2.55.0 From cfb2a07fa463eed574774a985da9c84d3b1cc677 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 24 Jul 2026 16:26:27 +0800 Subject: [PATCH 60/86] fix: kmod is missing links Signed-off-by: sisungo --- packages/kmod/pkgbuild.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/kmod/pkgbuild.py b/packages/kmod/pkgbuild.py index 7d8cb24..74bc0da 100644 --- a/packages/kmod/pkgbuild.py +++ b/packages/kmod/pkgbuild.py @@ -1,17 +1,30 @@ -import os - -import lib.cpp as cpp +from lib import cpp, arch from lib.make import * version("1.34") source_url("https://github.com/kmod-project/kmod/archive/refs/tags/v34.tar.gz") +builddep("shortcut/c") +builddep("shortcut/meson") +builddep(f"linux-dev @{arch.get_target()}") +builddep(f"libzstd-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"liblzma-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep("pkgconf") + def build(): - cpp.meson_setup() + cpp.meson_setup([ + "-Dprefix=/", + f"-Ddistconfdir={get_prefix('libkmod')}/share", + "-Dmoduledir=/lib/lkm", + "-Dtools=true", + "-Ddlopen=all", + "-Dmanpages=false", + ]) cpp.meson_compile() cpp.meson_install() - os.chdir("usr") on_build(build) @@ -19,12 +32,20 @@ on_build(build) package("libkmod") cpp.use_auto_pack(["lib"]) dep("semi-libc @same-arch") -dep("libzstd @same-arch") dep("libcrypto @same-arch") +recommend("libzstd @same-arch") +recommend("libz @same-arch") +recommend("liblzma @same-arch") package("kmod") cpp.use_auto_pack(["bin"]) dep("libkmod (same)") +link("bin/kmod", "/bin/depmod") +link("bin/kmod", "/bin/insmod") +link("bin/kmod", "/bin/lsmod") +link("bin/kmod", "/bin/modinfo") +link("bin/kmod", "/bin/modprobe") +link("bin/kmod", "/bin/rmmod") package("libkmod-dev") cpp.use_auto_pack(["dev"]) -- 2.55.0 From 3b613fc4460358bae5de0458d667b1274bd096ca Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 3 Aug 2026 18:52:58 +0800 Subject: [PATCH 61/86] fix: llvm is not well packaged Signed-off-by: sisungo --- hooks/autolink.py | 53 +- packages/llvm-project/pkgbuild.py | 640 ++++++++---------- packages/llvm-project/wrapper/clang++.wrapper | 19 - packages/llvm-project/wrapper/clang.wrapper | 14 - packages/llvm-project/wrapper/ld.lld.wrapper | 8 - 5 files changed, 324 insertions(+), 410 deletions(-) delete mode 100644 packages/llvm-project/wrapper/clang++.wrapper delete mode 100644 packages/llvm-project/wrapper/clang.wrapper delete mode 100644 packages/llvm-project/wrapper/ld.lld.wrapper diff --git a/hooks/autolink.py b/hooks/autolink.py index b3ee69b..f5f6a9d 100644 --- a/hooks/autolink.py +++ b/hooks/autolink.py @@ -3,29 +3,52 @@ import os from lib import arch, common, make, pkgcomposer +def is_abslink(path): + try: + return os.readlink(path).startswith("/") + except: + return False + + +def autolink_bin(composer: pkgcomposer.PkgComposer): + if is_abslink("bin"): + return + for i in common.treedir("bin"): + if i.is_file() and os.access(i.path, os.X_OK): + make.link(f"bin/{i.name}", "/bin/" + i.name) + +def autolink_lib(composer: pkgcomposer.PkgComposer): + if is_abslink("lib"): + return + for i in common.treedir("lib"): + if i.is_file(): + make.link(f"lib/{i.name}", "/lib/" + arch.get_target() + "/" + i.name) + +def autolink_include(composer: pkgcomposer.PkgComposer): + if is_abslink("include"): + return + for i in common.treedir("include"): + if i.is_file(): + make.link( + f"include/{i.name}", + "/lib/" + arch.get_target() + "/include/" + i.name, + ) + + 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: + autolink_bin(composer) + except: 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: + autolink_lib(composer) + except: 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: + autolink_include(composer) + except: pass diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index 96f495d..a33558a 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -1,395 +1,327 @@ -import glob import os import subprocess +import shutil +import glob -upstream_version = "22.1.8" -[upstream_major, upstream_minor, upstream_rev] = upstream_version.split(".") - -# Begin of file lists -LLVM_TOOLS = [ - "bugpoint", - "dsymutil", - "llc", - "lli", - "llvm-addr2line", - "llvm-ar", - "llvm-as", - "llvm-bcanalyzer", - "llvm-bitcode-strip", - "llvm-bolt", - "llvm-bolt-binary-analysis", - "llvm-bolt-heatmap", - "llvm-boltdiff", - "llvm-c-test", - "llvm-cas", - "llvm-cat", - "llvm-cfi-verify", - "llvm-cgdata", - "llvm-config", - "llvm-cov", - "llvm-ctxprof-util", - "llvm-cvtres", - "llvm-cxxdump", - "llvm-cxxfilt", - "llvm-cxxmap", - "llvm-debuginfo-analyzer", - "llvm-debuginfod", - "llvm-debuginfod-find", - "llvm-diff", - "llvm-dis", - "llvm-dlltool", - "llvm-dwarfdump", - "llvm-dwarfutil", - "llvm-dwp", - "llvm-exegesis", - "llvm-extract", - "llvm-gsymutil", - "llvm-ifs", - "llvm-install-name-tool", - "llvm-ir2vec", - "llvm-jitlink", - "llvm-lib", - "llvm-libtool-darwin", - "llvm-link", - "llvm-lipo", - "llvm-lto", - "llvm-lto2", - "llvm-mc", - "llvm-mca", - "llvm-ml", - "llvm-ml64", - "llvm-modextract", - "llvm-nm", - "llvm-objcopy", - "llvm-objdump", - "llvm-offload-binary", - "llvm-offload-wrapper", - "llvm-opt-report", - "llvm-otool", - "llvm-pdbutil", - "llvm-profdata", - "llvm-profgen", - "llvm-ranlib", - "llvm-rc", - "llvm-readelf", - "llvm-readobj", - "llvm-readtapi", - "llvm-reduce", - "llvm-remarkutil", - "llvm-rtdyld", - "llvm-sim", - "llvm-size", - "llvm-split", - "llvm-stress", - "llvm-strings", - "llvm-strip", - "llvm-symbolizer", - "llvm-tblgen", - "llvm-tli-checker", - "llvm-undname", - "llvm-windres", - "llvm-xray", - "merge-fdata", - "opt", - "perf2bolt", - "reduce-chunk-list", - "sancov", - "sanstats", - "verify-uselistorder", -] -LLDB_BINARIES = [ - "lldb", - "lldb-argdumper", - "lldb-dap", - "lldb-instr", - "lldb-mcp", - "lldb-server", - "yaml2macho-core", -] -LLD_BINARIES = ["lld", "lld-link", "ld64.lld", "wasm-ld", "wrapper://ld.lld~ld.lld"] -CLANG_BINARIES = [ - f"clang-{upstream_major}~llvm-clang", - "wrapper://clang~clang", - "wrapper://clang++~clang++", - f"wrapper://clang~clang-{upstream_major}", - "clang-check", - "clang-cl", - "clang-cpp", - "clang-extdef-mapping", - "clang-format", - "clang-installapi", - "clang-linker-wrapper", - "clang-nvlink-wrapper", - "clang-offload-bundler", - "clang-offload-packager", - "clang-refactor", - "clang-repl", - "clang-scan-deps", - "clang-sycl-linker", - "clang-tblgen", - "diagtool", - "git-clang-format", - "hmaptool", - "intercept-build", - "amdgpu-arch", - "c-index-test", - "analyze-build", - "nvptx-arch", - "offload-arch", - "scan-build", - "scan-build-py", - "scan-view", - "libexec/analyze-c++", - "libexec/analyze-cc", - "libexec/c++-analyzer", - "libexec/ccc-analyzer", - "libexec/intercept-c++", - "libexec/intercept-cc", -] -# End of file lists - - -import lib.cpp as cpp -from lib import arch +import lib +from lib import arch, cpp from lib.make import * -version(upstream_version) -source_url( - f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{upstream_version}/llvm-project-{upstream_version}.src.tar.xz" -) +pkgver = "22.1.8" +[pkgver_major, pkgver_minor, pkgver_rev] = pkgver.split(".") +version(pkgver) +source_url(f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{pkgver}/llvm-project-{pkgver}.src.tar.xz") + +builddep("shortcut/c++") +builddep("shortcut/cmake") +builddep(f"linux-dev @{arch.get_target()}") +builddep(f"libffi-dev @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"libunwind-dev @{arch.get_target()}") + + +srcdir = None +packname = None def llvm_host_triple(): return arch.get_target().replace("-semios-linux", "-semios-linux-musl") +def cmake(sourcedir, args): + builddir = os.getcwd() + f"/../_build_{sourcedir}" + installdir = os.getcwd() + f"/../_cpp_install/{sourcedir}" + template_args = [ + "cmake", "-G", "Ninja", "-S", sourcedir, "-B", builddir, + "-DCMAKE_BUILD_TYPE=Release", + + f"-DLLVM_DEFAULT_TARGET_TRIPLE={llvm_host_triple()}", + f"-DLLVM_HOST_TRIPLE={llvm_host_triple()}", + + "-DLLVM_ENABLE_EH=ON", + "-DLLVM_ENABLE_RTTI=ON", + "-DLLVM_ENABLE_ASSERTIONS=OFF", + "-DLLVM_BUILD_LLVM_DYLIB=ON", + "-DLLVM_LINK_LLVM_DYLIB=ON", + + "-DLLVM_ENABLE_LIBCXX=ON", + "-DLLVM_ENABLE_LLD=ON", + "-DLLVM_ENABLE_FFI=ON", + ] + subprocess.run(template_args + args, check=True) + subprocess.run(["cmake", "--build", builddir], check=True) + os.environ["DESTDIR"] = installdir + subprocess.run(["cmake", "--install", builddir], check=True) + +def import_llvm(): + return [f"-DLLVM_ROOT={os.getcwd()}/../_cpp_install/llvm/usr/local"] + +def import_clang(): + return [f"-DClang_DIR={os.getcwd()}/../_cpp_install/clang/usr/local"] + +def enter_install(name): + global packname + packname = name + +def auto_pack_static(composer): + composer.makedir("lib") + for i in os.listdir("lib"): + if ".a" in i: + composer.addfile(f"lib/{i}", f"lib/{i}") + +def auto_pack_dev(composer, name, devbins=[], extdirs=["lib/cmake"]): + composer.add_dir("include", "include") + composer.makedir("lib") + for i in os.listdir("lib"): + prefix = None + if os.path.isdir(i) and f"lib/{i}" in extdirs: + composer.add_dir(f"lib/{i}", f"lib/{i}") + elif ".so" in i: + prefix = get_prefix(f"lib{name}") + elif ".a" in i: + prefix = get_prefix(f"lib{name}-static") + if prefix: + os.symlink(f"{prefix}/lib/{i}", f"{composer.workdir}/bundle/lib/{i}") + composer.makedir("bin") + for i in devbins: + composer.addfile(f"bin/{i}", f"bin/{i}") + for i in os.listdir("bin"): + if i in devbins: + continue + prefix = get_prefix(name) + os.symlink(f"{prefix}/bin/{i}", f"{composer.workdir}/bundle/bin/{i}") + +def auto_pack_runtime_lib(composer, name): + composer.makedir("lib") + for i in os.listdir("lib"): + if name in i and ".so" in i: + composer.addfile(f"lib/{i}", f"lib/{i}") + +def auto_pack_glob(composer, matches): + for matchable in matches: + for i in glob.glob(matchable): + composer.makedirs(f"{os.path.dirname(i)}") + if os.path.isdir(i): + composer.add_dir(i, i) + else: + composer.addfile(i, i) + + +old_on_pack = on_pack +def new_on_pack(f): + current_packname = packname + def wrap_f(composer): + pkgdir = f"{srcdir}/../_cpp_install/{current_packname}/usr/local" + os.chdir(pkgdir) + f(composer) + old_on_pack(wrap_f) +lib.make.on_pack = new_on_pack +on_pack = new_on_pack + + +def build_llvm(): + cmake("llvm", []) + +def build_bolt(): + cmake("bolt", import_llvm()) + +def build_clang(): + options = [ + "-DCLANG_DEFAULT_CXX_STDLIB=libc++", + "-DCLANG_DEFAULT_RTLIB=compiler-rt", + "-DLLVM_INCLUDE_TESTS=OFF", + ] + cmake("clang", import_llvm() + options) + +def build_lldb(): + cmake("lldb", import_llvm() + import_clang()) + +def build_lld(): + cmake("lld", import_llvm()) + +def build_polly(): + cmake("polly", import_llvm()) + +def build_runtimes(): + cflags = f"-isystem /lib/{arch.get_target()}/include -L/lib/{arch.get_target()} -B/lib/{arch.get_target()} -rtlib=compiler-rt" + shutil.rmtree("../_build_runtimes") + options = [ + # Configure runtimes + "-DLLVM_ENABLE_RUNTIMES=libunwind;libcxxabi;libcxx", + + # Configure libcxx + "-DLIBCXX_HAS_MUSL_LIBC=ON", + ] + cmake("runtimes", options) + shutil.rmtree("../_build_runtimes") + options = [ + # Configure runtimes + "-DLLVM_ENABLE_RUNTIMES=compiler-rt", + + # Configure compiler-rt + "-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON", + "-DCOMPILER_RT_BUILD_GWP_ASAN=OFF", + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF", + ] + cmake("runtimes", options) + def build(): - os.environ["CXXFLAGS"] = os.environ.get("CXXFLAGS", "") + " --rtlib=compiler-rt" - 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") - + global srcdir + srcdir = os.getcwd() + build_llvm() + build_bolt() + build_clang() + build_lldb() + build_lld() + build_polly() + build_runtimes() 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() - ).replace("LLVM_ARCH=", "LLVM_ARCH=" + llvm_host_triple()) - 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", - ] -) - +enter_install("llvm") package("libllvm") +dep("semi-libc @same-arch") +dep("libunwind @same-arch") dep("libcxx @same-arch") -use_llvm_libs_auto_pack(["libLLVM", "libLTO", "libRemarks"]) +dep("libcxxabi @same-arch") +on_pack(lambda composer: auto_pack_glob(composer, ["lib/*.so*"])) + +package("libllvm-dev") +dep("libllvm (same)") +on_pack(lambda composer: auto_pack_dev(composer, "llvm", ["llvm-config"])) + +package("libllvm-static") +on_pack(auto_pack_static) + +def pack_llvm(composer): + composer.add_dir("bin", "bin") + os.remove(f"{composer.workdir}/bundle/bin/llvm-config") + composer.add_dir("share", "share") package("llvm") dep("libllvm (same)") -use_bin_auto_pack(LLVM_TOOLS) +on_pack(pack_llvm) for i in ["strip", "ar", "ranlib", "readelf", "objcopy", "objdump", "strings", "nm"]: link(f"bin/llvm-{i}", f"/bin/{i}") -package("lld") +enter_install("bolt") + +package("bolt") 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"]) +cpp.use_auto_pack(["bin"]) -package("lldb") -dep("libcxx @same-arch") -dep("liblldb (same)") -use_bin_auto_pack(LLDB_BINARIES) - +enter_install("clang") package("libclang") -dep("libcxx @same-arch") dep("libllvm (same)") -use_llvm_libs_auto_pack(["libclang", "libclang-cpp"]) +cpp.use_auto_pack(["lib"]) +package("libclang-static") +on_pack(auto_pack_static) + +package("libclang-dev") +dep("libclang (same)") +on_pack(lambda composer: auto_pack_dev(composer, "clang")) def pack_clang(composer): - auto_pack_bin(composer, CLANG_BINARIES) - composer.makedirs(f"lib/clang/{upstream_major}/lib") - composer.add_dir( - f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}", - f"lib/clang/{upstream_major}/lib/{llvm_host_triple()}", - ) + # Add base files + composer.add_dir("bin", "bin") + composer.add_dir("libexec", "libexec") + composer.makedir("share") + for i in ["clang", "scan-build", "scan-view"]: + composer.add_dir(f"share/{i}", f"share/{i}") + # Add resource files + composer.makedir("lib") + composer.add_dir("lib/clang", "lib/clang") + + # Add compiler-rt for current architecture + linuxrtdir = "../../../runtimes/usr/local/lib/linux" + localrtdir = f"lib/clang/{pkgver_major}/lib/{llvm_host_triple()}" + composer.makedirs(localrtdir) + for rtlib in os.listdir(linuxrtdir): + larch = llvm_host_triple().split("-")[0] + lrtlib = rtlib.replace(f"-{larch}", "") + composer.addfile(f"{linuxrtdir}/{rtlib}", f"{localrtdir}/{lrtlib}") + + # Add symlink to system directories + os.symlink(f"/lib/{arch.get_target()}/include", f"{composer.workdir}/bundle/include") + + # Add configuration + clang_cfg = f"-L/lib/{arch.get_target()}\n-B/lib/{arch.get_target()}\n-rtlib=compiler-rt\n" + clangxx_cfg = f"-stdlib=libc++\n{clang_cfg}" + with open(f"{composer.workdir}/bundle/bin/clang.cfg", "wt+") as file: + file.write(clang_cfg) + with open(f"{composer.workdir}/bundle/bin/clang++.cfg", "wt+") as file: + file.write(clangxx_cfg) package("clang") dep("libclang (same)") on_pack(pack_clang) -# End of packages + +enter_install("lld") + +package("lld") +dep("libllvm (same)") +cpp.use_auto_pack(["bin"]) +link("bin/ld.lld", "/bin/ld") + +package("lld-dev") +dep("lld (same)") +cpp.use_auto_pack(["dev"]) + + +enter_install("lldb") + +package("liblldb") +dep("libclang (same)") +dep("libllvm (same)") +cpp.use_auto_pack(["lib"]) + +package("liblldb-dev") +dep("liblldb (same)") +cpp.use_auto_pack(["dev"]) + +package("lldb") +dep("liblldb (same)") +cpp.use_auto_pack(["bin"]) + + +enter_install("polly") + +package("polly") +dep("libcxx @same-arch") +on_pack(lambda composer: auto_pack_glob(composer, ["*"])) + + +enter_install("runtimes") + +package("libunwind") +dep("semi-libc @same-arch") +on_pack(lambda composer: auto_pack_runtime_lib(composer, "unwind")) + +package("libunwind-dev") +dep("libunwind (same)") +on_pack(lambda composer: auto_pack_glob(composer, ["lib/libunwind.a", "include/*unwind*", "include/mach-o"])) + +package("libcxxabi") +dep("libunwind (same)") +on_pack(lambda composer: auto_pack_runtime_lib(composer, "libc++abi")) + +package("libcxxabi-dev") +dep("libcxxabi (same)") +on_pack(lambda composer: auto_pack_glob(composer, ["lib/libc++abi.a"])) + +package("libcxx") +dep("libcxxabi (same)") +on_pack(lambda composer: auto_pack_runtime_lib(composer, "libc++")) + +package("libcxx-dev") +dep("libcxx (same)") +on_pack(lambda composer: auto_pack_glob(composer, ["lib/libc++experimental.a", "lib/libc++.a", "lib/libc++.modules.json", "include/c++", "share/libc++"])) diff --git a/packages/llvm-project/wrapper/clang++.wrapper b/packages/llvm-project/wrapper/clang++.wrapper deleted file mode 100644 index bcc1b79..0000000 --- a/packages/llvm-project/wrapper/clang++.wrapper +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -LLVM_VERSION= -ARCHITECTURE= -LLVM_ARCH= - -CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang - -exec ${CLANG} \ - -Wno-unused-command-line-argument \ - -isystem /lib/${ARCHITECTURE}/include/c++/v1 \ - -isystem /lib/${ARCHITECTURE}/include/${LLVM_ARCH}/c++/v1 \ - -isystem /lib/${ARCHITECTURE}/include \ - -stdlib=libc++ \ - -rtlib=compiler-rt \ - -B /lib/${ARCHITECTURE} \ - -lc++ \ - -Wunused-command-line-argument \ - "$@" diff --git a/packages/llvm-project/wrapper/clang.wrapper b/packages/llvm-project/wrapper/clang.wrapper deleted file mode 100644 index a582d25..0000000 --- a/packages/llvm-project/wrapper/clang.wrapper +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -LLVM_VERSION= -ARCHITECTURE= - -CLANG=$(packie print package.prefix."clang (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/llvm-clang - -exec ${CLANG} \ - -Wno-unused-command-line-argument \ - -isystem /lib/${ARCHITECTURE}/include \ - -rtlib=compiler-rt \ - -B /lib/${ARCHITECTURE} \ - -Wunused-command-line-argument \ - "$@" diff --git a/packages/llvm-project/wrapper/ld.lld.wrapper b/packages/llvm-project/wrapper/ld.lld.wrapper deleted file mode 100644 index e07ef92..0000000 --- a/packages/llvm-project/wrapper/ld.lld.wrapper +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -LLVM_VERSION= -ARCHITECTURE= - -LLD=$(packie print package.prefix."lld (=${LLVM_VERSION}) @${ARCHITECTURE}")/bin/lld - -exec ${LLD} -flavor gnu -L/lib/${ARCHITECTURE} "$@" -- 2.55.0 From 21bb0c041627a500903c3200824f209f19feda24 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 4 Aug 2026 08:36:25 +0800 Subject: [PATCH 62/86] feat: add package semios-assembly Signed-off-by: sisungo --- packages/aws-lc/pkgbuild.py | 1 + packages/mandoc/pkgbuild.py | 1 + packages/semios-assembly/empty.tar | Bin 0 -> 111 bytes packages/semios-assembly/pkgbuild.py | 42 +++++++++++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 packages/semios-assembly/empty.tar create mode 100644 packages/semios-assembly/pkgbuild.py diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index 2cf1fd5..e5a7891 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -56,6 +56,7 @@ package("aws-lc-tools") cpp.use_auto_pack(["bin"]) dep("aws-lc-libcrypto (same)") dep("aws-lc-libssl (same)") +dep("libcxx @same-arch") package("aws-lc-dev") cpp.use_auto_pack(["dev"]) diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index 95f2ded..37422b5 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -21,4 +21,5 @@ def build(): on_build(build) package("mandoc") +dep("libz @same-arch") cpp.use_auto_pack(["bin"]) diff --git a/packages/semios-assembly/empty.tar b/packages/semios-assembly/empty.tar new file mode 100644 index 0000000000000000000000000000000000000000..9f127db6105596de51df06d82bfb792f6702c5a1 GIT binary patch literal 111 zcmb2|=3oE==C|h*`3?mLuw1b9@@J^`Hn-*PO2|00{QGhaAs$E3uk$1gm7f*#+}(OM z=Ig0Bt81S{r}Qq@Jf0QocKXa(xvc-$g4y+R-X9kDd+Yk`)StV4UuA}v%fN6z-j-2D L=8ge_1_J{CVe%{n literal 0 HcmV?d00001 diff --git a/packages/semios-assembly/pkgbuild.py b/packages/semios-assembly/pkgbuild.py new file mode 100644 index 0000000..96295ea --- /dev/null +++ b/packages/semios-assembly/pkgbuild.py @@ -0,0 +1,42 @@ +import os + +from lib.make import * +from lib import arch + +def deplinux(s): + if "linux" in arch.get_target(): + dep(s) + +version("1.0.0") +source_url(f"file://{os.getcwd()}/empty.tar") + +on_build(lambda: print("Building virtual package `semios-assembly`...")) + +package("SemiOS.Assembly.CoreRuntime") +deplinux("semi-libc @same-arch") +deplinux("libgcc-compat @same-arch") +dep("libunwind @same-arch") +dep("mksh @same-arch") +dep("coreutils @same-arch") +dep("findutils @same-arch") +dep("diffutils @same-arch") +dep("grep @same-arch") +dep("packie @same-arch") +dep("iana-timezone-db") +on_pack(lambda _: print("Packing virtual package `SemiOS.Assembly.CoreRuntime`...")) + +package("SemiOS.Assembly.Cli") +dep("less @same-arch") +dep("ncurses-tools @same-arch") +dep("ncurses-terminfo") +dep("mandoc @same-arch") +dep("neatvi @same-arch") +on_pack(lambda _: print("Packing virtual package `SemiOS.Assembly.Cli`...")) + +package("SemiOS.Assembly.Networking") +dep("aws-lc-libssl @same-arch") +dep("aws-lc-tools @same-arch") +dep("ca-certificates") +dep("certutil @same-arch") +deplinux("iproute2 @same-arch") +on_pack(lambda _: print("Packing virtual package `SemiOS.Assembly.Networking`...")) -- 2.55.0 From fb5f90e0bb07be6083713c2fc2bccea9bc7c5288 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 4 Aug 2026 21:26:10 +0800 Subject: [PATCH 63/86] fix: atombuild delayed copying resolv.conf Signed-off-by: sisungo --- lib/atombuild.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/atombuild.py b/lib/atombuild.py index ea74bd2..86f9796 100644 --- a/lib/atombuild.py +++ b/lib/atombuild.py @@ -32,19 +32,32 @@ BASE_REQUIREMENTS = [ def _prepare_build_env_base_files(root: str): + # Create root directory os.makedirs(root, exist_ok=True) + + # Create var, run and tmp os.mkdir(f"{root}/var") os.mkdir(f"{root}/var/tmp") os.mkdir(f"{root}/var/run") os.mkdir(f"{root}/tmp") os.mkdir(f"{root}/run") + + # Copy repository config files os.makedirs(f"{root}/var/db/packie") shutil.copytree("/var/config/packie/repos.d", f"{root}/var/config/packie/repos.d") + + # Create directories for kernel pseudo filesystems os.mkdir(f"{root}/dev") os.mkdir(f"{root}/sys") os.mkdir(f"{root}/proc") + + # Create home directory of root (some scripts may require it) os.makedirs(f"{root}/home/root") + # Copy DNS config + os.makedirs(f"{root}/etc", exist_ok=True) + shutil.copy2("/etc/resolv.conf", f"{root}/etc/resolv.conf") + def prepare_build_env(root: str, extreq: list[str] = []): # Skip if the environment is already initialized @@ -65,10 +78,6 @@ def prepare_build_env(root: str, extreq: list[str] = []): # Refresh certificates enter_build_env(root, ["certutil", "refresh"]) - # Copy DNS config - os.makedirs(f"{root}/etc", exist_ok=True) - shutil.copy2("/etc/resolv.conf", f"{root}/etc/resolv.conf") - # Create initialized tag with open(f"{root}/.INIT", "wt+") as file: file.write("OK") -- 2.55.0 From 91b153d21b0438a7c7275f8322577e843b1ce491 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 8 Aug 2026 01:37:30 +0800 Subject: [PATCH 64/86] feat: add description to packages Signed-off-by: sisungo --- packages/airup/pkgbuild.py | 1 + packages/alsa-lib/pkgbuild.py | 1 + packages/alsa-utils/pkgbuild.py | 1 + packages/awk/pkgbuild.py | 1 + packages/aws-lc/pkgbuild.py | 1 + packages/bc/pkgbuild.py | 1 + packages/bison/pkgbuild.py | 1 + packages/bmake/pkgbuild.py | 1 + packages/brotli/pkgbuild.py | 1 + packages/byacc/pkgbuild.py | 1 + packages/bzip2/pkgbuild.py | 1 + packages/c-ares/pkgbuild.py | 1 + packages/ca-certificates/pkgbuild.py | 1 + packages/certutil/pkgbuild.py | 1 + packages/cmake/pkgbuild.py | 5 +++++ packages/coreutils/pkgbuild.py | 5 +++-- packages/curl/pkgbuild.py | 1 + packages/dbus/pkgbuild.py | 1 + packages/diffutils/pkgbuild.py | 1 + packages/expat/pkgbuild.py | 1 + packages/file/pkgbuild.py | 1 + packages/findutils/pkgbuild.py | 5 +++-- packages/flex/pkgbuild.py | 1 + packages/gettext-tiny/pkgbuild.py | 1 + packages/git/pkgbuild.py | 1 + packages/glib/pkgbuild.py | 1 + packages/gnu-m4/pkgbuild.py | 1 + packages/gnu-make/pkgbuild.py | 1 + packages/gnu-sed/pkgbuild.py | 1 + packages/grep/pkgbuild.py | 1 + packages/iana-timezone/pkgbuild.py | 1 + packages/icu4c/pkgbuild.py | 1 + packages/iproute2/pkgbuild.py | 1 + packages/kmod/pkgbuild.py | 1 + packages/less/pkgbuild.py | 1 + packages/libarchive/pkgbuild.py | 5 +++-- packages/libffi/pkgbuild.py | 5 +++-- packages/libgcc-compat/pkgbuild.py | 1 + packages/libopus/pkgbuild.py | 1 + packages/libpsl/pkgbuild.py | 5 +++-- packages/linenoise/pkgbuild.py | 1 + packages/linux/pkgbuild.py | 3 ++- packages/llvm-project/pkgbuild.py | 1 + packages/mandoc/pkgbuild.py | 1 + packages/meson/pkgbuild.py | 1 + packages/mksh/pkgbuild.py | 1 + packages/ncurses/pkgbuild.py | 1 + packages/neatvi/pkgbuild.py | 1 + packages/nextvi/pkgbuild.py | 1 + packages/nghttp2/pkgbuild.py | 5 +++-- packages/ninja/pkgbuild.py | 1 + packages/openssh/pkgbuild.py | 1 + packages/patch/pkgbuild.py | 1 + packages/pcre2/pkgbuild.py | 1 + packages/perl/pkgbuild.py | 1 + packages/pkgconf/pkgbuild.py | 1 + packages/python/pkgbuild.py | 3 ++- packages/rhash/pkgbuild.py | 1 + packages/ripgrep/pkgbuild.py | 5 +++-- packages/sed/pkgbuild.py | 1 + packages/semi-libc/pkgbuild.py | 1 + packages/semios-assembly/pkgbuild.py | 3 +++ packages/sqlite/pkgbuild.py | 5 +++-- packages/util-linux/pkgbuild.py | 1 + packages/vim/pkgbuild.py | 1 + packages/xz/pkgbuild.py | 1 + packages/zlib-ng/pkgbuild.py | 1 + packages/zstd/pkgbuild.py | 1 + 68 files changed, 92 insertions(+), 18 deletions(-) diff --git a/packages/airup/pkgbuild.py b/packages/airup/pkgbuild.py index 7303294..9d06703 100644 --- a/packages/airup/pkgbuild.py +++ b/packages/airup/pkgbuild.py @@ -5,6 +5,7 @@ from lib import rust from lib.make import * version("0.10.9") +description("Modern, portable and fast implementation of service supervisor and the init daemon.") source_url("https://github.com/sisungo/airup/archive/refs/tags/v0.10.9.tar.gz") builddep("shortcut/rust") diff --git a/packages/alsa-lib/pkgbuild.py b/packages/alsa-lib/pkgbuild.py index 865ae1a..99f7336 100644 --- a/packages/alsa-lib/pkgbuild.py +++ b/packages/alsa-lib/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * upstream_version = "1.2.16.1" version(upstream_version) +description("audio and MIDI functionality for the Linux operating system") source_url("https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2") builddep("shortcut/c") diff --git a/packages/alsa-utils/pkgbuild.py b/packages/alsa-utils/pkgbuild.py index 4199441..e58d354 100644 --- a/packages/alsa-utils/pkgbuild.py +++ b/packages/alsa-utils/pkgbuild.py @@ -2,6 +2,7 @@ from lib.make import * from lib import cpp version("1.2.16") +description("audio and MIDI functionality for the Linux operating system") source_url("https://www.alsa-project.org/files/pub/utils/alsa-utils-1.2.16.tar.bz2") builddep("shortcut/c") diff --git a/packages/awk/pkgbuild.py b/packages/awk/pkgbuild.py index 66d60f5..e530ce1 100644 --- a/packages/awk/pkgbuild.py +++ b/packages/awk/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("2026.4.26") +description("The One True Awk programming language") source_url("https://github.com/onetrueawk/awk/archive/refs/tags/20260426.tar.gz") builddep("shortcut/c") diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index e5a7891..7288f72 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -4,6 +4,7 @@ import lib.cpp as cpp from lib.make import * version("5.1.0") +description("a general-purpose cryptographic library maintained by the AWS Cryptography team") source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz") builddep("shortcut/c") diff --git a/packages/bc/pkgbuild.py b/packages/bc/pkgbuild.py index 74b5bd7..fd355d7 100644 --- a/packages/bc/pkgbuild.py +++ b/packages/bc/pkgbuild.py @@ -2,6 +2,7 @@ from lib import arch, cpp from lib.make import * version("7.0.3") +description("An implementation of the POSIX bc calculator with GNU extensions and dc") source_url("https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.gz") builddep("shortcut/c") diff --git a/packages/bison/pkgbuild.py b/packages/bison/pkgbuild.py index 148b55b..53564ab 100644 --- a/packages/bison/pkgbuild.py +++ b/packages/bison/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("3.7.91") +description("a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables") source_url("https://alpha.gnu.org/gnu/bison/bison-3.7.91.tar.xz") builddep("shortcut/c") diff --git a/packages/bmake/pkgbuild.py b/packages/bmake/pkgbuild.py index d34f501..75f08e6 100644 --- a/packages/bmake/pkgbuild.py +++ b/packages/bmake/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * VERSION = "2026.6.19" version(VERSION) +description("The BSD make utility ported to non-BSD systems") source_url("https://www.crufty.net/ftp/pub/sjg/bmake-20260619.tar.gz") builddep("shortcut/c") diff --git a/packages/brotli/pkgbuild.py b/packages/brotli/pkgbuild.py index dbca5a2..9435912 100644 --- a/packages/brotli/pkgbuild.py +++ b/packages/brotli/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("1.2.0") +description("Brotli compression format") source_url("https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz") diff --git a/packages/byacc/pkgbuild.py b/packages/byacc/pkgbuild.py index a7dbcb2..c30c2de 100644 --- a/packages/byacc/pkgbuild.py +++ b/packages/byacc/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("2.0") +description("Berkeley yacc") source_url("https://www.invisible-island.net/archives/byacc/byacc-2.0.tgz") builddep("shortcut/c") diff --git a/packages/bzip2/pkgbuild.py b/packages/bzip2/pkgbuild.py index 606973c..4c9066d 100644 --- a/packages/bzip2/pkgbuild.py +++ b/packages/bzip2/pkgbuild.py @@ -10,6 +10,7 @@ builddep("shortcut/c") builddep("shortcut/autotools") version(f"{upstream_version}") +description("a freely available, patent free, high-quality data compressor") source_url(f"https://sourceware.org/pub/bzip2/bzip2-{upstream_version}.tar.gz") diff --git a/packages/c-ares/pkgbuild.py b/packages/c-ares/pkgbuild.py index 146925a..57d8a9b 100644 --- a/packages/c-ares/pkgbuild.py +++ b/packages/c-ares/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("1.34.6") +description("A C library for asynchronous DNS requests") source_url( "https://github.com/c-ares/c-ares/releases/download/v1.34.6/c-ares-1.34.6.tar.gz" ) diff --git a/packages/ca-certificates/pkgbuild.py b/packages/ca-certificates/pkgbuild.py index a1aeef3..7f09f25 100644 --- a/packages/ca-certificates/pkgbuild.py +++ b/packages/ca-certificates/pkgbuild.py @@ -3,6 +3,7 @@ import os from lib.make import * version("2026.7.4") +description("SemiOS system-level trusted CA database") source_url( "https://gitea.semilabs.org/semios/ca-certificates/releases/download/v2026.07.04/ca-certificates-2026.07.04.tar" ) diff --git a/packages/certutil/pkgbuild.py b/packages/certutil/pkgbuild.py index 1e64a2c..33aea4b 100644 --- a/packages/certutil/pkgbuild.py +++ b/packages/certutil/pkgbuild.py @@ -2,6 +2,7 @@ from lib import rust from lib.make import * version("0.1.0") +description("SemiOS certification utility") source_url("https://gitea.semilabs.org/semios/certutil/archive/v0.1.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/cmake/pkgbuild.py b/packages/cmake/pkgbuild.py index bd895da..5c34289 100644 --- a/packages/cmake/pkgbuild.py +++ b/packages/cmake/pkgbuild.py @@ -8,6 +8,7 @@ upstream_version = "4.3.4" [upstream_major, upstream_minor, upstream_rev] = upstream_version.split(".") version(upstream_version) +description("a cross-platform, open-source build system generator") source_url( "https://github.com/Kitware/CMake/releases/download/v4.3.4/cmake-4.3.4.tar.gz" ) @@ -60,4 +61,8 @@ package("cmake") dep("semi-libc @same-arch") dep("libcxx @same-arch") dep("libcurl @same-arch") +dep("librhash @same-arch") +dep("libz @same-arch") +dep("libarchive @same-arch") +dep("libexpat @same-arch") on_pack(pack_cmake) diff --git a/packages/coreutils/pkgbuild.py b/packages/coreutils/pkgbuild.py index 4b900bf..e3baf71 100644 --- a/packages/coreutils/pkgbuild.py +++ b/packages/coreutils/pkgbuild.py @@ -1,8 +1,9 @@ import lib.rust as rust from lib.make import * -version("0.9.0") -source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.9.0.tar.gz") +version("0.10.0") +description("system core utilities") +source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.10.0.tar.gz") block_hook("autolink") builddep("shortcut/rust") diff --git a/packages/curl/pkgbuild.py b/packages/curl/pkgbuild.py index 23b94d0..b778e92 100644 --- a/packages/curl/pkgbuild.py +++ b/packages/curl/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp, arch from lib.make import * version("8.21.0") +description("command line tool and library for transferring data with URLs") source_url("https://curl.se/download/curl-8.21.0.tar.gz") builddep("shortcut/c") diff --git a/packages/dbus/pkgbuild.py b/packages/dbus/pkgbuild.py index f0f5630..af0913d 100644 --- a/packages/dbus/pkgbuild.py +++ b/packages/dbus/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * from lib import cpp version("1.16.2") +description("a message bus system, a simple way for applications to talk to one another") source_url("https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz") builddep("shortcut/c") diff --git a/packages/diffutils/pkgbuild.py b/packages/diffutils/pkgbuild.py index 12d6d2f..57c89e5 100644 --- a/packages/diffutils/pkgbuild.py +++ b/packages/diffutils/pkgbuild.py @@ -2,6 +2,7 @@ import lib.rust as rust from lib.make import * version("0.5.0") +description("utility to compute difference between text files") source_url("https://github.com/uutils/diffutils/archive/refs/tags/v0.5.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/expat/pkgbuild.py b/packages/expat/pkgbuild.py index 89feaa6..77faa2a 100644 --- a/packages/expat/pkgbuild.py +++ b/packages/expat/pkgbuild.py @@ -4,6 +4,7 @@ import lib.cpp as cpp from lib.make import * version("2.8.1") +description("Fast streaming XML parser written in C99") source_url( "https://github.com/libexpat/libexpat/releases/download/R_2_8_1/expat-2.8.1.tar.gz" ) diff --git a/packages/file/pkgbuild.py b/packages/file/pkgbuild.py index bd9ee70..a2b6341 100644 --- a/packages/file/pkgbuild.py +++ b/packages/file/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * VERSION = "5.48" version(VERSION) +description("utility to infer file type and information") source_git("https://github.com/file/file.git", "FILE5_48") builddep("shortcut/c") diff --git a/packages/findutils/pkgbuild.py b/packages/findutils/pkgbuild.py index 27f25dc..032d3f7 100644 --- a/packages/findutils/pkgbuild.py +++ b/packages/findutils/pkgbuild.py @@ -1,8 +1,9 @@ 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") +version("0.10.0") +description("implementation of the UNIX findutils") +source_url("https://github.com/uutils/findutils/archive/refs/tags/0.10.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/flex/pkgbuild.py b/packages/flex/pkgbuild.py index 9806644..54ad7cf 100644 --- a/packages/flex/pkgbuild.py +++ b/packages/flex/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("2.6.4") +description("The Fast Lexical Analyzer - scanner generator for lexing in C and C++") source_url("https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz") builddep("shortcut/c") diff --git a/packages/gettext-tiny/pkgbuild.py b/packages/gettext-tiny/pkgbuild.py index aa82d4e..4d294b4 100644 --- a/packages/gettext-tiny/pkgbuild.py +++ b/packages/gettext-tiny/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("0.3.3") +description("small implementation of gettext and libintl") source_url( "https://github.com/sabotage-linux/gettext-tiny/releases/download/v0.3.3/gettext-tiny-0.3.3.tar.xz" ) diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index 8220896..b723549 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -4,6 +4,7 @@ from lib import arch, cpp from lib.make import * version("2.55.0") +description("a free and open source distributed version control system") source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") builddep("shortcut/c") diff --git a/packages/glib/pkgbuild.py b/packages/glib/pkgbuild.py index 23affba..960b797 100644 --- a/packages/glib/pkgbuild.py +++ b/packages/glib/pkgbuild.py @@ -7,6 +7,7 @@ from lib import cpp upstream_version = "2.89.2" version(upstream_version) +description("a general-purpose, portable utility library") source_url("https://download.gnome.org/sources/glib/2.89/glib-2.89.2.tar.xz") builddep("shortcut/c++") diff --git a/packages/gnu-m4/pkgbuild.py b/packages/gnu-m4/pkgbuild.py index 1baa8e7..631c898 100644 --- a/packages/gnu-m4/pkgbuild.py +++ b/packages/gnu-m4/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp, arch from lib.make import * version("1.4.21") +description("an implementation of the traditional Unix macro processor") source_url("https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz") builddep("shortcut/c") diff --git a/packages/gnu-make/pkgbuild.py b/packages/gnu-make/pkgbuild.py index 749ec3a..0c345ce 100644 --- a/packages/gnu-make/pkgbuild.py +++ b/packages/gnu-make/pkgbuild.py @@ -2,6 +2,7 @@ import lib.cpp as cpp from lib.make import * version("4.4.1") +description("a tool which controls the generation of executables and other non-source files of a program from the program's source files") source_url("https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz") builddep("shortcut/c") diff --git a/packages/gnu-sed/pkgbuild.py b/packages/gnu-sed/pkgbuild.py index 634d4fe..e5c0fee 100644 --- a/packages/gnu-sed/pkgbuild.py +++ b/packages/gnu-sed/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("4.10") +description("a non-interactive command-line text editor") source_url("https://ftp.gnu.org/gnu/sed/sed-4.10.tar.gz") block_hook("autolink") diff --git a/packages/grep/pkgbuild.py b/packages/grep/pkgbuild.py index 7b6565d..a40f62f 100644 --- a/packages/grep/pkgbuild.py +++ b/packages/grep/pkgbuild.py @@ -3,6 +3,7 @@ import subprocess from lib.make import * version("15.1.2") +description("SemiOS file pattern searcher") source_url("https://gitea.semilabs.org/semios/grep/archive/v15.1.2.tar.gz") builddep("shortcut/c") diff --git a/packages/iana-timezone/pkgbuild.py b/packages/iana-timezone/pkgbuild.py index 5d0dfad..3d5503c 100644 --- a/packages/iana-timezone/pkgbuild.py +++ b/packages/iana-timezone/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("2026.4.22") +description("code and data that represent the history of local time for many representative locations worldwide") source_url("https://data.iana.org/time-zones/releases/tzdb-2026b.tar.lz") builddep("shortcut/c") diff --git a/packages/icu4c/pkgbuild.py b/packages/icu4c/pkgbuild.py index c8c7cdc..be8e695 100644 --- a/packages/icu4c/pkgbuild.py +++ b/packages/icu4c/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("78.3") +description("a mature, widely used set of C/C++ libraries providing Unicode and Globalization support for software applications") source_url( "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz" ) diff --git a/packages/iproute2/pkgbuild.py b/packages/iproute2/pkgbuild.py index e2d3e09..19db0df 100644 --- a/packages/iproute2/pkgbuild.py +++ b/packages/iproute2/pkgbuild.py @@ -5,6 +5,7 @@ from lib import cpp from lib.make import * version("7.1.0") +description("a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel") source_git("https://git.kernel.org/pub/scm/network/iproute2/iproute2.git", "v7.1.0") builddep("shortcut/c") diff --git a/packages/kmod/pkgbuild.py b/packages/kmod/pkgbuild.py index 74bc0da..7195349 100644 --- a/packages/kmod/pkgbuild.py +++ b/packages/kmod/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp, arch from lib.make import * version("1.34") +description("a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases") source_url("https://github.com/kmod-project/kmod/archive/refs/tags/v34.tar.gz") builddep("shortcut/c") diff --git a/packages/less/pkgbuild.py b/packages/less/pkgbuild.py index 2bbfb1c..72a2cf7 100644 --- a/packages/less/pkgbuild.py +++ b/packages/less/pkgbuild.py @@ -6,6 +6,7 @@ builddep("shortcut/autotools") builddep(f"libncurses-dev @{arch.get_target()}") version("704") +description("a free, open-source file pager") source_url("https://www.greenwoodsoftware.com/less/less-704.tar.gz") diff --git a/packages/libarchive/pkgbuild.py b/packages/libarchive/pkgbuild.py index 1975474..e4e0459 100644 --- a/packages/libarchive/pkgbuild.py +++ b/packages/libarchive/pkgbuild.py @@ -1,9 +1,10 @@ import lib.cpp as cpp from lib.make import * -version("3.8.7") +version("3.8.9") +description("Multi-format archive and compression library") source_url( - "https://github.com/libarchive/libarchive/releases/download/v3.8.7/libarchive-3.8.7.tar.gz" + "https://github.com/libarchive/libarchive/releases/download/v3.8.9/libarchive-3.8.9.tar.gz" ) builddep("shortcut/c") diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py index fddee80..4fbc518 100644 --- a/packages/libffi/pkgbuild.py +++ b/packages/libffi/pkgbuild.py @@ -1,9 +1,10 @@ from lib import arch, cpp from lib.make import * -version("3.6.0") +version("3.7.1") +description("A portable foreign-function interface library") source_url( - "https://github.com/libffi/libffi/releases/download/v3.6.0/libffi-3.6.0.tar.gz" + "https://github.com/libffi/libffi/releases/download/v3.7.1/libffi-3.7.1.tar.gz" ) builddep("shortcut/c") diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py index 70b1f2f..c578e0c 100644 --- a/packages/libgcc-compat/pkgbuild.py +++ b/packages/libgcc-compat/pkgbuild.py @@ -5,6 +5,7 @@ from lib import arch from lib.make import * version("0.2.0") +description("provides compatibility objects to gcc runtime libraries") source_url("https://gitea.semilabs.org/semios/libgcc-compat/archive/v0.2.0.tar.gz") builddep("shortcut/c") diff --git a/packages/libopus/pkgbuild.py b/packages/libopus/pkgbuild.py index ea39a12..f52ee66 100644 --- a/packages/libopus/pkgbuild.py +++ b/packages/libopus/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("1.6.1") +description("a totally open, royalty-free, highly versatile audio codec") source_url("https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz") builddep("shortcut/c") diff --git a/packages/libpsl/pkgbuild.py b/packages/libpsl/pkgbuild.py index f294dc8..a072792 100644 --- a/packages/libpsl/pkgbuild.py +++ b/packages/libpsl/pkgbuild.py @@ -1,9 +1,10 @@ from lib import cpp, arch from lib.make import * -version("0.22.0") +version("0.23.1") +description("C library for the Public Suffix List") source_url( - "https://github.com/rockdaboot/libpsl/releases/download/0.22.0/libpsl-0.22.0.tar.gz" + "https://github.com/rockdaboot/libpsl/releases/download/0.23.1/libpsl-0.23.1.tar.gz" ) builddep("shortcut/c") diff --git a/packages/linenoise/pkgbuild.py b/packages/linenoise/pkgbuild.py index 695d0bd..576420d 100644 --- a/packages/linenoise/pkgbuild.py +++ b/packages/linenoise/pkgbuild.py @@ -1,6 +1,7 @@ from lib.make import * version("2.0") +description("A small self-contained alternative to readline and libedit") source_url("https://github.com/antirez/linenoise/archive/refs/tags/2.0.tar.gz") on_build(lambda: None) diff --git a/packages/linux/pkgbuild.py b/packages/linux/pkgbuild.py index 3f20c90..4bd2b11 100644 --- a/packages/linux/pkgbuild.py +++ b/packages/linux/pkgbuild.py @@ -5,9 +5,10 @@ import lib.arch as arch import lib.cpp as cpp from lib.make import * -upstream_version = "6.18.38" +upstream_version = "6.18.43" version(f"{upstream_version}") +description("the Linux operating system kernel") source_url( f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz" ) diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index a33558a..e4bf064 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -11,6 +11,7 @@ pkgver = "22.1.8" [pkgver_major, pkgver_minor, pkgver_rev] = pkgver.split(".") version(pkgver) +description("a collection of modular and reusable compiler and toolchain technologies") source_url(f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{pkgver}/llvm-project-{pkgver}.src.tar.xz") builddep("shortcut/c++") diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index 37422b5..da9c788 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -5,6 +5,7 @@ from lib import arch, cpp from lib.make import * version("1.14.6") +description("a suite of tools compiling mdoc, the roff macro language, and man") source_url("https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz") builddep("shortcut/c") diff --git a/packages/meson/pkgbuild.py b/packages/meson/pkgbuild.py index 344ea7c..d98192d 100644 --- a/packages/meson/pkgbuild.py +++ b/packages/meson/pkgbuild.py @@ -3,6 +3,7 @@ import subprocess from lib.make import * version("1.11.2") +description("The Meson Build System") source_url("https://github.com/mesonbuild/meson/releases/download/1.11.2/meson-1.11.2.tar.gz") builddep("python") diff --git a/packages/mksh/pkgbuild.py b/packages/mksh/pkgbuild.py index 8e0e248..0ab3aef 100644 --- a/packages/mksh/pkgbuild.py +++ b/packages/mksh/pkgbuild.py @@ -3,6 +3,7 @@ import subprocess from lib.make import * version("1.59.2") +description("the MirBSD Korn Shell, a minimal and useful implementation of the POSIX shell with extensions") source_url( "https://github.com/mirabilos/mksh-cvs2git/archive/refs/tags/mksh-R59c.tar.gz" ) diff --git a/packages/ncurses/pkgbuild.py b/packages/ncurses/pkgbuild.py index 7a6fa8b..18cdc24 100644 --- a/packages/ncurses/pkgbuild.py +++ b/packages/ncurses/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("6.6") +description("the ncurses terminal library") source_url("https://invisible-island.net/archives/ncurses/ncurses-6.6.tar.gz") builddep("shortcut/c") diff --git a/packages/neatvi/pkgbuild.py b/packages/neatvi/pkgbuild.py index 971461b..255343b 100644 --- a/packages/neatvi/pkgbuild.py +++ b/packages/neatvi/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("19") +description("A vi/ex editor for editing UTF-8 text") source_url("https://github.com/aligrudi/neatvi/archive/refs/tags/19.tar.gz") builddep("shortcut/c") diff --git a/packages/nextvi/pkgbuild.py b/packages/nextvi/pkgbuild.py index 580a1e0..d073560 100644 --- a/packages/nextvi/pkgbuild.py +++ b/packages/nextvi/pkgbuild.py @@ -5,6 +5,7 @@ from lib import cpp from lib.make import * version("5.3") +description("A small vi/ex terminal text editor (neatvi rewrite)") source_url("https://github.com/kyx0r/nextvi/archive/refs/tags/5.3.tar.gz") builddep("shortcut/c") diff --git a/packages/nghttp2/pkgbuild.py b/packages/nghttp2/pkgbuild.py index f95ce79..c59b391 100644 --- a/packages/nghttp2/pkgbuild.py +++ b/packages/nghttp2/pkgbuild.py @@ -3,9 +3,10 @@ import os from lib import cpp from lib.make import * -version("1.69.0") +version("1.70.0") +description("nghttp2 - HTTP/2 C Library and tools") source_url( - "https://github.com/nghttp2/nghttp2/releases/download/v1.69.0/nghttp2-1.69.0.tar.gz" + "https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.gz" ) diff --git a/packages/ninja/pkgbuild.py b/packages/ninja/pkgbuild.py index 5f02134..da4814d 100644 --- a/packages/ninja/pkgbuild.py +++ b/packages/ninja/pkgbuild.py @@ -3,6 +3,7 @@ import os from lib.make import * version("1.13.2") +description("a small build system with a focus on speed") source_url("https://github.com/ninja-build/ninja/archive/refs/tags/v1.13.2.tar.gz") builddep("shortcut/c++") diff --git a/packages/openssh/pkgbuild.py b/packages/openssh/pkgbuild.py index b65e0d2..5cca29d 100644 --- a/packages/openssh/pkgbuild.py +++ b/packages/openssh/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("10.3.1") +description("the premier connectivity tool for remote login with the SSH protocol") source_url("https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.3p1.tar.gz") builddep("shortcut/c") diff --git a/packages/patch/pkgbuild.py b/packages/patch/pkgbuild.py index b00a10e..92740ed 100644 --- a/packages/patch/pkgbuild.py +++ b/packages/patch/pkgbuild.py @@ -4,6 +4,7 @@ import subprocess from lib.make import * version("15.1.1") +description("the SemiOS fork of the UNIX patch utility") source_url("https://gitea.semilabs.org/semios/patch/archive/v15.1.1.tar.gz") builddep("shortcut/c") diff --git a/packages/pcre2/pkgbuild.py b/packages/pcre2/pkgbuild.py index aa9b7d0..50da984 100644 --- a/packages/pcre2/pkgbuild.py +++ b/packages/pcre2/pkgbuild.py @@ -2,6 +2,7 @@ from lib import cpp from lib.make import * version("10.47") +description("a set of C functions that implement regular expression pattern matching") source_url( "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/pcre2-10.47.tar.gz" ) diff --git a/packages/perl/pkgbuild.py b/packages/perl/pkgbuild.py index 4496bad..cf7eb63 100644 --- a/packages/perl/pkgbuild.py +++ b/packages/perl/pkgbuild.py @@ -7,6 +7,7 @@ from lib.make import * upstream_version = "5.42.2" version(upstream_version) +description("Perl is a highly capable, feature-rich programming language with over 37 years of development") source_url("https://www.cpan.org/src/5.0/perl-5.42.2.tar.gz") builddep("shortcut/c") diff --git a/packages/pkgconf/pkgbuild.py b/packages/pkgconf/pkgbuild.py index 07b1cd3..51b7b78 100644 --- a/packages/pkgconf/pkgbuild.py +++ b/packages/pkgconf/pkgbuild.py @@ -3,6 +3,7 @@ from lib import arch from lib.make import * version("2.5.1") +description("package compiler and linker metadata toolkit") source_url("https://distfiles.ariadne.space/pkgconf/pkgconf-2.5.1.tar.gz") builddep("shortcut/c") diff --git a/packages/python/pkgbuild.py b/packages/python/pkgbuild.py index 1a893f0..cfe32d2 100644 --- a/packages/python/pkgbuild.py +++ b/packages/python/pkgbuild.py @@ -5,11 +5,12 @@ from lib import arch, cpp from lib.make import * VERSION_BASE = "3.14" -VERSION_APPEND = "6" +VERSION_APPEND = "7" VERSION_FULL = f"{VERSION_BASE}.{VERSION_APPEND}" version(VERSION_FULL) +description("the Python programming language") source_url( f"https://www.python.org/ftp/python/{VERSION_FULL}/Python-{VERSION_FULL}.tar.xz" ) diff --git a/packages/rhash/pkgbuild.py b/packages/rhash/pkgbuild.py index 79c5346..04fe76d 100644 --- a/packages/rhash/pkgbuild.py +++ b/packages/rhash/pkgbuild.py @@ -6,6 +6,7 @@ import os upstream_version = "1.4.6" version(upstream_version) +description("Great utility for computing hash sums") source_url("https://github.com/rhash/RHash/archive/refs/tags/v1.4.6.tar.gz") builddep("shortcut/c") diff --git a/packages/ripgrep/pkgbuild.py b/packages/ripgrep/pkgbuild.py index c1e4502..0329d05 100644 --- a/packages/ripgrep/pkgbuild.py +++ b/packages/ripgrep/pkgbuild.py @@ -1,8 +1,9 @@ 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") +version("15.2.0") +description("ripgrep recursively searches directories for a regex pattern while respecting your gitignore") +source_url("https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.2.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/sed/pkgbuild.py b/packages/sed/pkgbuild.py index 933b63f..bd77e27 100644 --- a/packages/sed/pkgbuild.py +++ b/packages/sed/pkgbuild.py @@ -3,6 +3,7 @@ import subprocess from lib.make import * version("15.1.1") +description("SemiOS fork of the UNIX sed utility") source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz") builddep("shortcut/c") diff --git a/packages/semi-libc/pkgbuild.py b/packages/semi-libc/pkgbuild.py index aebdc6d..4ed2633 100644 --- a/packages/semi-libc/pkgbuild.py +++ b/packages/semi-libc/pkgbuild.py @@ -2,6 +2,7 @@ from lib import arch, cpp from lib.make import * version("1.2.6+1") +description("the SemiOS fork of musl-libc, providing POSIX C standard library and system runtime") source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz") diff --git a/packages/semios-assembly/pkgbuild.py b/packages/semios-assembly/pkgbuild.py index 96295ea..df888fb 100644 --- a/packages/semios-assembly/pkgbuild.py +++ b/packages/semios-assembly/pkgbuild.py @@ -13,6 +13,7 @@ source_url(f"file://{os.getcwd()}/empty.tar") on_build(lambda: print("Building virtual package `semios-assembly`...")) package("SemiOS.Assembly.CoreRuntime") +description("Assembly of the core SemiOS runtime") deplinux("semi-libc @same-arch") deplinux("libgcc-compat @same-arch") dep("libunwind @same-arch") @@ -26,6 +27,7 @@ dep("iana-timezone-db") on_pack(lambda _: print("Packing virtual package `SemiOS.Assembly.CoreRuntime`...")) package("SemiOS.Assembly.Cli") +description("Assembly of core SemiOS command-line experience") dep("less @same-arch") dep("ncurses-tools @same-arch") dep("ncurses-terminfo") @@ -34,6 +36,7 @@ dep("neatvi @same-arch") on_pack(lambda _: print("Packing virtual package `SemiOS.Assembly.Cli`...")) package("SemiOS.Assembly.Networking") +description("Assembly of SemiOS core networking experience") dep("aws-lc-libssl @same-arch") dep("aws-lc-tools @same-arch") dep("ca-certificates") diff --git a/packages/sqlite/pkgbuild.py b/packages/sqlite/pkgbuild.py index 621be52..933517b 100644 --- a/packages/sqlite/pkgbuild.py +++ b/packages/sqlite/pkgbuild.py @@ -3,8 +3,9 @@ import os import lib.cpp as cpp from lib.make import * -version("3.53.2") -source_url("https://sqlite.org/2026/sqlite-autoconf-3530200.tar.gz") +version("3.53.4") +description("a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine") +source_url("https://sqlite.org/2026/sqlite-autoconf-3530400.tar.gz") builddep("shortcut/autotools") builddep("shortcut/c") diff --git a/packages/util-linux/pkgbuild.py b/packages/util-linux/pkgbuild.py index 4ee7b4f..e3eb336 100644 --- a/packages/util-linux/pkgbuild.py +++ b/packages/util-linux/pkgbuild.py @@ -13,6 +13,7 @@ builddep(f"libz-ng-dev @{arch.get_target()}") builddep(f"libncurses-dev @{arch.get_target()}") version("2.42.2") +description("a random collection of Linux utilities") source_url("https://www.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz") def build(): diff --git a/packages/vim/pkgbuild.py b/packages/vim/pkgbuild.py index b8abdd7..59a3e3f 100644 --- a/packages/vim/pkgbuild.py +++ b/packages/vim/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * upstream_version = "9.2.782" version(upstream_version) +description("vim, a greatly improved version of the good old UNIX editor Vi") source_url("https://github.com/vim/vim/archive/refs/tags/v9.2.0782.tar.gz") builddep("shortcut/c") diff --git a/packages/xz/pkgbuild.py b/packages/xz/pkgbuild.py index a98fae2..c04bc8d 100644 --- a/packages/xz/pkgbuild.py +++ b/packages/xz/pkgbuild.py @@ -4,6 +4,7 @@ from lib import cpp from lib.make import * version("5.8.3") +description("a general-purpose LZMA data-compression library plus command-line tools") source_url( "https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz" ) diff --git a/packages/zlib-ng/pkgbuild.py b/packages/zlib-ng/pkgbuild.py index 29de6fe..afe08a3 100644 --- a/packages/zlib-ng/pkgbuild.py +++ b/packages/zlib-ng/pkgbuild.py @@ -4,6 +4,7 @@ import lib.cpp as cpp from lib.make import * version("2.3.3") +description("zlib replacement with optimizations for next generation systems") source_url("https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.3.3.tar.gz") builddep("shortcut/c++") diff --git a/packages/zstd/pkgbuild.py b/packages/zstd/pkgbuild.py index aa43df5..9c82c4a 100644 --- a/packages/zstd/pkgbuild.py +++ b/packages/zstd/pkgbuild.py @@ -4,6 +4,7 @@ import lib.cpp as cpp from lib.make import * version("1.5.7") +description("Zstandard - Fast real-time compression algorithm") source_url( "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz" ) -- 2.55.0 From 2a7def094d1c3d72b08c4313473d936bfc972c6a Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 8 Aug 2026 01:45:44 +0800 Subject: [PATCH 65/86] feat: add package bash Signed-off-by: sisungo --- packages/bash/pkgbuild.py | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 packages/bash/pkgbuild.py diff --git a/packages/bash/pkgbuild.py b/packages/bash/pkgbuild.py new file mode 100644 index 0000000..7bb0367 --- /dev/null +++ b/packages/bash/pkgbuild.py @@ -0,0 +1,84 @@ +import os + +from lib.make import * +from lib import cpp + +version("5.3") +description("the Bourne Again SHell") +source_url("https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz") + +builddep("shortcut/c") +builddep("shortcut/autotools") +builddep(f"libncurses-dev @{arch.get_target()}") + +def build(): + cpp.configure([ + f"--prefix={get_prefix('bash')}", + f"--datarootdir={get_prefix('bash-doc')}/share", + f"--localedir={get_prefix('bash')}/share/locale", + "--enable-alias", + "--enable-alt-array-implementation", + "--enable-arith-for-command", + "--enable-array-variables", + "--enable-bang-history", + "--enable-brace-expansion", + "--enable-casemod-attributes", + "--enable-casemod-expansions", + "--enable-command-timing", + "--enable-cond-command", + "--enable-cond-regexp", + "--enable-coprocesses", + "--enable-directory-stack", + "--enable-dparen-arithmetic", + "--enable-extended-glob", + "--enable-function-import", + "--enable-glob-asciiranges-default", + "--enable-help-builtin", + "--enable-history", + "--enable-job-control", + "--enable-multibyte", + "--enable-net-redirections", + "--enable-process-substitution", + "--enable-progcomp", + "--enable-prompt-string-decoding", + "--enable-readline", + "--enable-restricted", + "--enable-select", + "--enable-separate-helpfiles", + "--enable-single-help-strings", + "--enable-translatable-strings", + "--without-bash-malloc", + ]) + cpp.make() + cpp.make_install() + +on_build(build) + +def pack_bash(composer): + composer.add_dir("bin", "bin") + composer.makedir("lib") + composer.add_dir("lib/bash", "lib/bash") + os.remove(f"{composer.workdir}/bundle/lib/bash/loadables.h") + os.remove(f"{composer.workdir}/bundle/lib/bash/Makefile.inc") + os.remove(f"{composer.workdir}/bundle/lib/bash/Makefile.sample") + composer.makedir("share") + composer.add_dir("share/locale", "share/locale") + +def pack_doc(composer): + composer.makedir("share") + composer.add_dir("share/bash", "share/bash") + composer.add_dir("share/doc", "share/doc") + composer.add_dir("share/info", "share/info") + composer.add_dir("share/man", "share/man") + +package("bash") +dep("semi-libc @same-arch") +dep("libncurses @same-arch") +on_pack(pack_bash) + +package("bash-dev") +dep("bash (same)") +cpp.use_auto_pack(["dev"]) + +package("bash-doc") +on_pack(pack_doc) -- 2.55.0 From e7d77b63b3326a7402052b1482a6fc778d54297c Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 9 Aug 2026 13:01:40 +0800 Subject: [PATCH 66/86] fix: llvm build configuration has invalid fields Signed-off-by: sisungo --- packages/llvm-project/pkgbuild.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index a33558a..10eee45 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -130,6 +130,7 @@ def build_clang(): "-DCLANG_DEFAULT_CXX_STDLIB=libc++", "-DCLANG_DEFAULT_RTLIB=compiler-rt", "-DLLVM_INCLUDE_TESTS=OFF", + f"-DC_INCLUDE_DIRS=/lib/{arch.get_target()}/include", ] cmake("clang", import_llvm() + options) @@ -143,7 +144,7 @@ def build_polly(): cmake("polly", import_llvm()) def build_runtimes(): - cflags = f"-isystem /lib/{arch.get_target()}/include -L/lib/{arch.get_target()} -B/lib/{arch.get_target()} -rtlib=compiler-rt" + os.makedirs("../_build_runtimes", exist_ok=True) shutil.rmtree("../_build_runtimes") options = [ # Configure runtimes @@ -187,6 +188,7 @@ dep("semi-libc @same-arch") dep("libunwind @same-arch") dep("libcxx @same-arch") dep("libcxxabi @same-arch") +dep("libffi @same-arch") on_pack(lambda composer: auto_pack_glob(composer, ["lib/*.so*"])) package("libllvm-dev") @@ -249,9 +251,6 @@ def pack_clang(composer): lrtlib = rtlib.replace(f"-{larch}", "") composer.addfile(f"{linuxrtdir}/{rtlib}", f"{localrtdir}/{lrtlib}") - # Add symlink to system directories - os.symlink(f"/lib/{arch.get_target()}/include", f"{composer.workdir}/bundle/include") - # Add configuration clang_cfg = f"-L/lib/{arch.get_target()}\n-B/lib/{arch.get_target()}\n-rtlib=compiler-rt\n" clangxx_cfg = f"-stdlib=libc++\n{clang_cfg}" -- 2.55.0 From 65dd900ea49630167d047d8886ff6fdd0c1b4595 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 9 Aug 2026 21:23:01 +0800 Subject: [PATCH 67/86] feat: add package packie Signed-off-by: sisungo --- packages/packie/pkgbuild.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/packie/pkgbuild.py diff --git a/packages/packie/pkgbuild.py b/packages/packie/pkgbuild.py new file mode 100644 index 0000000..b465cd4 --- /dev/null +++ b/packages/packie/pkgbuild.py @@ -0,0 +1,16 @@ +from lib import rust +from lib.make import * + +version("0.0.1-alpha.1") +source_url("https://gitea.semilabs.org/semios/packie/archive/0.1.0.alpha-1.tar.gz") + + +def build(): + rust.build(["--package", "packie-cli"]) + + +on_build(build) + +package("packie") +dep("semi-libc @same-arch") +rust.use_auto_pack(["bin"]) -- 2.55.0 From 41d0b790836c87e89389e42b3a57ff620c963735 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 10 Aug 2026 09:53:45 +0800 Subject: [PATCH 68/86] feat: add package maintainers Signed-off-by: sisungo --- lib/make.py | 6 ++++++ packages/airup/pkgbuild.py | 1 + packages/alsa-lib/pkgbuild.py | 1 + packages/alsa-utils/pkgbuild.py | 1 + packages/awk/pkgbuild.py | 1 + packages/aws-lc/pkgbuild.py | 1 + packages/bash/pkgbuild.py | 1 + packages/bc/pkgbuild.py | 1 + packages/bison/pkgbuild.py | 1 + packages/bmake/pkgbuild.py | 1 + packages/brotli/pkgbuild.py | 1 + packages/byacc/pkgbuild.py | 1 + packages/bzip2/pkgbuild.py | 1 + packages/c-ares/pkgbuild.py | 1 + packages/ca-certificates/pkgbuild.py | 1 + packages/certutil/pkgbuild.py | 1 + packages/cmake/pkgbuild.py | 1 + packages/coreutils/pkgbuild.py | 1 + packages/curl/pkgbuild.py | 1 + packages/dbus/pkgbuild.py | 1 + packages/diffutils/pkgbuild.py | 1 + packages/expat/pkgbuild.py | 1 + packages/file/pkgbuild.py | 1 + packages/findutils/pkgbuild.py | 1 + packages/flex/pkgbuild.py | 1 + packages/gettext-tiny/pkgbuild.py | 1 + packages/git/pkgbuild.py | 1 + packages/glib/pkgbuild.py | 1 + packages/gnu-m4/pkgbuild.py | 1 + packages/gnu-make/pkgbuild.py | 1 + packages/gnu-sed/pkgbuild.py | 1 + packages/grep/pkgbuild.py | 1 + packages/iana-timezone/pkgbuild.py | 1 + packages/icu4c/pkgbuild.py | 1 + packages/iproute2/pkgbuild.py | 1 + packages/kmod/pkgbuild.py | 1 + packages/less/pkgbuild.py | 1 + packages/libarchive/pkgbuild.py | 1 + packages/libffi/pkgbuild.py | 1 + packages/libgcc-compat/pkgbuild.py | 1 + packages/libopus/pkgbuild.py | 1 + packages/libpsl/pkgbuild.py | 1 + packages/linenoise/pkgbuild.py | 1 + packages/linux/pkgbuild.py | 1 + packages/llvm-project/pkgbuild.py | 6 ++++++ packages/mandoc/pkgbuild.py | 1 + packages/meson/pkgbuild.py | 1 + packages/mksh/pkgbuild.py | 1 + packages/ncurses/pkgbuild.py | 1 + packages/neatvi/pkgbuild.py | 1 + packages/nextvi/pkgbuild.py | 1 + packages/nghttp2/pkgbuild.py | 3 +-- packages/ninja/pkgbuild.py | 1 + packages/openssh/pkgbuild.py | 1 + packages/packie/pkgbuild.py | 2 ++ packages/patch/pkgbuild.py | 1 + packages/pcre2/pkgbuild.py | 1 + packages/perl/pkgbuild.py | 1 + packages/python/pkgbuild.py | 1 + packages/rhash/pkgbuild.py | 1 + packages/ripgrep/pkgbuild.py | 1 + packages/sed/pkgbuild.py | 1 + packages/semi-libc/pkgbuild.py | 1 + packages/semios-assembly/pkgbuild.py | 1 + packages/sqlite/pkgbuild.py | 1 + packages/util-linux/pkgbuild.py | 1 + packages/vim/pkgbuild.py | 2 ++ packages/xz/pkgbuild.py | 1 + packages/zlib-ng/pkgbuild.py | 1 + packages/zstd/pkgbuild.py | 3 +-- 70 files changed, 82 insertions(+), 4 deletions(-) diff --git a/lib/make.py b/lib/make.py index 82f0c2e..641c65e 100644 --- a/lib/make.py +++ b/lib/make.py @@ -7,6 +7,7 @@ from . import pkgcomposer, sources _key_global = "@global" _key_version = "version" _key_description = "description" +_key_maintainers = "maintainers" _key_on_pack = "on_pack" _key_arch_any = "arch_any" _key_links = "links" @@ -19,6 +20,7 @@ _pkginfo: dict[str, dict[str, typing.Any]] = { _key_global: { _key_links: [], _key_dependencies: [], + _key_maintainers: [], _key_provides: [], _key_recommendations: [], }, @@ -69,6 +71,10 @@ def description(s: str): _pkginfo[_current_pkgname][_key_description] = s +def maintainer(s: str): + _pkginfo[_current_pkgname][_key_maintainers] += [s] + + def arch_any(): _pkginfo[_current_pkgname][_key_arch_any] = True diff --git a/packages/airup/pkgbuild.py b/packages/airup/pkgbuild.py index 9d06703..f93e71f 100644 --- a/packages/airup/pkgbuild.py +++ b/packages/airup/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * version("0.10.9") description("Modern, portable and fast implementation of service supervisor and the init daemon.") +maintainer("sisungo ") source_url("https://github.com/sisungo/airup/archive/refs/tags/v0.10.9.tar.gz") builddep("shortcut/rust") diff --git a/packages/alsa-lib/pkgbuild.py b/packages/alsa-lib/pkgbuild.py index 99f7336..fd294af 100644 --- a/packages/alsa-lib/pkgbuild.py +++ b/packages/alsa-lib/pkgbuild.py @@ -5,6 +5,7 @@ upstream_version = "1.2.16.1" version(upstream_version) description("audio and MIDI functionality for the Linux operating system") +maintainer("sisungo ") source_url("https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2") builddep("shortcut/c") diff --git a/packages/alsa-utils/pkgbuild.py b/packages/alsa-utils/pkgbuild.py index e58d354..8c514ec 100644 --- a/packages/alsa-utils/pkgbuild.py +++ b/packages/alsa-utils/pkgbuild.py @@ -3,6 +3,7 @@ from lib import cpp version("1.2.16") description("audio and MIDI functionality for the Linux operating system") +maintainer("sisungo ") source_url("https://www.alsa-project.org/files/pub/utils/alsa-utils-1.2.16.tar.bz2") builddep("shortcut/c") diff --git a/packages/awk/pkgbuild.py b/packages/awk/pkgbuild.py index e530ce1..e2a2f92 100644 --- a/packages/awk/pkgbuild.py +++ b/packages/awk/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2026.4.26") description("The One True Awk programming language") +maintainer("sisungo ") source_url("https://github.com/onetrueawk/awk/archive/refs/tags/20260426.tar.gz") builddep("shortcut/c") diff --git a/packages/aws-lc/pkgbuild.py b/packages/aws-lc/pkgbuild.py index 7288f72..7dee804 100644 --- a/packages/aws-lc/pkgbuild.py +++ b/packages/aws-lc/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("5.1.0") description("a general-purpose cryptographic library maintained by the AWS Cryptography team") +maintainer("sisungo ") source_url("https://github.com/aws/aws-lc/archive/refs/tags/v5.1.0.tar.gz") builddep("shortcut/c") diff --git a/packages/bash/pkgbuild.py b/packages/bash/pkgbuild.py index 7bb0367..44f0c8a 100644 --- a/packages/bash/pkgbuild.py +++ b/packages/bash/pkgbuild.py @@ -5,6 +5,7 @@ from lib import cpp version("5.3") description("the Bourne Again SHell") +maintainer("sisungo ") source_url("https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz") builddep("shortcut/c") diff --git a/packages/bc/pkgbuild.py b/packages/bc/pkgbuild.py index fd355d7..1bcd32a 100644 --- a/packages/bc/pkgbuild.py +++ b/packages/bc/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("7.0.3") description("An implementation of the POSIX bc calculator with GNU extensions and dc") +maintainer("sisungo ") source_url("https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.gz") builddep("shortcut/c") diff --git a/packages/bison/pkgbuild.py b/packages/bison/pkgbuild.py index 53564ab..e9163e1 100644 --- a/packages/bison/pkgbuild.py +++ b/packages/bison/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("3.7.91") description("a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables") +maintainer("sisungo ") source_url("https://alpha.gnu.org/gnu/bison/bison-3.7.91.tar.xz") builddep("shortcut/c") diff --git a/packages/bmake/pkgbuild.py b/packages/bmake/pkgbuild.py index 75f08e6..9d8c3dd 100644 --- a/packages/bmake/pkgbuild.py +++ b/packages/bmake/pkgbuild.py @@ -7,6 +7,7 @@ VERSION = "2026.6.19" version(VERSION) description("The BSD make utility ported to non-BSD systems") +maintainer("sisungo ") source_url("https://www.crufty.net/ftp/pub/sjg/bmake-20260619.tar.gz") builddep("shortcut/c") diff --git a/packages/brotli/pkgbuild.py b/packages/brotli/pkgbuild.py index 9435912..25fdff2 100644 --- a/packages/brotli/pkgbuild.py +++ b/packages/brotli/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("1.2.0") description("Brotli compression format") +maintainer("sisungo ") source_url("https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz") diff --git a/packages/byacc/pkgbuild.py b/packages/byacc/pkgbuild.py index c30c2de..0d92182 100644 --- a/packages/byacc/pkgbuild.py +++ b/packages/byacc/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2.0") description("Berkeley yacc") +maintainer("sisungo ") source_url("https://www.invisible-island.net/archives/byacc/byacc-2.0.tgz") builddep("shortcut/c") diff --git a/packages/bzip2/pkgbuild.py b/packages/bzip2/pkgbuild.py index 4c9066d..ed80bb0 100644 --- a/packages/bzip2/pkgbuild.py +++ b/packages/bzip2/pkgbuild.py @@ -11,6 +11,7 @@ builddep("shortcut/autotools") version(f"{upstream_version}") description("a freely available, patent free, high-quality data compressor") +maintainer("sisungo ") source_url(f"https://sourceware.org/pub/bzip2/bzip2-{upstream_version}.tar.gz") diff --git a/packages/c-ares/pkgbuild.py b/packages/c-ares/pkgbuild.py index 57d8a9b..a5412f6 100644 --- a/packages/c-ares/pkgbuild.py +++ b/packages/c-ares/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("1.34.6") description("A C library for asynchronous DNS requests") +maintainer("sisungo ") source_url( "https://github.com/c-ares/c-ares/releases/download/v1.34.6/c-ares-1.34.6.tar.gz" ) diff --git a/packages/ca-certificates/pkgbuild.py b/packages/ca-certificates/pkgbuild.py index 7f09f25..35d326b 100644 --- a/packages/ca-certificates/pkgbuild.py +++ b/packages/ca-certificates/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("2026.7.4") description("SemiOS system-level trusted CA database") +maintainer("sisungo ") source_url( "https://gitea.semilabs.org/semios/ca-certificates/releases/download/v2026.07.04/ca-certificates-2026.07.04.tar" ) diff --git a/packages/certutil/pkgbuild.py b/packages/certutil/pkgbuild.py index 33aea4b..58c110f 100644 --- a/packages/certutil/pkgbuild.py +++ b/packages/certutil/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("0.1.0") description("SemiOS certification utility") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/certutil/archive/v0.1.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/cmake/pkgbuild.py b/packages/cmake/pkgbuild.py index 5c34289..b9de6f1 100644 --- a/packages/cmake/pkgbuild.py +++ b/packages/cmake/pkgbuild.py @@ -9,6 +9,7 @@ upstream_version = "4.3.4" version(upstream_version) description("a cross-platform, open-source build system generator") +maintainer("sisungo ") source_url( "https://github.com/Kitware/CMake/releases/download/v4.3.4/cmake-4.3.4.tar.gz" ) diff --git a/packages/coreutils/pkgbuild.py b/packages/coreutils/pkgbuild.py index e3baf71..cc20b42 100644 --- a/packages/coreutils/pkgbuild.py +++ b/packages/coreutils/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("0.10.0") description("system core utilities") +maintainer("sisungo ") source_url("https://github.com/uutils/coreutils/archive/refs/tags/0.10.0.tar.gz") block_hook("autolink") diff --git a/packages/curl/pkgbuild.py b/packages/curl/pkgbuild.py index b778e92..dcfd870 100644 --- a/packages/curl/pkgbuild.py +++ b/packages/curl/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("8.21.0") description("command line tool and library for transferring data with URLs") +maintainer("sisungo ") source_url("https://curl.se/download/curl-8.21.0.tar.gz") builddep("shortcut/c") diff --git a/packages/dbus/pkgbuild.py b/packages/dbus/pkgbuild.py index af0913d..dd307ae 100644 --- a/packages/dbus/pkgbuild.py +++ b/packages/dbus/pkgbuild.py @@ -5,6 +5,7 @@ from lib import cpp version("1.16.2") description("a message bus system, a simple way for applications to talk to one another") +maintainer("sisungo ") source_url("https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz") builddep("shortcut/c") diff --git a/packages/diffutils/pkgbuild.py b/packages/diffutils/pkgbuild.py index 57c89e5..1012b04 100644 --- a/packages/diffutils/pkgbuild.py +++ b/packages/diffutils/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("0.5.0") description("utility to compute difference between text files") +maintainer("sisungo ") source_url("https://github.com/uutils/diffutils/archive/refs/tags/v0.5.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/expat/pkgbuild.py b/packages/expat/pkgbuild.py index 77faa2a..b86ab9f 100644 --- a/packages/expat/pkgbuild.py +++ b/packages/expat/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2.8.1") description("Fast streaming XML parser written in C99") +maintainer("sisungo ") source_url( "https://github.com/libexpat/libexpat/releases/download/R_2_8_1/expat-2.8.1.tar.gz" ) diff --git a/packages/file/pkgbuild.py b/packages/file/pkgbuild.py index a2b6341..94aa41a 100644 --- a/packages/file/pkgbuild.py +++ b/packages/file/pkgbuild.py @@ -7,6 +7,7 @@ VERSION = "5.48" version(VERSION) description("utility to infer file type and information") +maintainer("sisungo ") source_git("https://github.com/file/file.git", "FILE5_48") builddep("shortcut/c") diff --git a/packages/findutils/pkgbuild.py b/packages/findutils/pkgbuild.py index 032d3f7..c4f514e 100644 --- a/packages/findutils/pkgbuild.py +++ b/packages/findutils/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("0.10.0") description("implementation of the UNIX findutils") +maintainer("sisungo ") source_url("https://github.com/uutils/findutils/archive/refs/tags/0.10.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/flex/pkgbuild.py b/packages/flex/pkgbuild.py index 54ad7cf..a458f60 100644 --- a/packages/flex/pkgbuild.py +++ b/packages/flex/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("2.6.4") description("The Fast Lexical Analyzer - scanner generator for lexing in C and C++") +maintainer("sisungo ") source_url("https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz") builddep("shortcut/c") diff --git a/packages/gettext-tiny/pkgbuild.py b/packages/gettext-tiny/pkgbuild.py index 4d294b4..5690efc 100644 --- a/packages/gettext-tiny/pkgbuild.py +++ b/packages/gettext-tiny/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("0.3.3") description("small implementation of gettext and libintl") +maintainer("sisungo ") source_url( "https://github.com/sabotage-linux/gettext-tiny/releases/download/v0.3.3/gettext-tiny-0.3.3.tar.xz" ) diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index b723549..1a2fbcf 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2.55.0") description("a free and open source distributed version control system") +maintainer("sisungo ") source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") builddep("shortcut/c") diff --git a/packages/glib/pkgbuild.py b/packages/glib/pkgbuild.py index 960b797..fea900b 100644 --- a/packages/glib/pkgbuild.py +++ b/packages/glib/pkgbuild.py @@ -8,6 +8,7 @@ upstream_version = "2.89.2" version(upstream_version) description("a general-purpose, portable utility library") +maintainer("sisungo ") source_url("https://download.gnome.org/sources/glib/2.89/glib-2.89.2.tar.xz") builddep("shortcut/c++") diff --git a/packages/gnu-m4/pkgbuild.py b/packages/gnu-m4/pkgbuild.py index 631c898..e7f74fb 100644 --- a/packages/gnu-m4/pkgbuild.py +++ b/packages/gnu-m4/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("1.4.21") description("an implementation of the traditional Unix macro processor") +maintainer("sisungo ") source_url("https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz") builddep("shortcut/c") diff --git a/packages/gnu-make/pkgbuild.py b/packages/gnu-make/pkgbuild.py index 0c345ce..aee7973 100644 --- a/packages/gnu-make/pkgbuild.py +++ b/packages/gnu-make/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("4.4.1") description("a tool which controls the generation of executables and other non-source files of a program from the program's source files") +maintainer("sisungo ") source_url("https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz") builddep("shortcut/c") diff --git a/packages/gnu-sed/pkgbuild.py b/packages/gnu-sed/pkgbuild.py index e5c0fee..a233e2e 100644 --- a/packages/gnu-sed/pkgbuild.py +++ b/packages/gnu-sed/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("4.10") description("a non-interactive command-line text editor") +maintainer("sisungo ") source_url("https://ftp.gnu.org/gnu/sed/sed-4.10.tar.gz") block_hook("autolink") diff --git a/packages/grep/pkgbuild.py b/packages/grep/pkgbuild.py index a40f62f..7eee008 100644 --- a/packages/grep/pkgbuild.py +++ b/packages/grep/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("15.1.2") description("SemiOS file pattern searcher") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/grep/archive/v15.1.2.tar.gz") builddep("shortcut/c") diff --git a/packages/iana-timezone/pkgbuild.py b/packages/iana-timezone/pkgbuild.py index 3d5503c..02d278e 100644 --- a/packages/iana-timezone/pkgbuild.py +++ b/packages/iana-timezone/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2026.4.22") description("code and data that represent the history of local time for many representative locations worldwide") +maintainer("sisungo ") source_url("https://data.iana.org/time-zones/releases/tzdb-2026b.tar.lz") builddep("shortcut/c") diff --git a/packages/icu4c/pkgbuild.py b/packages/icu4c/pkgbuild.py index be8e695..531ab13 100644 --- a/packages/icu4c/pkgbuild.py +++ b/packages/icu4c/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("78.3") description("a mature, widely used set of C/C++ libraries providing Unicode and Globalization support for software applications") +maintainer("sisungo ") source_url( "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz" ) diff --git a/packages/iproute2/pkgbuild.py b/packages/iproute2/pkgbuild.py index 19db0df..dbf3e6c 100644 --- a/packages/iproute2/pkgbuild.py +++ b/packages/iproute2/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * version("7.1.0") description("a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel") +maintainer("sisungo ") source_git("https://git.kernel.org/pub/scm/network/iproute2/iproute2.git", "v7.1.0") builddep("shortcut/c") diff --git a/packages/kmod/pkgbuild.py b/packages/kmod/pkgbuild.py index 7195349..034c383 100644 --- a/packages/kmod/pkgbuild.py +++ b/packages/kmod/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("1.34") description("a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases") +maintainer("sisungo ") source_url("https://github.com/kmod-project/kmod/archive/refs/tags/v34.tar.gz") builddep("shortcut/c") diff --git a/packages/less/pkgbuild.py b/packages/less/pkgbuild.py index 72a2cf7..b182541 100644 --- a/packages/less/pkgbuild.py +++ b/packages/less/pkgbuild.py @@ -7,6 +7,7 @@ builddep(f"libncurses-dev @{arch.get_target()}") version("704") description("a free, open-source file pager") +maintainer("sisungo ") source_url("https://www.greenwoodsoftware.com/less/less-704.tar.gz") diff --git a/packages/libarchive/pkgbuild.py b/packages/libarchive/pkgbuild.py index e4e0459..e36043b 100644 --- a/packages/libarchive/pkgbuild.py +++ b/packages/libarchive/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("3.8.9") description("Multi-format archive and compression library") +maintainer("sisungo ") source_url( "https://github.com/libarchive/libarchive/releases/download/v3.8.9/libarchive-3.8.9.tar.gz" ) diff --git a/packages/libffi/pkgbuild.py b/packages/libffi/pkgbuild.py index 4fbc518..42e4d5f 100644 --- a/packages/libffi/pkgbuild.py +++ b/packages/libffi/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("3.7.1") description("A portable foreign-function interface library") +maintainer("sisungo ") source_url( "https://github.com/libffi/libffi/releases/download/v3.7.1/libffi-3.7.1.tar.gz" ) diff --git a/packages/libgcc-compat/pkgbuild.py b/packages/libgcc-compat/pkgbuild.py index c578e0c..17cbeb6 100644 --- a/packages/libgcc-compat/pkgbuild.py +++ b/packages/libgcc-compat/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * version("0.2.0") description("provides compatibility objects to gcc runtime libraries") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/libgcc-compat/archive/v0.2.0.tar.gz") builddep("shortcut/c") diff --git a/packages/libopus/pkgbuild.py b/packages/libopus/pkgbuild.py index f52ee66..57c0333 100644 --- a/packages/libopus/pkgbuild.py +++ b/packages/libopus/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("1.6.1") description("a totally open, royalty-free, highly versatile audio codec") +maintainer("sisungo ") source_url("https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz") builddep("shortcut/c") diff --git a/packages/libpsl/pkgbuild.py b/packages/libpsl/pkgbuild.py index a072792..c814885 100644 --- a/packages/libpsl/pkgbuild.py +++ b/packages/libpsl/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("0.23.1") description("C library for the Public Suffix List") +maintainer("sisungo ") source_url( "https://github.com/rockdaboot/libpsl/releases/download/0.23.1/libpsl-0.23.1.tar.gz" ) diff --git a/packages/linenoise/pkgbuild.py b/packages/linenoise/pkgbuild.py index 576420d..f94c63e 100644 --- a/packages/linenoise/pkgbuild.py +++ b/packages/linenoise/pkgbuild.py @@ -2,6 +2,7 @@ from lib.make import * version("2.0") description("A small self-contained alternative to readline and libedit") +maintainer("sisungo ") source_url("https://github.com/antirez/linenoise/archive/refs/tags/2.0.tar.gz") on_build(lambda: None) diff --git a/packages/linux/pkgbuild.py b/packages/linux/pkgbuild.py index 4bd2b11..ecbe18a 100644 --- a/packages/linux/pkgbuild.py +++ b/packages/linux/pkgbuild.py @@ -9,6 +9,7 @@ upstream_version = "6.18.43" version(f"{upstream_version}") description("the Linux operating system kernel") +maintainer("sisungo ") source_url( f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz" ) diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index 5ab0622..12e0062 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -12,6 +12,7 @@ pkgver = "22.1.8" version(pkgver) description("a collection of modular and reusable compiler and toolchain technologies") +maintainer("sisungo ") source_url(f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{pkgver}/llvm-project-{pkgver}.src.tar.xz") builddep("shortcut/c++") @@ -252,6 +253,9 @@ def pack_clang(composer): lrtlib = rtlib.replace(f"-{larch}", "") composer.addfile(f"{linuxrtdir}/{rtlib}", f"{localrtdir}/{lrtlib}") + # Add symlink to system directories, which is required for finding libc++ + os.symlink(f"/lib/{arch.get_target()}/include", f"{composer.workdir}/bundle/include") + # Add configuration clang_cfg = f"-L/lib/{arch.get_target()}\n-B/lib/{arch.get_target()}\n-rtlib=compiler-rt\n" clangxx_cfg = f"-stdlib=libc++\n{clang_cfg}" @@ -263,6 +267,8 @@ def pack_clang(composer): package("clang") dep("libclang (same)") on_pack(pack_clang) +link("bin/clang", "/bin/cc") +link("bin/clang++", "/bin/c++") enter_install("lld") diff --git a/packages/mandoc/pkgbuild.py b/packages/mandoc/pkgbuild.py index da9c788..5943966 100644 --- a/packages/mandoc/pkgbuild.py +++ b/packages/mandoc/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * version("1.14.6") description("a suite of tools compiling mdoc, the roff macro language, and man") +maintainer("sisungo ") source_url("https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz") builddep("shortcut/c") diff --git a/packages/meson/pkgbuild.py b/packages/meson/pkgbuild.py index d98192d..49a3464 100644 --- a/packages/meson/pkgbuild.py +++ b/packages/meson/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("1.11.2") description("The Meson Build System") +maintainer("sisungo ") source_url("https://github.com/mesonbuild/meson/releases/download/1.11.2/meson-1.11.2.tar.gz") builddep("python") diff --git a/packages/mksh/pkgbuild.py b/packages/mksh/pkgbuild.py index 0ab3aef..c169082 100644 --- a/packages/mksh/pkgbuild.py +++ b/packages/mksh/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("1.59.2") description("the MirBSD Korn Shell, a minimal and useful implementation of the POSIX shell with extensions") +maintainer("sisungo ") source_url( "https://github.com/mirabilos/mksh-cvs2git/archive/refs/tags/mksh-R59c.tar.gz" ) diff --git a/packages/ncurses/pkgbuild.py b/packages/ncurses/pkgbuild.py index 18cdc24..55d97fd 100644 --- a/packages/ncurses/pkgbuild.py +++ b/packages/ncurses/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("6.6") description("the ncurses terminal library") +maintainer("sisungo ") source_url("https://invisible-island.net/archives/ncurses/ncurses-6.6.tar.gz") builddep("shortcut/c") diff --git a/packages/neatvi/pkgbuild.py b/packages/neatvi/pkgbuild.py index 255343b..eb6ff41 100644 --- a/packages/neatvi/pkgbuild.py +++ b/packages/neatvi/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("19") description("A vi/ex editor for editing UTF-8 text") +maintainer("sisungo ") source_url("https://github.com/aligrudi/neatvi/archive/refs/tags/19.tar.gz") builddep("shortcut/c") diff --git a/packages/nextvi/pkgbuild.py b/packages/nextvi/pkgbuild.py index d073560..d8fe743 100644 --- a/packages/nextvi/pkgbuild.py +++ b/packages/nextvi/pkgbuild.py @@ -6,6 +6,7 @@ from lib.make import * version("5.3") description("A small vi/ex terminal text editor (neatvi rewrite)") +maintainer("sisungo ") source_url("https://github.com/kyx0r/nextvi/archive/refs/tags/5.3.tar.gz") builddep("shortcut/c") diff --git a/packages/nghttp2/pkgbuild.py b/packages/nghttp2/pkgbuild.py index c59b391..544afeb 100644 --- a/packages/nghttp2/pkgbuild.py +++ b/packages/nghttp2/pkgbuild.py @@ -1,10 +1,9 @@ -import os - from lib import cpp from lib.make import * version("1.70.0") description("nghttp2 - HTTP/2 C Library and tools") +maintainer("sisungo ") source_url( "https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.gz" ) diff --git a/packages/ninja/pkgbuild.py b/packages/ninja/pkgbuild.py index da4814d..6479c72 100644 --- a/packages/ninja/pkgbuild.py +++ b/packages/ninja/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("1.13.2") description("a small build system with a focus on speed") +maintainer("sisungo ") source_url("https://github.com/ninja-build/ninja/archive/refs/tags/v1.13.2.tar.gz") builddep("shortcut/c++") diff --git a/packages/openssh/pkgbuild.py b/packages/openssh/pkgbuild.py index 5cca29d..2b18125 100644 --- a/packages/openssh/pkgbuild.py +++ b/packages/openssh/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("10.3.1") description("the premier connectivity tool for remote login with the SSH protocol") +maintainer("sisungo ") source_url("https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.3p1.tar.gz") builddep("shortcut/c") diff --git a/packages/packie/pkgbuild.py b/packages/packie/pkgbuild.py index b465cd4..4973554 100644 --- a/packages/packie/pkgbuild.py +++ b/packages/packie/pkgbuild.py @@ -2,6 +2,8 @@ from lib import rust from lib.make import * version("0.0.1-alpha.1") +description("SemiOS package manager") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/packie/archive/0.1.0.alpha-1.tar.gz") diff --git a/packages/patch/pkgbuild.py b/packages/patch/pkgbuild.py index 92740ed..2de0cd4 100644 --- a/packages/patch/pkgbuild.py +++ b/packages/patch/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("15.1.1") description("the SemiOS fork of the UNIX patch utility") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/patch/archive/v15.1.1.tar.gz") builddep("shortcut/c") diff --git a/packages/pcre2/pkgbuild.py b/packages/pcre2/pkgbuild.py index 50da984..dce892a 100644 --- a/packages/pcre2/pkgbuild.py +++ b/packages/pcre2/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("10.47") description("a set of C functions that implement regular expression pattern matching") +maintainer("sisungo ") source_url( "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/pcre2-10.47.tar.gz" ) diff --git a/packages/perl/pkgbuild.py b/packages/perl/pkgbuild.py index cf7eb63..39d3ad7 100644 --- a/packages/perl/pkgbuild.py +++ b/packages/perl/pkgbuild.py @@ -8,6 +8,7 @@ upstream_version = "5.42.2" version(upstream_version) description("Perl is a highly capable, feature-rich programming language with over 37 years of development") +maintainer("sisungo ") source_url("https://www.cpan.org/src/5.0/perl-5.42.2.tar.gz") builddep("shortcut/c") diff --git a/packages/python/pkgbuild.py b/packages/python/pkgbuild.py index cfe32d2..51b9136 100644 --- a/packages/python/pkgbuild.py +++ b/packages/python/pkgbuild.py @@ -11,6 +11,7 @@ VERSION_FULL = f"{VERSION_BASE}.{VERSION_APPEND}" version(VERSION_FULL) description("the Python programming language") +maintainer("sisungo ") source_url( f"https://www.python.org/ftp/python/{VERSION_FULL}/Python-{VERSION_FULL}.tar.xz" ) diff --git a/packages/rhash/pkgbuild.py b/packages/rhash/pkgbuild.py index 04fe76d..548f061 100644 --- a/packages/rhash/pkgbuild.py +++ b/packages/rhash/pkgbuild.py @@ -7,6 +7,7 @@ upstream_version = "1.4.6" version(upstream_version) description("Great utility for computing hash sums") +maintainer("sisungo ") source_url("https://github.com/rhash/RHash/archive/refs/tags/v1.4.6.tar.gz") builddep("shortcut/c") diff --git a/packages/ripgrep/pkgbuild.py b/packages/ripgrep/pkgbuild.py index 0329d05..c59f063 100644 --- a/packages/ripgrep/pkgbuild.py +++ b/packages/ripgrep/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("15.2.0") description("ripgrep recursively searches directories for a regex pattern while respecting your gitignore") +maintainer("sisungo ") source_url("https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.2.0.tar.gz") builddep("shortcut/rust") diff --git a/packages/sed/pkgbuild.py b/packages/sed/pkgbuild.py index bd77e27..020951f 100644 --- a/packages/sed/pkgbuild.py +++ b/packages/sed/pkgbuild.py @@ -4,6 +4,7 @@ from lib.make import * version("15.1.1") description("SemiOS fork of the UNIX sed utility") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/sed/archive/v15.1.1.tar.gz") builddep("shortcut/c") diff --git a/packages/semi-libc/pkgbuild.py b/packages/semi-libc/pkgbuild.py index 4ed2633..153446f 100644 --- a/packages/semi-libc/pkgbuild.py +++ b/packages/semi-libc/pkgbuild.py @@ -3,6 +3,7 @@ from lib.make import * version("1.2.6+1") description("the SemiOS fork of musl-libc, providing POSIX C standard library and system runtime") +maintainer("sisungo ") source_url("https://gitea.semilabs.org/semios/semi-libc/archive/v1.2.6-1.tar.gz") diff --git a/packages/semios-assembly/pkgbuild.py b/packages/semios-assembly/pkgbuild.py index df888fb..04ebba0 100644 --- a/packages/semios-assembly/pkgbuild.py +++ b/packages/semios-assembly/pkgbuild.py @@ -8,6 +8,7 @@ def deplinux(s): dep(s) version("1.0.0") +maintainer("sisungo ") source_url(f"file://{os.getcwd()}/empty.tar") on_build(lambda: print("Building virtual package `semios-assembly`...")) diff --git a/packages/sqlite/pkgbuild.py b/packages/sqlite/pkgbuild.py index 933517b..12b5390 100644 --- a/packages/sqlite/pkgbuild.py +++ b/packages/sqlite/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("3.53.4") description("a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine") +maintainer("sisungo ") source_url("https://sqlite.org/2026/sqlite-autoconf-3530400.tar.gz") builddep("shortcut/autotools") diff --git a/packages/util-linux/pkgbuild.py b/packages/util-linux/pkgbuild.py index e3eb336..ec440fd 100644 --- a/packages/util-linux/pkgbuild.py +++ b/packages/util-linux/pkgbuild.py @@ -14,6 +14,7 @@ builddep(f"libncurses-dev @{arch.get_target()}") version("2.42.2") description("a random collection of Linux utilities") +maintainer("sisungo ") source_url("https://www.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz") def build(): diff --git a/packages/vim/pkgbuild.py b/packages/vim/pkgbuild.py index 59a3e3f..692daa6 100644 --- a/packages/vim/pkgbuild.py +++ b/packages/vim/pkgbuild.py @@ -5,6 +5,7 @@ upstream_version = "9.2.782" version(upstream_version) description("vim, a greatly improved version of the good old UNIX editor Vi") +maintainer("sisungo ") source_url("https://github.com/vim/vim/archive/refs/tags/v9.2.0782.tar.gz") builddep("shortcut/c") @@ -46,3 +47,4 @@ dep("semi-libc @same-arch") dep("libncurses @same-arch") dep(f"vim-data (={upstream_version}) @any") cpp.use_auto_pack(["bin"]) +link("bin/vim", "/bin/vi") diff --git a/packages/xz/pkgbuild.py b/packages/xz/pkgbuild.py index c04bc8d..1f8e8bc 100644 --- a/packages/xz/pkgbuild.py +++ b/packages/xz/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("5.8.3") description("a general-purpose LZMA data-compression library plus command-line tools") +maintainer("sisungo ") source_url( "https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz" ) diff --git a/packages/zlib-ng/pkgbuild.py b/packages/zlib-ng/pkgbuild.py index afe08a3..479c158 100644 --- a/packages/zlib-ng/pkgbuild.py +++ b/packages/zlib-ng/pkgbuild.py @@ -5,6 +5,7 @@ from lib.make import * version("2.3.3") description("zlib replacement with optimizations for next generation systems") +maintainer("sisungo ") source_url("https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.3.3.tar.gz") builddep("shortcut/c++") diff --git a/packages/zstd/pkgbuild.py b/packages/zstd/pkgbuild.py index 9c82c4a..1f2e1bd 100644 --- a/packages/zstd/pkgbuild.py +++ b/packages/zstd/pkgbuild.py @@ -1,10 +1,9 @@ -import os - import lib.cpp as cpp from lib.make import * version("1.5.7") description("Zstandard - Fast real-time compression algorithm") +maintainer("sisungo ") source_url( "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz" ) -- 2.55.0 From fc753703c433e000a3ce8861457130e2784a256a Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 10 Aug 2026 11:18:38 +0800 Subject: [PATCH 69/86] feat: add package htop Signed-off-by: sisungo --- packages/htop/pkgbuild.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/htop/pkgbuild.py diff --git a/packages/htop/pkgbuild.py b/packages/htop/pkgbuild.py new file mode 100644 index 0000000..867d976 --- /dev/null +++ b/packages/htop/pkgbuild.py @@ -0,0 +1,30 @@ +from lib.make import * +from lib import cpp + + +version("3.5.2") +description("an interactive process viewer") +maintainer("sisungo ") +source_url("https://github.com/htop-dev/htop/releases/download/3.5.2/htop-3.5.2.tar.xz") + +builddep("shortcut/autotools") +builddep("shortcut/c") +builddep(f"libncurses-dev @{arch.get_target()}") +builddep(f"linux-dev @{arch.get_target()}") + + +def build(): + cpp.configure([ + f"--prefix={get_prefix('htop')}", + "--enable-unicode", + ]) + cpp.make() + cpp.make_install() + +on_build(build) + + +package("htop") +dep("libncurses @same-arch") +dep("semi-libc @same-arch") +cpp.use_auto_pack(["bin"]) -- 2.55.0 From b09d172ff92f187bf965a6efe3d3f4de6c0b6413 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 14 Aug 2026 10:08:12 +0800 Subject: [PATCH 70/86] feat: change llvm triple to unknown- vendor Signed-off-by: sisungo --- lib/arch.py | 12 ++++++------ packages/llvm-project/pkgbuild.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/arch.py b/lib/arch.py index c53c189..f52aa97 100644 --- a/lib/arch.py +++ b/lib/arch.py @@ -4,16 +4,16 @@ from . import packie all: dict[str, dict[str, str]] = { "aarch64-semios-linux": { - "CC": "clang -target aarch64-semios-linux-musl", - "CXX": "clang++ -target aarch64-semios-linux-musl", + "CC": "clang -target aarch64-unknown-linux-musl", + "CXX": "clang++ -target aarch64-unknown-linux-musl", }, "x86_64-semios-linux": { - "CC": "clang -target x86_64-semios-linux-musl", - "CXX": "clang++ -target x86_64-semios-linux-musl", + "CC": "clang -target x86_64-unknown-linux-musl", + "CXX": "clang++ -target x86_64-unknown-linux-musl", }, "riscv64-semios-linux": { - "CC": "clang -target riscv64-semios-linux-musl", - "CXX": "clang++ -target riscv64-semios-linux-musl", + "CC": "clang -target riscv64-unknown-linux-musl", + "CXX": "clang++ -target riscv64-unknown-linux-musl", }, } _target: str = packie.host_arch() diff --git a/packages/llvm-project/pkgbuild.py b/packages/llvm-project/pkgbuild.py index 12e0062..a1e9a77 100644 --- a/packages/llvm-project/pkgbuild.py +++ b/packages/llvm-project/pkgbuild.py @@ -28,7 +28,7 @@ srcdir = None packname = None def llvm_host_triple(): - return arch.get_target().replace("-semios-linux", "-semios-linux-musl") + return arch.get_target().replace("-semios-linux", "-unknown-linux-musl") def cmake(sourcedir, args): builddir = os.getcwd() + f"/../_build_{sourcedir}" @@ -76,7 +76,7 @@ def auto_pack_dev(composer, name, devbins=[], extdirs=["lib/cmake"]): composer.makedir("lib") for i in os.listdir("lib"): prefix = None - if os.path.isdir(i) and f"lib/{i}" in extdirs: + if os.path.isdir(f"lib/{i}") and f"lib/{i}" in extdirs: composer.add_dir(f"lib/{i}", f"lib/{i}") elif ".so" in i: prefix = get_prefix(f"lib{name}") @@ -132,7 +132,7 @@ def build_clang(): "-DCLANG_DEFAULT_CXX_STDLIB=libc++", "-DCLANG_DEFAULT_RTLIB=compiler-rt", "-DLLVM_INCLUDE_TESTS=OFF", - f"-DC_INCLUDE_DIRS=/lib/{arch.get_target()}/include", + f"-DC_INCLUDE_DIRS=/lib/{arch.get_target()}/include:{get_prefix('clang')}/lib/clang/{pkgver_major}/include", ] cmake("clang", import_llvm() + options) -- 2.55.0 From fd5cde82bbaa5555b7094ea322a353ed6d030a92 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 14 Aug 2026 16:55:50 +0800 Subject: [PATCH 71/86] feat: add package rust Signed-off-by: sisungo --- packages/rust/bootstrap.toml.in | 740 ++++++++++++++++++++++++++++++++ packages/rust/pkgbuild.py | 77 ++++ 2 files changed, 817 insertions(+) create mode 100644 packages/rust/bootstrap.toml.in create mode 100644 packages/rust/pkgbuild.py diff --git a/packages/rust/bootstrap.toml.in b/packages/rust/bootstrap.toml.in new file mode 100644 index 0000000..585e6cb --- /dev/null +++ b/packages/rust/bootstrap.toml.in @@ -0,0 +1,740 @@ +# bootstrap.toml.in: Bootstrap Config Template +# +# Replacing Stubs: +# - %RUSTVERSION%: Version of rust +# - %CARGOPATH%: Absolute path of cargo +# - %RUSTCPATH%: Absolute path of rustc +# - %INSTALLPREFIX%: Install prefix + +# ============================================================================= +# Global Settings +# ============================================================================= + +# Use different pre-set defaults than the global defaults. +# +# See `src/bootstrap/defaults` for more information. +# Note that this has no default value (x.py uses the defaults in `bootstrap.example.toml`). +profile = "dist" + +# ============================================================================= +# Tweaking how LLVM is compiled +# ============================================================================= + +# Don't download Rust CI LLVM, instead, we compile it by our own. +llvm.download-ci-llvm = false + +# Indicates whether the LLVM build is a Release or Debug build +llvm.optimize = true + +# Indicates whether LLVM should be built with ThinLTO. Note that this will +# only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++ +# toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below). +# More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap +llvm.thin-lto = true + +# Indicates whether an LLVM Release build should include debug info +llvm.release-debuginfo = false + +# Indicates whether the LLVM assertions are enabled or not +# NOTE: When assertions are disabled, bugs in the integration between rustc and LLVM can lead to +# unsoundness (segfaults, etc.) in the rustc process itself, not just in the generated code. +llvm.assertions = false + +# Indicates whether the LLVM testsuite is enabled in the build or not. Does +# not execute the tests as part of the build as part of x.py build et al, +# just makes it possible to do `ninja check-llvm` in the staged LLVM build +# directory when doing LLVM development as part of Rust development. +llvm.tests = false + +# Indicates whether the LLVM plugin is enabled or not +llvm.plugins = false + +# Whether to build Enzyme as AutoDiff backend. +llvm.enzyme = false + +# Whether to build LLVM with support for it's gpu offload runtime. +llvm.offload = false + +# Absolute path to the directory containing ClangConfig.cmake +llvm.offload-clang-dir = "" + +# When true, link libstdc++ statically into the rustc_llvm. +# This is useful if you don't want to use the dynamic version of that +# library provided by LLVM. +llvm.static-libstdcpp = false + +# Enable LLVM to use zstd for compression. +llvm.libzstd = false + +# Whether to use Ninja to build LLVM. This runs much faster than make. +llvm.ninja = true + +# LLVM targets to build support for. +#llvm.targets = + +# LLVM experimental targets to build support for. +#llvm.experimental-targets = + +# Cap the number of parallel linker invocations when compiling LLVM. +#llvm.link-jobs = + +# Whether to build LLVM as a dynamically linked library (as opposed to statically linked). +# Under the hood, this passes `--shared` to llvm-config. +# NOTE: To avoid performing LTO multiple times, we suggest setting this to `true` when `thin-lto` is enabled. +llvm.link-shared = true + +# When building llvm, this configures what is being appended to the version. +llvm.version-suffix = "-rust-%RUSTVERSION%" + +# Use libc++ when building LLVM instead of libstdc++. This is the default on +# platforms already use libc++ as the default C++ library, but this option +# allows you to use libc++ even on platforms when it's not. You need to ensure +# that your host compiler ships with libc++. +llvm.use-libcxx = true + +# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake. +#llvm.use-linker = (path) + +# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES` +#llvm.allow-old-toolchain = false + +# Whether to include the Polly optimizer. +llvm.polly = false + +# Whether to build the clang compiler. +llvm.clang = false + +# Whether to enable llvm compilation warnings. +llvm.enable-warnings = false + +# Custom CMake defines to set when building LLVM. +llvm.build-config = {"LLVM_ENABLE_LIBCXX" = "ON"} + +# ============================================================================= +# General build configuration options +# ============================================================================= + +# The default stage to use for the `check` subcommand +#build.check-stage = 0 + +# The default stage to use for the `doc` subcommand +#build.doc-stage = 0 + +# The default stage to use for the `build` subcommand +#build.build-stage = 1 + +# The default stage to use for the `test` subcommand +#build.test-stage = 1 + +# The default stage to use for the `dist` subcommand +#build.dist-stage = 2 + +# The default stage to use for the `install` subcommand +#build.install-stage = 2 + +# The default stage to use for the `bench` subcommand +#build.bench-stage = 2 + +# A descriptive string to be appended to version output (e.g., `rustc --version`), +# which is also used in places like debuginfo `DW_AT_producer`. This may be useful for +# supplementary build information, like distro-specific package versions. +# +# IMPORTANT: Changing this value changes crate IDs and symbol name mangling, making +# compiled artifacts incompatible. PGO profiles cannot be reused across different +# descriptions, and incremental compilation caches are invalidated. Keep this value +# consistent when reusing build artifacts. +# +# The Rust compiler will differentiate between versions of itself, including +# based on this string, which means that if you wish to be compatible with +# upstream Rust you need to set this to "". However, note that if you set this to "" but +# are not actually compatible -- for example if you've backported patches that change +# behavior -- this may lead to miscompilations or other bugs. +#build.description = "" + +# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host +# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT +# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools +# (https://doc.rust-lang.org/nightly/rustc/platform-support.html). The current platform must be +# able to run binaries of this build triple. +# +# If `rustc` is present in path, this defaults to the host it was compiled for. +# Otherwise, `x.py` will try to infer it from the output of `uname`. +# If `uname` is not found in PATH, we assume this is `x86_64-pc-windows-msvc`. +# This may be changed in the future. +#build.build = "x86_64-unknown-linux-gnu" (as an example) + +# Which triples to produce a compiler toolchain for. Each of these triples will be bootstrapped from +# the build triple themselves. In other words, this is the list of triples for which to build a +# compiler that can RUN on that triple. +# +# Defaults to just the `build` triple. +#build.host = [build.build] (list of triples) + +# Which triples to build libraries (core/alloc/std/test/proc_macro) for. Each of these triples will +# be bootstrapped from the build triple themselves. In other words, this is the list of triples for +# which to build a library that can CROSS-COMPILE to that triple. +# +# Defaults to `host`. If you set this explicitly, you likely want to add all +# host triples to this list as well in order for those host toolchains to be +# able to compile programs for their native target. +#build.target = build.host (list of triples) + +# Use this directory to store build artifacts. Paths are relative to the current directory, not to +# the root of the repository. +#build.build-dir = "build" + +# Instead of downloading the src/stage0 version of Cargo specified, use +# this Cargo binary instead to build all Rust code +# If you set this, you likely want to set `rustc` as well. +build.cargo = "%CARGOPATH%" + +# Instead of downloading the src/stage0 version of the compiler +# specified, use this rustc binary instead as the stage0 snapshot compiler. +# If you set this, you likely want to set `cargo` as well. +build.rustc = "%RUSTCPATH%" + +# Use this rustdoc binary as the stage0 snapshot rustdoc. +# If unspecified, then the binary "rustdoc" (with platform-specific extension, e.g. ".exe") +# in the same directory as "rustc" will be used. +#build.rustdoc = "/path/to/rustdoc" + +# Instead of downloading the src/stage0 version of rustfmt specified, +# use this rustfmt binary instead as the stage0 snapshot rustfmt. +#build.rustfmt = "/path/to/rustfmt" + +# Instead of downloading the src/stage0 version of cargo-clippy specified, +# use this cargo-clippy binary instead as the stage0 snapshot cargo-clippy. +# +# Note that this option should be used with the same toolchain as the `rustc` option above. +# Otherwise, clippy is likely to fail due to a toolchain conflict. +#build.cargo-clippy = "/path/to/cargo-clippy" + +# Whether to build documentation by default. If false, rustdoc and +# friends will still be compiled but they will not be used to generate any +# documentation. +# +# You can still build documentation when this is disabled by explicitly passing paths, +# e.g. `x doc library`. +build.docs = true + +# Flag to specify whether CSS, JavaScript, and HTML are minified when +# docs are generated. JSON is always minified, because it's enormous, +# and generated in already-minified form from the beginning. +build.docs-minification = true + +# Flag to specify whether private items should be included in the library docs. +build.library-docs-private-items = false + +# Indicate whether to build compiler documentation by default. +# You can still build documentation when this is disabled by explicitly passing a path: `x doc compiler`. +build.compiler-docs = false + +# Indicate whether git submodules are managed and updated automatically. +build.submodules = false + +# The path to (or name of) the GDB executable to use. This is only used for +# executing the debuginfo test suite. +#build.gdb = + +# The path to (or name of) the LLDB executable to use. This is only used for +# executing the debuginfo test suite. +#build.lldb = + +# The node.js executable to use. Note that this is only used for the emscripten +# target when running tests, otherwise this can be omitted. +#build.nodejs = + +# The yarn executable to use. Note that this is used for rustdoc-gui tests and +# tidy js extra-checks, otherwise this can be omitted. +# +# Under Windows this should be `yarn.cmd` or path to it (verified on nodejs v18.06), or +# error will be emitted. +#build.yarn = + +# Python interpreter to use for various tasks throughout the build, notably +# rustdoc tests, and some dist bits and pieces. +# +# Defaults to the Python interpreter used to execute x.py. +#build.python = + +# The path to the REUSE executable to use. Note that REUSE is not required in +# most cases, as our tooling relies on a cached (and shrunk) copy of the +# REUSE output present in the git repository and in our source tarballs. +# +# REUSE is only needed if your changes caused the overall licensing of the +# repository to change, and the cached copy has to be regenerated. +# +# Defaults to the "reuse" command in the system path. +#build.reuse = + +# Force Cargo to check that Cargo.lock describes the precise dependency +# set that all the Cargo.toml files create, instead of updating it. +build.locked-deps = false + +# Indicate whether the vendored sources are used for Rust dependencies or not. +# +# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you +# want to use vendoring. See https://forge.rust-lang.org/infra/other-installation-methods.html#source-code. +#build.vendor = + +# If you build the compiler more than twice (stage3+) or the standard library more than once +# (stage 2+), the third compiler and second library will get uplifted from stage2 and stage1, +# respectively. If you would like to disable this uplifting, and rather perform a full bootstrap, +# then you can set this option to true. +# +# This is only useful for verifying that rustc generates reproducible builds. +build.full-bootstrap = false + +# Set the bootstrap/download cache path. It is useful when building rust +# repeatedly in a CI environment. +#build.bootstrap-cache-path = /path/to/shared/cache + +# Enable a build of the extended Rust tool set which is not only the compiler +# but also tools such as Cargo. This will also produce "combined installers" +# which are used to install Rust and Cargo together. +# The `tools` (check `bootstrap.example.toml` to see its default value) option specifies +# which tools should be built if `extended = true`. +# +# This is disabled by default. +build.extended = false + +# Set of tools to be included in the installation. +# +# If `extended = false`, the only one of these built by default is rustdoc. +# +# If `extended = true`, they are all included. +# +# If any enabled tool fails to build, the installation fails. +#build.tools = + +# Specify build configuration specific for some tool, such as enabled features. +# This option has no effect on which tools are enabled: refer to the `tools` option for that. +# +# For example, to build Miri with tracing support, use `tool.miri.features = ["tracing"]` +# +# The default value for the `features` array is `[]`. However, please note that other flags in +# `bootstrap.toml` might influence the features enabled for some tools. Also, enabling features +# in tools which are not part of the internal "extra-features" preset might not always work. +#build.tool.TOOL_NAME.features = [FEATURE1, FEATURE2] + +# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation +#build.verbose = + +# Build the sanitizer runtimes +build.sanitizers = false + +# Build the profiler runtime (required when compiling with options that depend +# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). +build.profiler = false + +# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics. +# Choosing true requires the LLVM submodule to be managed by bootstrap (i.e. not external) +# so that `compiler-rt` sources are available. +# +# Setting this to a path removes the requirement for a C toolchain, but requires setting the +# path to an existing library containing the builtins library from LLVM's compiler-rt. +# +# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in +# order to run `x check`. +build.optimized-compiler-builtins = true + +# Indicates whether the native libraries linked into Cargo will be statically +# linked or not. +build.cargo-native-static = false + +# Number of parallel jobs to be used for building and testing. If set to `0` or +# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag +# passed to cargo invocations. +#build.jobs = + +# Default value for the `--extra-checks` flag of tidy. +# +# See `./x test tidy --help` for details. +# +# Note that if any value is manually given to bootstrap such as +# `./x test tidy --extra-checks=js`, this value is ignored. +# Use `--extra-checks=''` to temporarily disable all extra checks. +# +# Automatically enabled in the "tools" profile. +# Set to the empty string to force disable (recommended for hdd systems). +#build.tidy-extra-checks = "" + +# Indicates whether ccache is used when building certain artifacts (e.g. LLVM). +# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use +# a specific version. +build.ccache = false + +# List of paths to exclude from the build and test processes. +# For example, exclude = ["tests/ui", "src/tools/tidy"]. +#build.exclude = [] + +# ============================================================================= +# General install configuration options +# ============================================================================= + +# Where to install the generated toolchain. Must be an absolute path. +install.prefix = "%INSTALLPREFIX%" + +# Where to install system configuration files. +# If this is a relative path, it will get installed in `prefix` above +install.sysconfdir = "/var/config" + +# Where to install documentation in `prefix` above +install.docdir = "share/doc/rust" + +# Where to install binaries in `prefix` above +install.bindir = "bin" + +# Where to install libraries in `prefix` above +install.libdir = "lib" + +# Where to install man pages in `prefix` above +install.mandir = "share/man" + +# Where to install data in `prefix` above +install.datadir = "share" + +# ============================================================================= +# Options for compiling Rust code itself +# ============================================================================= + +# Whether or not to optimize when compiling the compiler and standard library, +# and what level of optimization to use. +# WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping, +# building without optimizations takes much longer than optimizing. Further, some platforms +# fail to build without this optimization (c.f. #65352). +# The valid options are: +# true - Enable optimizations (same as 3). +# false - Disable optimizations. +# 0 - Disable optimizations. +# 1 - Basic optimizations. +# 2 - Some optimizations. +# 3 - All optimizations. +# "s" - Optimize for binary size. +# "z" - Optimize for binary size, but also turn off loop vectorization. +#rust.optimize = true + +# Indicates that the build should be configured for debugging Rust. A +# `debug`-enabled compiler and standard library will be somewhat +# slower (due to e.g. checking of debug assertions) but should remain +# usable. +# +# Note: If this value is set to `true`, it will affect a number of +# configuration options below as well, if they have been left +# unconfigured in this file. +# +# Note: changes to the `debug` setting do *not* affect `optimize` +# above. In theory, a "maximally debuggable" environment would +# set `optimize` to `false` above to assist the introspection +# facilities of debuggers like lldb and gdb. To recreate such an +# environment, explicitly set `optimize` to `false` and `debug` +# to `true`. In practice, everyone leaves `optimize` set to +# `true`, because an unoptimized rustc with debugging +# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840 +# reported a 25x slowdown) and bootstrapping the supposed +# "maximally debuggable" environment (notably libstd) takes +# hours to build. +# +rust.debug = false + +# Whether to download the stage 1 and 2 compilers from CI. This is useful if you +# are working on tools, doc-comments, or library (you will be able to build the +# standard library without needing to build the compiler). +# +# Set this to "if-unchanged" if you are working on `src/tools`, `tests` or +# `library` (on CI, `library` changes triggers in-tree compiler build) to speed +# up the build process if you don't need to build a compiler from the latest +# commit from `master`. +# +# Set this to `true` to always download or `false` to always use the in-tree +# compiler. +rust.download-rustc = false + +# Number of codegen units to use for each compiler invocation. A value of 0 +# means "the number of cores on this machine", and 1+ is passed through to the +# compiler. +# +# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units +rust.codegen-units = 1 + +# Sets the number of codegen units to build the standard library with, +# regardless of what the codegen-unit setting for the rest of the compiler is. +# NOTE: building with anything other than 1 is known to occasionally have bugs. +rust.codegen-units-std = 1 + +# Whether or not debug assertions are enabled for the compiler and standard library. +# These can help find bugs at the cost of a small runtime slowdown. +# +# Defaults to rust.debug value +rust.debug-assertions = false + +# Whether or not debug assertions are enabled for the standard library. +# Overrides the `debug-assertions` option, if defined. +# +# Defaults to rust.debug-assertions value +rust.debug-assertions-std = false + +# Whether or not debug assertions are enabled for the tools built by bootstrap. +# Overrides the `debug-assertions` option, if defined. +# +# Defaults to rust.debug-assertions value +rust.debug-assertions-tools = false + +# Whether or not to leave debug! and trace! calls in the rust binary. +# +# Defaults to rust.debug-assertions value +# +# If you see a message from `tracing` saying "some trace filter directives would enable traces that +# are disabled statically" because `max_level_info` is enabled, set this value to `true`. +rust.debug-logging = false + +# Whether or not to build rustc, tools and the libraries with randomized type layout +rust.randomize-layout = false + +# Whether or not overflow checks are enabled for the compiler and standard +# library. +# +# Defaults to rust.debug value +rust.overflow-checks = false + +# Whether or not overflow checks are enabled for the standard library. +# Overrides the `overflow-checks` option, if defined. +# +# Defaults to rust.overflow-checks value +rust.overflow-checks-std = false + +# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`. +# See https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo for available options. +# +# Can be overridden for specific subsets of Rust code (rustc, std or tools). +# Debuginfo for tests run with compiletest is not controlled by this option +# and needs to be enabled separately with `debuginfo-level-tests`. +# +# Note that debuginfo-level = 2 generates several gigabytes of debuginfo +# and will slow down the linking process significantly. +rust.debuginfo-level = 0 + +# Debuginfo level for the compiler. +rust.debuginfo-level-rustc = 0 + +# Debuginfo level for the standard library. +rust.debuginfo-level-std = 0 + +# Debuginfo level for the tools. +rust.debuginfo-level-tools = 0 + +# Debuginfo level for the test suites run with compiletest. +# FIXME(#61117): Some tests fail when this option is enabled. +#rust.debuginfo-level-tests = 0 + +# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE) +rust.backtrace = true + +# Whether to always use incremental compilation when building rustc +rust.incremental = false + +# The default linker that will be hard-coded into the generated +# compiler for targets that don't specify a default linker explicitly +# in their target specifications. Note that this is not the linker +# used to link said compiler. It can also be set per-target (via the +# `[target.]` block), which may be useful in a cross-compilation +# setting. +# +# See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker for more information. +#rust.default-linker = + +# The "channel" for the Rust build to produce. The stable/beta channels only +# allow using stable features, whereas the nightly and dev channels allow using +# nightly features. +# +# You can set the channel to "auto-detect" to load the channel name from `src/ci/channel`. +# +# If using tarball sources, default value is "auto-detect", otherwise, it's "dev". +rust.channel = "auto-detect" + +# The root location of the musl installation directory. The library directory +# will also need to contain libunwind.a for an unwinding implementation. Note +# that this option only makes sense for musl targets that produce statically +# linked binaries. +# +# Defaults to /usr on musl hosts. Has no default otherwise. +#rust.musl-root = + +# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix +# platforms to ensure that the compiler is usable by default from the build +# directory (as it links to a number of dynamic libraries). This may not be +# desired in distributions, for example. +rust.rpath = true + +# Additional flags to pass to `rustc`. +# Takes precedence over bootstrap's own flags but not over per target rustflags nor env. vars. like RUSTFLAGS. +# Applies to all stages and targets. +# +#rust.rustflags = [] + +# Indicates whether symbols should be stripped using `-Cstrip=symbols`. +rust.strip = true + +# Forces frame pointers to be used with `-Cforce-frame-pointers`. +# This can be helpful for profiling at a small performance cost. +rust.frame-pointers = false + +# Indicates whether stack protectors should be used +# via the unstable option `-Zstack-protector`. +# +# Valid options are : `none`(default),`basic`,`strong`, or `all`. +# `strong` and `basic` options may be buggy and are not recommended, see rust-lang/rust#114903. +rust.stack-protector = "none" + +# Prints each test name as it is executed, to help debug issues in the test harness itself. +rust.verbose-tests = false + +# Flag indicating whether tests are compiled with optimizations (the -O flag). +rust.optimize-tests = true + +# Flag indicating whether codegen tests will be run or not. If you get an error +# saying that the FileCheck executable is missing, you may want to disable this. +# Also see the target's llvm-filecheck option. +rust.codegen-tests = false + +# Flag indicating whether git info will be retrieved from .git automatically. +# Having the git information can cause a lot of rebuilds during development. +rust.omit-git-hash = false + +# Whether to create a source tarball by default when running `x dist`. +# +# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`. +rust.dist-src = false + +# After building or testing an optional component (e.g. the nomicon or reference), append the +# result (broken, compiling, testing) into this JSON file. +#rust.save-toolstates = (path) + +# This array serves three distinct purposes: +# - Backends in this list will be automatically compiled and included in the sysroot of each +# rustc compiled by bootstrap. +# - The first backend in this list will be configured as the **default codegen backend** by each +# rustc compiled by bootstrap. In other words, if the first backend is e.g. cranelift, then when +# we build a stage 1 rustc, it will by default compile Rust programs using the Cranelift backend. +# This also means that stage 2 rustc would get built by the Cranelift backend. +# - Running `x dist` (without additional arguments, or with `--include-default-paths`) will produce +# a dist component/tarball for the Cranelift backend if it is included in this array. +# +# Note that the LLVM codegen backend is special and will always be built and distributed. +# +# Currently, the only standard options supported here are `"llvm"`, `"cranelift"` and `"gcc"`. +rust.codegen-backends = ["llvm"] + +# Indicates whether LLD will be compiled and made available in the sysroot for rustc to execute, +rust.lld = false + +# Indicates if we should override the linker used to link Rust crates during bootstrap to be LLD. +# If set to `true` or `"external"`, a global `lld` binary that has to be in $PATH +# will be used. +# If set to `"self-contained"`, rust-lld from the snapshot compiler will be used. +# +# On MSVC, LLD will not be used if we're cross linking. +# +# Explicitly setting the linker for a target will override this option when targeting MSVC. +rust.bootstrap-override-lld = false + +# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the +# sysroot. +rust.llvm-tools = false + +# Indicates whether the `self-contained` llvm-bitcode-linker, will be made available +# in the sysroot. It is required for running nvptx tests. +rust.llvm-bitcode-linker = false + +# Whether to deny warnings in crates. Set to `false` to avoid +# error: warnings are denied by `build.warnings` configuration +rust.deny-warnings = false + +# Print backtrace on internal compiler errors during bootstrap +rust.backtrace-on-ice = false + +# Whether to verify generated LLVM IR +rust.verify-llvm-ir = false + +# Compile the compiler with a non-default ThinLTO import limit. This import +# limit controls the maximum size of functions imported by ThinLTO. Decreasing +# will make code compile faster at the expense of lower runtime performance. +#rust.thin-lto-import-instr-limit = + +# Map debuginfo paths to `/rust/$sha/...`. +# Useful for reproducible builds. Generally only set for releases +rust.remap-debuginfo = true + +# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator. +# This option is only tested on Linux and OSX. It can also be configured per-target in the +# [target.] section. +rust.jemalloc = false + +# Run tests in various test suites with the "nll compare mode" in addition to +# running the tests in normal mode. Largely only used on CI and during local +# development of NLL +rust.test-compare-mode = false + +# Global default for llvm-libunwind for all targets. See the target-specific +# documentation for llvm-libunwind below. Note that the target-specific +# option will override this if set. +rust.llvm-libunwind = 'system' + +# Enable symbol-mangling-version v0. This can be helpful when profiling rustc, +# as generics will be preserved in symbols (rather than erased into opaque T). +# When no setting is given, the new scheme will be used when compiling the +# compiler and its tools and the legacy scheme will be used when compiling the +# standard library. +# If an explicit setting is given, it will be used for all parts of the codebase. +rust.new-symbol-mangling = true + +# Size limit in bytes for move/copy annotations (-Zannotate-moves). Only types +# at or above this size will be annotated. If not specified, uses the default +# limit (65 bytes). +#rust.annotate-moves-size-limit = + +# Select LTO mode that will be used for compiling rustc. By default, thin local LTO +# (LTO within a single crate) is used (like for any Rust crate). You can also select +# "thin" or "fat" to apply Thin/Fat LTO to the `rustc_driver` dylib, or "off" to disable +# LTO entirely. +rust.lto = "thin-local" + +# Build compiler with the optimization enabled and -Zvalidate-mir, currently only for `std` +#rust.validate-mir-opts = 3 + +# Configure `std` features used during bootstrap. +# +# Default features will be expanded in the following cases: +# - If `rust.llvm-libunwind` or `target.llvm-libunwind` is enabled: +# - "llvm-libunwind" will be added for in-tree LLVM builds. +# - "system-llvm-libunwind" will be added for system LLVM builds. +# - If `rust.backtrace` is enabled, "backtrace" will be added. +# - If `rust.profiler` or `target.profiler` is enabled, "profiler" will be added. +# - If building for a zkvm target, "compiler-builtins-mem" will be added. +# +# Since libstd also builds libcore and liballoc as dependencies and all their features are mirrored +# as libstd features, this option can also be used to configure features such as optimize_for_size. +#rust.std-features = + +# Set the number of threads for the compiler frontend used during compilation of Rust code (passed to `-Zthreads`). +# The valid options are: +# 0 - Set the number of threads according to the detected number of threads of the host system +# 1 - Use a single thread for compilation of Rust code (the default) +# N - Number of threads used for compilation of Rust code +# +rust.parallel-frontend-threads = 1 + +[target.x86_64-unknown-linux-musl] +llvm-libunwind = "system" +crt-static = false +musl-libdir = "/lib/x86_64-semios-linux" + +[target.aarch64-unknown-linux-musl] +llvm-libunwind = "system" +crt-static = false +musl-libdir = "/lib/aarch64-semios-linux" + +[target.riscv64-unknown-linux-musl] +llvm-libunwind = "system" +crt-static = false +musl-libdir = "/lib/riscv64-semios-linux" diff --git a/packages/rust/pkgbuild.py b/packages/rust/pkgbuild.py new file mode 100644 index 0000000..d51f897 --- /dev/null +++ b/packages/rust/pkgbuild.py @@ -0,0 +1,77 @@ +import os +import shutil +import subprocess + +from lib.make import * +from lib import arch + + +upstream_version = "1.97.1" + +version(upstream_version) +description("A language empowering everyone to build reliable and efficient software") +maintainer("sisungo ") +source_url(f"https://static.rust-lang.org/dist/rustc-{upstream_version}-src.tar.xz") + +builddep("shortcut/cmake") +builddep("shortcut/c++") +builddep("python") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"linux-dev @{arch.get_target()}") +builddep(f"libunwind-dev @{arch.get_target()}") +builddep("curl") +builddep("grep") +builddep("sed") + + +def setup_musl_root(): + os.makedirs("../musl_root/lib", exist_ok=True) + for i in ["libc.a", "crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o", "libunwind.a"]: + shutil.copy2(f"/lib/{arch.get_target()}/{i}", f"../musl_root/lib/{i}") + +def configure(): + with open("../../bootstrap.toml.in") as file: + content = file.read() + content = content.replace("%RUSTVERSION%", upstream_version) + content = content.replace("%CARGOPATH%", shutil.which("cargo") or "cargo") + content = content.replace("%RUSTCPATH%", shutil.which("rustc") or "rustc") + content = content.replace("%INSTALLPREFIX%", get_prefix("rust")) + content = content.replace("%MUSLROOT%", os.getcwd() + "/../musl_root") + with open("bootstrap.toml", "wt+") as file: + file.write(content) + +def run_build(): + subprocess.run(["python3", "x.py", "build"], check=True) + +def run_install(): + os.environ["DESTDIR"] = os.getcwd() + "/../install_destdir" + subprocess.run(["python3", "x.py", "install"], check=True) + os.chdir(os.environ["DESTDIR"]) + # FIXME: Rust seemed not to process our directory name correctly, it is installed to pkg/rust. + os.chdir("pkg/rust") + + +def build(): + setup_musl_root() + configure() + run_build() + run_install() + +on_build(build) + + +def pack_rust(composer): + composer.makedir("lib") + composer.makedir("bin") + for i in os.listdir("."): + if ".so" in i: + composer.addfile(i, f"lib/{i}") + elif i in ["rustc", "rust-gdb", "rust-gdbgui", "rust-lldb", "rustdoc"]: + composer.addfile(i, f"bin/{i}") + composer.add_dir("rustlib", "lib/rustlib") + +package("rust") +dep("semi-libc @same-arch") +dep("libz @same-arch") +dep("libcxx @same-arch") +on_pack(pack_rust) -- 2.55.0 From 9c432fcabb9ddd4bec85ea33e3b328680645577c Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 14 Aug 2026 17:10:36 +0800 Subject: [PATCH 72/86] fix: bad dependencies for git Signed-off-by: sisungo --- packages/git/pkgbuild.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index 1a2fbcf..0d10952 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -10,8 +10,11 @@ source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") builddep("shortcut/c") builddep("shortcut/autotools") +builddep("rust") builddep(f"libintl-dev @{arch.get_target()}") builddep(f"libz-dev @{arch.get_target()}") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"linux-dev @{arch.get_target()}") def build(): -- 2.55.0 From 21dedb356890234bfa564da7adadd355837ed56f Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 14 Aug 2026 19:11:44 +0800 Subject: [PATCH 73/86] feat: add package cargo Signed-off-by: sisungo --- packages/cargo/pkgbuild.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/cargo/pkgbuild.py diff --git a/packages/cargo/pkgbuild.py b/packages/cargo/pkgbuild.py new file mode 100644 index 0000000..d179971 --- /dev/null +++ b/packages/cargo/pkgbuild.py @@ -0,0 +1,33 @@ +from lib.make import * +from lib import rust + + +version("0.98.0") +description("The Rust package manager") +maintainer("sisungo ") +source_url("https://github.com/rust-lang/cargo/archive/refs/tags/0.98.0.tar.gz") + +builddep("shortcut/c") +builddep("cargo") +builddep("rust") +builddep(f"aws-lc-dev @{arch.get_target()}") +builddep(f"pkgconf @{arch.get_target()}") +builddep(f"libz-ng-dev @{arch.get_target()}") +builddep(f"libcurl-dev @{arch.get_target()}") +builddep(f"libgit2-dev @{arch.get_target()}") +builddep(f"libssh2-dev @{arch.get_target()}") + + +def build(): + rust.build() + +on_build(build) + + +package("cargo") +dep("libssl @same-arch") +dep("libcrypto @same-arch") +dep("libz @same-arch") +dep("semi-libc @same-arch") +recommend("rust") +rust.use_auto_pack(["bin"]) -- 2.55.0 From ad3a7e8372bae0c1e8a724a8a56d2f69c09bb0d5 Mon Sep 17 00:00:00 2001 From: sisungo Date: Fri, 14 Aug 2026 21:24:28 +0800 Subject: [PATCH 74/86] fix: git build dependencies are invalid Signed-off-by: sisungo --- packages/git/pkgbuild.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/git/pkgbuild.py b/packages/git/pkgbuild.py index 0d10952..db55123 100644 --- a/packages/git/pkgbuild.py +++ b/packages/git/pkgbuild.py @@ -1,5 +1,3 @@ -import subprocess - from lib import arch, cpp from lib.make import * @@ -11,10 +9,13 @@ source_url("https://www.kernel.org/pub/software/scm/git/git-2.55.0.tar.gz") builddep("shortcut/c") builddep("shortcut/autotools") builddep("rust") +builddep("cargo") builddep(f"libintl-dev @{arch.get_target()}") builddep(f"libz-dev @{arch.get_target()}") builddep(f"aws-lc-dev @{arch.get_target()}") builddep(f"linux-dev @{arch.get_target()}") +builddep("gettext") +builddep("libarchive-tools") def build(): -- 2.55.0 From a405253451ac00018863646ee9b12072bba9a843 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 12:47:13 +0800 Subject: [PATCH 75/86] fix: autostrip breaks hard links Signed-off-by: sisungo --- hooks/autostrip.py | 41 +++++++++++++++++++++++++++++++++++++---- lib/atombuild.py | 39 +++++++++++++++------------------------ lib/pkgcomposer.py | 21 +++++++++++---------- 3 files changed, 63 insertions(+), 38 deletions(-) diff --git a/hooks/autostrip.py b/hooks/autostrip.py index 8f93261..19deb12 100644 --- a/hooks/autostrip.py +++ b/hooks/autostrip.py @@ -1,6 +1,8 @@ import os import stat import subprocess +import tempfile +import shutil from lib import common @@ -13,6 +15,8 @@ def _is_elf(filepath): def autostrip(composer): + processed_inodes = {} + for ent in common.treedir(composer.workdir): if not ent.is_file(follow_symlinks=False): continue @@ -20,7 +24,36 @@ def autostrip(composer): 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) + + stat_info = os.stat(ent.path) + inode_key = (stat_info.st_dev, stat_info.st_ino) + if inode_key in processed_inodes: + continue + processed_inodes[inode_key] = True + + oldperm = stat.S_IMODE(stat_info.st_mode) + + try: + with tempfile.NamedTemporaryFile(mode='wb', delete=False) as tmp_file: + tmp_path = tmp_file.name + shutil.copy2(ent.path, tmp_path) + os.chmod(tmp_path, 0o777) + + subprocess.run([strip, tmp_path], check=True) + + with open(tmp_path, 'rb') as tmp_file: + stripped_data = tmp_file.read() + + with open(ent.path, 'r+b') as original_file: + original_file.truncate(0) + original_file.write(stripped_data) + original_file.flush() + os.fsync(original_file.fileno()) + + os.chmod(ent.path, oldperm) + os.unlink(tmp_path) + + except Exception as e: + if 'tmp_path' in locals() and os.path.exists(tmp_path): + os.unlink(tmp_path) + raise RuntimeError(f"Failed to strip {ent.path}: {e}") from e diff --git a/lib/atombuild.py b/lib/atombuild.py index 86f9796..d75108c 100644 --- a/lib/atombuild.py +++ b/lib/atombuild.py @@ -13,8 +13,11 @@ BASE_REQUIREMENTS = [ # Packages for running `semios-packages` scripts "python", "packie", - "patch", "zstd", + "libarchive-tools", + # Packages for building packages that require patching + "patch", + # Packages for downloading various formats of tarballs "libz-ng", "liblzma", "libbzip2", @@ -92,32 +95,20 @@ def enter_build_env(root: str, cmd: list[str], chdir: str = "/"): subprocess.run( [ "bwrap", - "--bind", - root, - "/", + "--bind", root, "/", "--unshare-pid", "--unshare-user", - "--uid", - "0", - "--gid", - "0", - "--dev", - "/dev", - "--bind", - "/sys", - "/sys", - "--proc", - "/proc", + "--uid", "0", + "--gid", "0", + "--dev", "/dev", + "--bind", "/sys", "/sys", + "--proc", "/proc", "--clearenv", - "--setenv", - "HOME", - "/home/root", - "--setenv", - "PATH", - "/bin", - "--setenv", - "SEMIOS_PKGBUILD_IN_ATOMIC", - "1", + "--setenv", "HOME", "/home/root", + "--setenv", "PATH", "/bin", + "--setenv", "SEMIOS_PKGBUILD_IN_ATOMIC", "1", + "--setenv", "USER", "root", + "--setenv", "LOGNAME", "root", "--chdir", chdir, ] diff --git a/lib/pkgcomposer.py b/lib/pkgcomposer.py index 28aace4..0de456e 100644 --- a/lib/pkgcomposer.py +++ b/lib/pkgcomposer.py @@ -4,17 +4,10 @@ import shutil import subprocess import sys -if sys.version_info >= (3, 14): - _archive_format = "zstdtar" - _archive_suffix = ".tar.zst" -else: - _archive_format = "gztar" - _archive_suffix = ".tar.gz" - class PkgComposer: def __init__(self, pkgfile: str): - self.pkgfile = pkgfile + self.pkgfile = os.path.abspath(pkgfile) def setworkdir(self, workdir: str): self.workdir = workdir @@ -33,8 +26,16 @@ class PkgComposer: f.write("\n") def compose(self): - shutil.make_archive(self.pkgfile, _archive_format, self.workdir) - shutil.move(self.pkgfile + _archive_suffix, self.pkgfile) + subprocess.run( + [ + "tar", "cpf", f"{self.pkgfile}.tar", + "-C", self.workdir, + "--numeric-owner", + ".", + ], + check=True, + ) + subprocess.run(["zstd", "--rm", "-f", f"{self.pkgfile}.tar", "-o", self.pkgfile], check=True) def makedir(self, name: str): os.mkdir(f"{self.workdir}/bundle/{name}") -- 2.55.0 From 9810303b7130330d5b135dc2fd82294521dc7540 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 17:41:38 +0800 Subject: [PATCH 76/86] feat: add package SPIRV-LLVM-Translator Signed-off-by: sisungo --- packages/SPIRV-LLVM-Translator/pkgbuild.py | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 packages/SPIRV-LLVM-Translator/pkgbuild.py diff --git a/packages/SPIRV-LLVM-Translator/pkgbuild.py b/packages/SPIRV-LLVM-Translator/pkgbuild.py new file mode 100644 index 0000000..8fd6dd8 --- /dev/null +++ b/packages/SPIRV-LLVM-Translator/pkgbuild.py @@ -0,0 +1,37 @@ +from lib.make import * +from lib import cpp, arch + + +version("22.1.5") +description("A tool and a library for bi-directional translation between SPIR-V and LLVM IR") +maintainer("sisungo ") +source_url("https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v22.1.5.tar.gz") + +builddep("shortcut/cmake") +builddep("shortcut/c++") +builddep(f"libllvm-dev (~22.1.0) @{arch.get_target()}") +builddep(f"libllvm-static (~22.1.0) @{arch.get_target()}") +builddep("pkgconf") +builddep("spirv-headers") + + +def build(): + cpp.cmake([ + "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=ON", + f"-DLLVM_DIR=/lib/{arch.get_target()}/cmake/llvm", + f"-DSPIRV-Headers_SOURCE_DIR=/lib/{arch.get_target()}", + f"-DCMAKE_INSTALL_PREFIX={get_prefix('libllvmspirv-dev')}", + ]) + cpp.ninja() + cpp.ninja_install() + +on_build(build) + + +package("libllvmspirv-dev") +cpp.use_auto_pack(["dev"]) + +package("llvm-spirv") +dep("libllvm (~22.1.0) @same-arch") +dep("libcxx @same-arch") +cpp.use_auto_pack(["bin"]) -- 2.55.0 From d05fce73dcbc58a633c9b0b77488abd6c587e287 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 20:49:02 +0800 Subject: [PATCH 77/86] feat: add python packaging lib Signed-off-by: sisungo --- lib/python.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 lib/python.py diff --git a/lib/python.py b/lib/python.py new file mode 100644 index 0000000..2939330 --- /dev/null +++ b/lib/python.py @@ -0,0 +1,62 @@ +import os +import shutil +import subprocess + +from . import make, arch + + +PY3_VERSION = "3.14" + + +def build(): + subprocess.run(["python3", "-m", "build", "."], check=True) + +def install(): + if os.path.exists("../pyinstall"): + shutil.rmtree("../pyinstall") + for i in os.listdir("dist"): + if not i.endswith(".whl"): + continue + subprocess.run(["python3", "-m", "installer", f"--destdir=../pyinstall", f"dist/{i}"], check=True) + os.chdir("../pyinstall") + while len(os.listdir(".")) == 1: + os.chdir(os.listdir(".")[0]) + +def version(s: str): + make.version(f"{s}+python{PY3_VERSION}") + +def _depcommon(s: str): + if s == "python": + return f"python (~{PY3_VERSION}.0) @{arch.get_target()}" + elif ".py" in s: + if ")" in s: + return s.replace(")", f", +python{PY3_VERSION})") + else: + return s.replace(".py", f" (+python{PY3_VERSION})") + else: + return None + +def builddep(s: str): + if s == "$shortcut": + builddep("python") + builddep("build.py") + builddep("installer.py") + elif _depcommon(s): + make.builddep(_depcommon(s)) + else: + raise RuntimeError("unrecognized python dep") + +def dep(s: str): + if _depcommon(s): + make.dep(_depcommon(s)) + else: + raise RuntimeError("unrecognized python dep") + +def _auto_pack(composer): + base = f"lib/python{PY3_VERSION}/site-packages" + composer.makedirs(base) + for i in os.listdir("."): + composer.add_dir(i, f"{base}/{i}") + +def use_auto_pack(): + make.on_pack(_auto_pack) -- 2.55.0 From b368f771d2aba93bbbf03b695e6e167b98772ab9 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 20:53:42 +0800 Subject: [PATCH 78/86] feat: add package packaging-py Signed-off-by: sisungo --- packages/packaging-py/pkgbuild.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/packaging-py/pkgbuild.py diff --git a/packages/packaging-py/pkgbuild.py b/packages/packaging-py/pkgbuild.py new file mode 100644 index 0000000..6631be9 --- /dev/null +++ b/packages/packaging-py/pkgbuild.py @@ -0,0 +1,22 @@ +from lib.make import * +from lib import python + + +python.version("26.3") +description("Core utilities for Python packages") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz") + +python.builddep("$shortcut") + + +def build(): + python.build() + python.install() + +on_build(build) + + +package("packaging.py") +python.dep("python") +python.use_auto_pack() -- 2.55.0 From 8a1a62599d2cfb57531530fce4890522f548ee5d Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 21:02:38 +0800 Subject: [PATCH 79/86] feat: add package build-py Signed-off-by: sisungo --- packages/build-py/pkgbuild.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/build-py/pkgbuild.py diff --git a/packages/build-py/pkgbuild.py b/packages/build-py/pkgbuild.py new file mode 100644 index 0000000..290b2cc --- /dev/null +++ b/packages/build-py/pkgbuild.py @@ -0,0 +1,24 @@ +from lib.make import * +from lib import python + + +python.version("1.5.0") +description("A simple, correct Python build frontend") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/78/e0/df5e171f685f82f37b12e1f208064e24244911079d7b767447d1af7e0d70/build-1.5.0.tar.gz") + +python.builddep("$shortcut") +python.builddep("packaging.py (>=25.0)") + + +def build(): + python.build() + python.install() + +on_build(build) + + +package("build.py") +python.dep("python") +python.dep("packaging.py (>=25.0)") +python.use_auto_pack() -- 2.55.0 From 633bf71cb18d9d8a9f1683147c1e95d8e8378c9c Mon Sep 17 00:00:00 2001 From: sisungo Date: Sat, 15 Aug 2026 21:08:10 +0800 Subject: [PATCH 80/86] feat: add package installer-py Signed-off-by: sisungo --- packages/installer-py/pkgbuild.py | 22 ++++++++++++++++++++++ x.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 packages/installer-py/pkgbuild.py diff --git a/packages/installer-py/pkgbuild.py b/packages/installer-py/pkgbuild.py new file mode 100644 index 0000000..b35587a --- /dev/null +++ b/packages/installer-py/pkgbuild.py @@ -0,0 +1,22 @@ +from lib.make import * +from lib import python + + +python.version("1.0.1") +description("A library for installing Python wheels.") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/06/fe/b9f481cf0cc867958a21338baa900357b7b7d86cac9b025948049d77923c/installer-1.0.1.tar.gz") + +python.builddep("$shortcut") + + +def build(): + python.build() + python.install() + +on_build(build) + + +package("installer.py") +python.dep("python") +python.use_auto_pack() diff --git a/x.py b/x.py index 3484849..f178d2f 100644 --- a/x.py +++ b/x.py @@ -118,6 +118,7 @@ def cmd_build_package(package: str): "name": pkgname, "version": pkgver, "arch": pkgarch, + "description": pkginfo[lib.make._key_description], "dependencies": pkginfo[lib.make._key_dependencies], "provides": pkginfo[lib.make._key_provides], "recommendations": pkginfo[lib.make._key_recommendations], -- 2.55.0 From 9711728da69f6f6fd7132169ab6d1c087b5aac03 Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 16 Aug 2026 09:38:46 +0800 Subject: [PATCH 81/86] feat: add package PyYAML Signed-off-by: sisungo --- packages/PyYAML/pkgbuild.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/PyYAML/pkgbuild.py diff --git a/packages/PyYAML/pkgbuild.py b/packages/PyYAML/pkgbuild.py new file mode 100644 index 0000000..185d1bc --- /dev/null +++ b/packages/PyYAML/pkgbuild.py @@ -0,0 +1,22 @@ +from lib.make import * +from lib import python + + +python.version("6.0.3") +description("YAML parser and emitter for Python") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz") + +python.builddep("$shortcut") + + +def build(): + python.build() + python.install() + +on_build(build) + + +package("PyYAML.py") +python.dep("python") +python.use_auto_pack() -- 2.55.0 From a14d1e6ea09598b815bae7439e75993ed19eab3c Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 16 Aug 2026 10:19:55 +0800 Subject: [PATCH 82/86] feat: add package MarkupSafe-py Signed-off-by: sisungo --- packages/MarkupSafe-py/pkgbuild.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/MarkupSafe-py/pkgbuild.py diff --git a/packages/MarkupSafe-py/pkgbuild.py b/packages/MarkupSafe-py/pkgbuild.py new file mode 100644 index 0000000..699a4bd --- /dev/null +++ b/packages/MarkupSafe-py/pkgbuild.py @@ -0,0 +1,22 @@ +from lib.make import * +from lib import python + + +python.version("3.0.3") +description("Safely add untrusted strings to HTML/XML markup.") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz") + +python.builddep("$shortcut") + + +def build(): + python.build() + python.install() + +on_build(build) + + +package("MarkupSafe.py") +python.dep("python") +python.use_auto_pack() -- 2.55.0 From 02dede782332155377e685c8baeb07717a617fad Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 16 Aug 2026 10:43:10 +0800 Subject: [PATCH 83/86] feat: add package Mako-py Signed-off-by: sisungo --- lib/python.py | 2 +- packages/Mako-py/pkgbuild.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 packages/Mako-py/pkgbuild.py diff --git a/lib/python.py b/lib/python.py index 2939330..4d897fe 100644 --- a/lib/python.py +++ b/lib/python.py @@ -32,7 +32,7 @@ def _depcommon(s: str): if ")" in s: return s.replace(")", f", +python{PY3_VERSION})") else: - return s.replace(".py", f" (+python{PY3_VERSION})") + return s.replace(".py", f".py (+python{PY3_VERSION})") else: return None diff --git a/packages/Mako-py/pkgbuild.py b/packages/Mako-py/pkgbuild.py new file mode 100644 index 0000000..b3aec6a --- /dev/null +++ b/packages/Mako-py/pkgbuild.py @@ -0,0 +1,29 @@ +import os + +from lib.make import * +from lib import python + + +python.version("1.4.1") +description("A super-fast templating language that borrows the best ideas from the existing templating languages.") +maintainer("sisungo ") +source_url("https://files.pythonhosted.org/packages/2a/12/b5fa2353e2754cd67fb9f83793fa48ff42c213a5da7e719869d2301f6ab8/mako-1.4.1.tar.gz") + +python.builddep("$shortcut") +python.builddep("MarkupSafe.py") + + +def build(): + python.build() + python.install() + os.chdir("lib") + while len(os.listdir(".")) == 1: + os.chdir(os.listdir(".")[0]) + +on_build(build) + + +package("Mako.py") +python.dep("python") +python.dep("MarkupSafe.py") +python.use_auto_pack() -- 2.55.0 From 452e767da4a37165f5a3ad4c2156ea9fc8aabc53 Mon Sep 17 00:00:00 2001 From: sisungo Date: Tue, 11 Aug 2026 20:32:18 +0800 Subject: [PATCH 84/86] feat: add package spirv-tools Signed-off-by: sisungo --- packages/spirv-tools/pkgbuild.py | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/spirv-tools/pkgbuild.py diff --git a/packages/spirv-tools/pkgbuild.py b/packages/spirv-tools/pkgbuild.py new file mode 100644 index 0000000..188663d --- /dev/null +++ b/packages/spirv-tools/pkgbuild.py @@ -0,0 +1,43 @@ +import os +import shutil + +from lib.make import * +from lib import cpp, arch + + +sdk_version = "1.4.357.0" + +version(sdk_version) +description("an API and commands for processing SPIR-V modules") +maintainer("sisungo ") +source_url("https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.357.0.tar.gz") + +builddep("shortcut/cmake") +builddep("shortcut/c++") +builddep(f"spirv-headers (={sdk_version}) @{arch.get_target()}") + + +def build(): + cpp.cmake([ + f"-DSPIRV-Headers_SOURCE_DIR=/lib/{arch.get_target()}", + "-DCMAKE_CXX_FLAGS=-Wno-error=switch", + f"-DCMAKE_INSTALL_PREFIX={get_prefix('spirv-tools-dev')}", + ]) + cpp.ninja() + cpp.ninja_install() + try: + os.rename("lib64", "lib") + os.rename("lib32", "lib") + except: + pass + +on_build(build) + + +package("spirv-tools") +dep("libcxx @same-arch") +cpp.use_auto_pack(["bin"]) + +package("spirv-tools-dev") +dep("spirv-tools (same)") +cpp.use_auto_pack(["lib", "dev"]) -- 2.55.0 From 3a1f472de29c1bbd4a397c7e595d504571ef0c1e Mon Sep 17 00:00:00 2001 From: sisungo Date: Sun, 16 Aug 2026 23:36:00 +0800 Subject: [PATCH 85/86] fix: lib/cpp auto pack ignores hpp files Signed-off-by: sisungo --- lib/cpp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cpp.py b/lib/cpp.py index fd9ad4b..2a8ab73 100644 --- a/lib/cpp.py +++ b/lib/cpp.py @@ -117,6 +117,7 @@ def _is_dev_file(ent) -> bool: or ent.name.endswith(".la") or ent.name.endswith(".pc") or ent.name.endswith(".h") + or ent.name.endswith(".hpp") or ent.name.endswith(".cmake") or ent.name.endswith(".inc") or ("Makefile" in ent.name) -- 2.55.0 From 0ada9d32fb4f83cd73400148590c7282ad304d56 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 17 Aug 2026 17:43:54 +0800 Subject: [PATCH 86/86] feat: add support of zip source archives Signed-off-by: sisungo --- lib/sources.py | 52 ++++++++++++++++++++++++++++++++++++++++---------- x.py | 1 + 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/lib/sources.py b/lib/sources.py index c643024..3748bdc 100644 --- a/lib/sources.py +++ b/lib/sources.py @@ -4,6 +4,7 @@ import sys import tarfile import urllib.parse import urllib.request +import zipfile def filename(url): @@ -128,6 +129,25 @@ def tar_common_root(tar: tarfile.TarFile) -> str | None: return root +def zip_common_root(zip_file: zipfile.ZipFile) -> str | None: + members = zip_file.infolist() + if not members: + return None + root = None + for member in members: + path = member.filename.replace('\\', '/').lstrip('./').lstrip('/') + if not path: + continue + this_root = path.split('/')[0] + if this_root in ('', '.', '..'): + continue + if root is None: + root = this_root + elif this_root != root: + return None + return root + + def sources_dir_name() -> str: with open("./target/sources.tag") as file: return file.read() @@ -139,16 +159,28 @@ def source_url(url: str): download_path = f"./target/{filename(url)}" download(url, download_path) - with tarfile.open(download_path, "r") as tar: - common_root = tar_common_root(tar) - extract_dir = "./target" - sources_dir = f"./target/{common_root}" - if common_root in ["", ".", "None"]: - extract_dir = "./target/sources" - sources_dir = "./target/sources" - tar.extractall(extract_dir) - with open("./target/sources.tag", "wt+") as file: - file.write(sources_dir) + if download_path.endswith(".zip"): + with zipfile.ZipFile(download_path, "r") as zip: + common_root = zip_common_root(zip) + else: + with tarfile.open(download_path, "r") as tar: + common_root = tar_common_root(tar) + + extract_dir = "./target" + sources_dir = f"./target/{common_root}" + if common_root in ["", ".", None]: + extract_dir = "./target/sources" + sources_dir = "./target/sources" + + if download_path.endswith(".zip"): + with zipfile.ZipFile(download_path, "r") as zip: + zip.extractall(extract_dir) + else: + with tarfile.open(download_path, "r") as tar: + tar.extractall(extract_dir) + + with open("./target/sources.tag", "wt+") as file: + file.write(sources_dir) def _git_repo_name(url: str) -> str: diff --git a/x.py b/x.py index f178d2f..2dd8a99 100644 --- a/x.py +++ b/x.py @@ -119,6 +119,7 @@ def cmd_build_package(package: str): "version": pkgver, "arch": pkgarch, "description": pkginfo[lib.make._key_description], + "maintainers": pkginfo[lib.make._key_maintainers], "dependencies": pkginfo[lib.make._key_dependencies], "provides": pkginfo[lib.make._key_provides], "recommendations": pkginfo[lib.make._key_recommendations], -- 2.55.0