bash: Fix build

This commit is contained in:
2026-05-26 23:55:28 +02:00
parent 3253dfe87b
commit fc97bc4bb2
4 changed files with 75 additions and 13 deletions
+50
View File
@@ -0,0 +1,50 @@
version = "2.5.1"
revision = 1
description = "Lightweight pkg-config implementation (cross host build)"
license = "ISC"
url = "http://pkgconf.org/"
source = tarball(
url=f"https://distfiles.ariadne.space/pkgconf/pkgconf-{version}.tar.xz",
sha256="cd05c9589b9f86ecf044c10a2269822bc9eb001eced2582cfffd658b0a50c243",
)
host_deps = ["autoconf", "automake", "binutils", "gcc"]
def configure(self):
self.run(
self.source_dir / "configure",
f"--prefix={self.prefix}",
"--with-system-libdir=/usr/lib",
"--with-system-includedir=/usr/include",
env={
"CFLAGS": self.profile["host_cflags"],
"LDFLAGS": self.profile["host_ldflags"],
},
)
def build(self):
autotools_build(self)
def install(self):
autotools_install(self)
triple = self.triple
bindir = f"{self.dest_dir}{self.prefix}/bin"
persdir = f"{self.dest_dir}{self.prefix}/share/pkgconfig/personality.d"
personality = f"""Triplet: {triple}
SysrootDir: /sysroot
DefaultSearchPaths: /sysroot/usr/lib/pkgconfig:/sysroot/usr/share/pkgconfig
SystemIncludePaths: /sysroot/usr/include
SystemLibraryPaths: /sysroot/usr/lib
"""
self.run(
"sh",
"-c",
f"set -e; "
f"mkdir -p {persdir}; "
f"cat > {persdir}/{triple}.personality <<'__EOF__'\n{personality}__EOF__\n"
f"ln -sf pkgconf {bindir}/{triple}-pkgconf; "
f"ln -sf pkgconf {bindir}/{triple}-pkg-config",
)