Files
BMLFS/build-scripts/glib.build
2023-03-27 18:40:27 -05:00

90 lines
2.9 KiB
Bash

#! /bin/bash
# Glib 2.74.5
# Source: ftp://ftp.acc.umu.se/pub/gnome/sources/glib/2.72/glib-2.72.0.tar.xz
# Source: https://download.gnome.org/sources/glib/2.74/glib-2.74.5.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: libxslt and PCRE
# Optional: dbus, bindfs, GDB, docbook-xml, docbook-xsl,
# Optional: GTK-Doc, glib-networking, gobject-introspection
# LTO: Tested with LLVM
# If optimizing:
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto "
export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 "
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
patch -Np1 -i ../patches/glib-lfs/glib-2.74.5-skip_warnings-1.patch
mkdir build &&
cd build &&
meson --prefix=/usr \
-Dman=true \
-Dselinux=disabled \
.. &&
read -p "Compile?" && ninja -j2 &&
read -p "Press Enter to install" &&
# if not using a package manager:
# ninja install
# Install may fail due to missint 'otool'. Use a link for now.
sudo -S ln -sv ../../bin/true /usr/bin/otool
# if using pkgtools from Slackware, then:
sudo -S DESTDIR=$BUILD ninja install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr/share
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/
read -p "Press Enter to create pakage description."
cd $BUILD && sudo mkdir -v install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
glib: glib (library of C routines, version 1.x)
glib:
glib: GLib is a library which includes support routines for C such as lists,
glib: trees, hashes, memory allocation, and many other things.
glib:
glib: GLib is required by nearly everything that uses GTK+ 1/2/3/4.x.
glib:
glib:
glib:
glib:
glib:
EOF
sudo mv /tmp/slack-desc install/ &&
read -p "Enter to build and install package" &&
sudo makepkg -l y -c n $PKGS/glib-2.74.5-${NOPSUFFIX} &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
glib-doc: Manuals for glib (library of C routines, version 1.x)
glib-doc:
glib-doc: GLib is a library which includes support routines for C such as lists,
glib-doc: trees, hashes, memory allocation, and many other things.
glib-doc:
glib-doc: GLib is required by nearly everything that uses GTK+ 1/2/3/4.x
glib-doc:
EOF
sudo mv /tmp/slack-desc install/
sudo makepkg -l y -c n $PKGS/glib-doc-2.74.5-${NOPSUFFIX}
sudo rm -rf /BMAN/*
sudo rm -rf $BUILD/*