forked from semios/semios-packages
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8f18ce917 | ||
|
|
248c0bbc66 | ||
|
|
f7242af3a9 | ||
|
|
a3dbac2b67 | ||
|
|
383433a365 | ||
|
|
844b40daaa |
+23
@@ -1,5 +1,7 @@
|
||||
import typing
|
||||
|
||||
from lib import arch
|
||||
|
||||
from . import pkgcomposer, sources
|
||||
|
||||
_key_global = "@global"
|
||||
@@ -8,11 +10,15 @@ _key_description = "description"
|
||||
_key_on_pack = "on_pack"
|
||||
_key_arch_any = "arch_any"
|
||||
_key_links = "links"
|
||||
_key_dependencies = "dependencies"
|
||||
_key_provides = "provides"
|
||||
|
||||
_current_pkgname: str = _key_global
|
||||
_pkginfo: dict[str, dict[str, typing.Any]] = {
|
||||
_key_global: {
|
||||
_key_links: [],
|
||||
_key_dependencies: [],
|
||||
_key_provides: [],
|
||||
},
|
||||
}
|
||||
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
||||
@@ -25,6 +31,9 @@ def package(s: str):
|
||||
global _current_pkgname
|
||||
_current_pkgname = s
|
||||
_pkginfo[s] = _pkginfo[_key_global].copy()
|
||||
_pkginfo[s][_key_links] = _pkginfo[s][_key_links].copy()
|
||||
_pkginfo[s][_key_dependencies] = _pkginfo[s][_key_dependencies].copy()
|
||||
_pkginfo[s][_key_provides] = _pkginfo[s][_key_provides].copy()
|
||||
|
||||
|
||||
def version(s: str):
|
||||
@@ -39,6 +48,20 @@ def arch_any():
|
||||
_pkginfo[_current_pkgname][_key_arch_any] = True
|
||||
|
||||
|
||||
def provide(s: str):
|
||||
_pkginfo[_current_pkgname][_key_provides] += [
|
||||
s.replace("@same-arch", f"@{arch.get_target()}")
|
||||
]
|
||||
|
||||
|
||||
def dep(s: str):
|
||||
_pkginfo[_current_pkgname][_key_dependencies] += [
|
||||
s.replace("(same)", "(same-version) @same-arch")
|
||||
.replace("(same-version)", f"(={_pkginfo[_current_pkgname][_key_version]})")
|
||||
.replace("@same-arch", f"@{arch.get_target()}")
|
||||
]
|
||||
|
||||
|
||||
def link(src: str, dst: str, default: bool = True):
|
||||
_pkginfo[_current_pkgname][_key_links] += [
|
||||
{
|
||||
|
||||
@@ -27,3 +27,4 @@ def pack_airup(composer):
|
||||
|
||||
package("airup")
|
||||
on_pack(pack_airup)
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -29,12 +29,22 @@ def pack_libssl(composer):
|
||||
|
||||
package("aws-lc-libcrypto")
|
||||
on_pack(pack_libcrypto)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("libcrypto@same-arch")
|
||||
|
||||
package("aws-lc-libssl")
|
||||
on_pack(pack_libssl)
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
provide("libssl@same-arch")
|
||||
|
||||
package("aws-lc-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
dep("aws-lc-libssl (same)")
|
||||
|
||||
package("aws-lc-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("aws-lc-libcrypto (same)")
|
||||
dep("aws-lc-libssl (same)")
|
||||
provide("libcrypto-dev@same-arch")
|
||||
provide("libssl-dev@same-arch")
|
||||
|
||||
@@ -21,9 +21,14 @@ on_build(build)
|
||||
|
||||
package("libbzip2")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("bzip2")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libbzip2 (same)")
|
||||
dep("sh")
|
||||
dep("coreutils")
|
||||
|
||||
package("libbzip2-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libbzip2 (same)")
|
||||
|
||||
@@ -7,19 +7,24 @@ block_hook("autolink")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
rust.build(["--features", "unix"])
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
functions = [
|
||||
"[",
|
||||
"arch",
|
||||
"b2sum",
|
||||
"base32",
|
||||
"base64",
|
||||
"basename",
|
||||
"basenc",
|
||||
"cat",
|
||||
"chgrp",
|
||||
"chmod",
|
||||
"chown",
|
||||
"chroot",
|
||||
"cksum",
|
||||
"comm",
|
||||
"cp",
|
||||
@@ -40,21 +45,34 @@ functions = [
|
||||
"false",
|
||||
"fmt",
|
||||
"fold",
|
||||
"groups",
|
||||
"head",
|
||||
"hostid",
|
||||
"hostname",
|
||||
"id",
|
||||
"install",
|
||||
"join",
|
||||
"kill",
|
||||
"link",
|
||||
"ln",
|
||||
"logname",
|
||||
"ls",
|
||||
"md5sum",
|
||||
"mkdir",
|
||||
"mkfifo",
|
||||
"mknod",
|
||||
"mktemp",
|
||||
"more",
|
||||
"mv",
|
||||
"nice",
|
||||
"nl",
|
||||
"nohup",
|
||||
"nproc",
|
||||
"numfmt",
|
||||
"od",
|
||||
"paste",
|
||||
"pathchk",
|
||||
"pinky",
|
||||
"pr",
|
||||
"printenv",
|
||||
"printf",
|
||||
@@ -75,22 +93,32 @@ functions = [
|
||||
"sleep",
|
||||
"sort",
|
||||
"split",
|
||||
"stat",
|
||||
"stdbuf",
|
||||
"stty",
|
||||
"sum",
|
||||
"sync",
|
||||
"tac",
|
||||
"tail",
|
||||
"tee",
|
||||
"test",
|
||||
"timeout",
|
||||
"touch",
|
||||
"tr",
|
||||
"true",
|
||||
"truncate",
|
||||
"tsort",
|
||||
"tty",
|
||||
"uname",
|
||||
"unexpand",
|
||||
"uniq",
|
||||
"unlink",
|
||||
"uptime",
|
||||
"users",
|
||||
"vdir",
|
||||
"wc",
|
||||
"who",
|
||||
"whoami",
|
||||
"yes",
|
||||
]
|
||||
|
||||
@@ -98,3 +126,4 @@ package("coreutils")
|
||||
for func in functions:
|
||||
link(f"bin/coreutils", f"/bin/{func}")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -17,3 +17,4 @@ package("diffutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
link("bin/diffutils", "/bin/cmp")
|
||||
link("bin/diffutils", "/bin/diff")
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -20,9 +20,12 @@ on_build(build)
|
||||
|
||||
package("libexpat")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("libexpat-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libexpat (same)")
|
||||
|
||||
package("libexpat-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libexpat (same)")
|
||||
|
||||
@@ -14,3 +14,4 @@ on_build(build)
|
||||
|
||||
package("findutils")
|
||||
rust.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -15,3 +15,4 @@ on_build(build)
|
||||
|
||||
package("gnu-make")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
@@ -20,9 +20,12 @@ on_build(build)
|
||||
|
||||
package("libicu4c")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("icu4c")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libicu4c (same)")
|
||||
|
||||
package("libicu4c-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libicu4c (same)")
|
||||
|
||||
@@ -18,9 +18,12 @@ on_build(build)
|
||||
|
||||
package("libkmod")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("kmod")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libkmod (same)")
|
||||
|
||||
package("libkmod-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libkmod (same)")
|
||||
|
||||
@@ -17,9 +17,18 @@ on_build(build)
|
||||
|
||||
package("libarchive")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("libcrypto@same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
dep("libz @same-arch")
|
||||
dep("liblzma @same-arch")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
|
||||
package("libarchive-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libarchive (same)")
|
||||
provide("bsdtar")
|
||||
|
||||
package("libarchive-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libarchive (same)")
|
||||
|
||||
@@ -20,3 +20,5 @@ def pack_mksh(composer):
|
||||
|
||||
package("mksh")
|
||||
on_pack(pack_mksh)
|
||||
dep("semi-libc @same-arch")
|
||||
provide("sh")
|
||||
|
||||
@@ -20,6 +20,8 @@ on_build(build)
|
||||
|
||||
package("libnghttp2")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("libnghttp2-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libnghttp2 (same)")
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
|
||||
import lib.cpp as cpp
|
||||
from lib.make import *
|
||||
|
||||
version("1.13.2")
|
||||
@@ -21,3 +20,5 @@ def pack_ninja(composer):
|
||||
|
||||
package("ninja")
|
||||
on_pack(pack_ninja)
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libcxx @same-arch")
|
||||
|
||||
@@ -23,9 +23,12 @@ on_build(build)
|
||||
|
||||
package("libpkgconf")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("pkgconf")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libpkgconf (same)")
|
||||
|
||||
package("libpkgconf-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libpkgconf (same)")
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
version("0.1.1")
|
||||
source_url("https://github.com/uutils/sed/releases/download/0.1.1/source.tar.gz")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
package("sed")
|
||||
dep("semi-libc @same-arch")
|
||||
rust.use_auto_pack(["bin"])
|
||||
@@ -25,3 +25,4 @@ link("lib/libc.so", f"/lib/ld-musl-{musl_target()}.so.1")
|
||||
|
||||
package("semi-libc-dev")
|
||||
use_auto_pack(["dev"])
|
||||
dep("semi-libc (same)")
|
||||
|
||||
@@ -22,9 +22,12 @@ on_build(build)
|
||||
|
||||
package("libsqlite")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("sqlite")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libsqlite (same)")
|
||||
|
||||
package("libsqlite-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libsqlite (same)")
|
||||
|
||||
@@ -17,9 +17,12 @@ on_build(build)
|
||||
|
||||
package("liblzma")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("xz")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("liblzma (same)")
|
||||
|
||||
package("liblzma-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("liblzma (same)")
|
||||
|
||||
@@ -18,9 +18,14 @@ on_build(build)
|
||||
|
||||
package("libz-ng")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
provide("libz")
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zlib-ng-tools")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libz-ng (same)")
|
||||
|
||||
package("libz-ng-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libz-ng (same)")
|
||||
provide("libz-dev")
|
||||
|
||||
@@ -19,9 +19,12 @@ on_build(build)
|
||||
|
||||
package("libzstd")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("zstd")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
package("libzstd-dev")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
dep("libzstd (same)")
|
||||
|
||||
@@ -79,6 +79,8 @@ def run_build_package(package: str):
|
||||
|
||||
# Pack packages
|
||||
for pkgname in lib.make._pkginfo.keys():
|
||||
lib.make._current_pkgname = pkgname
|
||||
|
||||
if pkgname == lib.make._key_global:
|
||||
continue
|
||||
|
||||
@@ -106,6 +108,8 @@ def run_build_package(package: str):
|
||||
"version": pkgver,
|
||||
"arch": pkgarch,
|
||||
"links": pkginfo[lib.make._key_links],
|
||||
"dependencies": pkginfo[lib.make._key_dependencies],
|
||||
"provides": pkginfo[lib.make._key_provides],
|
||||
}
|
||||
composer.write_manifest(manifest)
|
||||
composer.compose()
|
||||
|
||||
Reference in New Issue
Block a user