43 lines
2.0 KiB
Python
43 lines
2.0 KiB
Python
# gmp.recipe.py
|
|
pkgname = "gmp"
|
|
pkgver = "6.3.0"
|
|
source = f"https://ftpmirror.gnu.org/gnu/gmp/gmp-{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} && sed -i '/long long t1;/,+1s/()/(...)/' configure",
|
|
f"cd {builddir} && ./configure --prefix=/usr --enable-cxx --host=none-linux-gnu --disable-static --docdir=/usr/share/doc/gmp-{pkgver}",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make html",
|
|
f"cd {builddir} && make DESTDIR={destdir} install && make DESTDIR={destdir} install html",
|
|
|
|
# 32 bit
|
|
f"cd {builddir} && make distclean",
|
|
f"cd {builddir} && cp -v configfsf.guess config.guess",
|
|
f"cd {builddir} && cp -v configfsf.sub config.sub",
|
|
f"cd {builddir} && ABI=\"32\" CFLAGS=\"-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686\" CXXFLAGS=\"$CFLAGS\" PKG_CONFIG_PATH=\"/usr/lib32/pkgconfig\" ./configure --host=i686-pc-linux-gnu --prefix=/usr --disable-static --enable-cxx --libdir=/usr/lib32 --includedir=/usr/include/m32/gmp",
|
|
f"cd {builddir} && sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"cp {builddir}/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}"
|
|
]
|