50 lines
2.4 KiB
Python
50 lines
2.4 KiB
Python
pkgname = "glib"
|
|
pkgver = "2.86.3"
|
|
Pkgver = pkgver[:4]
|
|
source = f"https://download.gnome.org/sources/glib/{Pkgver}/glib-{pkgver}.tar.xz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
gobject_ver = "1.86.0"
|
|
Pkgver_gobj = gobject_ver[:4]
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
deps = []
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir -p {fembuilddir}",
|
|
f"cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.xz",
|
|
f"cd {fembuilddir} && wget https://download.gnome.org/sources/gobject-introspection/{Pkgver_gobj}/gobject-introspection-{gobject_ver}.tar.xz",
|
|
f"cd {fembuilddir} && wget https://www.linuxfromscratch.org/patches/blfs/svn/glib-skip_warnings-1.patch",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && patch -Np1 -i ../glib-skip_warnings-1.patch",
|
|
f"cd {builddir} && mkdir -v build",
|
|
f"cd {builddir}/build && meson setup .. --prefix=/usr --buildtype=release -D introspection=disabled -D glib_debug=disabled -D man-pages=disabled -D tests=false -D sysprof=disabled",
|
|
f"cd {builddir}/build && ninja",
|
|
f"cd {builddir}/build && DESTDIR={destdir} ninja install",
|
|
|
|
# Build GObject Introspection
|
|
f"cd {builddir}/build && tar xf ../../gobject-introspection-{gobject_ver}.tar.xz",
|
|
f"cd {builddir}/build && meson setup gobject-introspection-{gobject_ver} gi-build --prefix=/usr --buildtype=release",
|
|
f"cd {builddir}/build && ninja -C gi-build",
|
|
f"cd {builddir}/build && DESTDIR={destdir} ninja -C gi-build install",
|
|
f"cd {builddir}/build && meson configure -D introspection=enabled",
|
|
f"cd {builddir}/build && ninja",
|
|
f"cd {builddir}/build && DESTDIR={destdir} ninja install",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"cp -pv {builddir}/LICENSES/* {destdir}/usr/share/licenses/{pkgname}/",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/gobject-introspection/",
|
|
f"cp -pv {builddir}/build/gobject-introspection-{gobject_ver}/COPYING* {destdir}/usr/share/licenses/gobject-introspection/",
|
|
|
|
# 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}"
|
|
]
|