Compare commits

..
1 Commits
Author SHA1 Message Date
sisungo b3d71e0a3a feat: add package gnu-m4
Signed-off-by: sisungo <[email protected]>
2026-07-11 05:45:21 +08:00
2 changed files with 31 additions and 10 deletions
+2 -10
View File
@@ -8,26 +8,18 @@ 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')}/include",
f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('aws-lc-dev')}",
]
)
cpp.ninja()
cpp.ninja_install()
_fix_pc("libssl", get_prefix("aws-lc-libssl"))
_fix_pc("libcrypto", get_prefix("aws-lc-libcrypto"))
on_build(build)
+29
View File
@@ -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")