forked from FemboyOS/fempkg_recipes
32 lines
1.5 KiB
Python
32 lines
1.5 KiB
Python
pkgname = "rustbindgen"
|
|
pkgver = "0.72.1"
|
|
source = f"https://github.com/rust-lang/rust-bindgen/archive/refs/tags/v{pkgver}/rust-bindgen-{pkgver}.tar.gz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/rust-bindgen-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
deps = ["rustc", "llvm"]
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/rust-bindgen-{pkgver}.tar.gz",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && cargo build --release",
|
|
f"cd {builddir} && mkdir -p {destdir}/usr/bin {destdir}/usr/share/{{,bash-completion/completions,zsh/site-functions}} && "
|
|
f"install -v -m755 target/release/bindgen {destdir}/usr/bin",
|
|
f"cd {builddir} && {destdir}/usr/bin/bindgen --generate-shell-completions bash > {destdir}/usr/share/bash-completion/completions/bindgen "
|
|
f"&& bindgen --generate-shell-completions zsh > {destdir}/usr/share/zsh/site-functions/_bindgen",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/LICENSE {destdir}/usr/share/licenses/{pkgname}/LICENSE",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {builddir} {fembuilddir}"
|
|
]
|