forked from FemboyOS/fempkg_recipes
33 lines
1.5 KiB
Python
33 lines
1.5 KiB
Python
# binutils.recipe.py
|
|
pkgname = "binutils"
|
|
pkgver = "2.45.1"
|
|
source = f"https://sourceware.org/pub/binutils/releases/binutils-{pkgver}.tar.xz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
deps = []
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.xz",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && mkdir -v build && cd build && ../configure --prefix=/usr --sysconfdir=/etc --enable-ld=default --enable-plugins --enable-shared --disable-werror --enable-64-bit-bfd --enable-new-dtags --with-system-zlib --enable-default-hash-style=gnu",
|
|
f"cd {builddir}/build && make tooldir=/usr -j$(nproc)",
|
|
f"cd {builddir}/build && make tooldir=/usr DESTDIR={destdir} install",
|
|
f"cd {destdir} && rm -rfv {destdir}/usr/lib/lib{{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}}.a {destdir}/usr/share/doc/gprofng/",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"cd {builddir} && cp -pv COPYING* {destdir}/usr/share/licenses/{pkgname}/",
|
|
|
|
# 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 {fembuilddir}"
|
|
]
|