forked from semios/semios-packages
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dd8c911a1 | ||
|
|
8c58073118 | ||
|
|
7e888b8408 | ||
|
|
5729463e2e | ||
|
|
9dc11ca666 | ||
|
|
e567c27db8 | ||
|
|
4f4ec0468a | ||
|
|
ab71a8ae75 | ||
|
|
07c93dac59 | ||
|
|
b0185d379b |
+13
-3
@@ -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):
|
||||
|
||||
@@ -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}",
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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,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():
|
||||
|
||||
Binary file not shown.
@@ -4,28 +4,16 @@ 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()}")
|
||||
builddep(f"linux-dev {arch.get_target()}")
|
||||
builddep(f"libunwind-dev @{arch.get_target()}")
|
||||
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")
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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()}",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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 \
|
||||
"$@"
|
||||
|
||||
@@ -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 \
|
||||
"$@"
|
||||
|
||||
@@ -8,7 +8,7 @@ source_url(
|
||||
)
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("sed")
|
||||
builddep("gnu-sed")
|
||||
|
||||
|
||||
def build():
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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")
|
||||
@@ -119,6 +120,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])
|
||||
@@ -131,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):
|
||||
@@ -203,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:
|
||||
|
||||
Reference in New Issue
Block a user