Compare commits

..
4 Commits
3 changed files with 37 additions and 3 deletions
+13 -3
View File
@@ -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):
+23
View File
@@ -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"])
+1
View File
@@ -119,6 +119,7 @@ def cmd_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])