Files
BMLFS/build-scripts/gtk4.build
2024-02-12 10:12:06 -06:00

75 lines
2.6 KiB
Bash

#! /bin/bash
# GTK+ 4
# Source: https://download.gnome.org/sources/gtk/4.12/gtk-4.12.5.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: fribidi gdk-pixbuf graphene iso-codes libepoxy libxkbcommon
# Required: pango pygobject wayland-protocols gst-plugins-bad
# Recommended: adwaita-icon-theme gst-plugins-good
# Recommended: hicolor-icon-theme librsvg
# Recommended: xorg-libs(x11,xrander,xi,xext,xcursor,xdamage,xfixes,xinerama
# Optional: colord cups docutils ffmpeg gi-docgen highlight libcloudproviders
# Optional: sassc tracker vulkan
# "ifunc" is not supported by musl, only by Glibc. Therefore, -Df16c=disabled
# If coptimizing with GCC:
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
patch -Np1 -i ../patches/gtk4-chimera/tests-no-execinfo.patch
patch -Np1 -i ../patches/gtk4-chimera/ubsan.patch
meson setup --prefix=/usr \
-Dman-pages=false \
-Dbuild-tests=false \
-Dbroadway-backend=true \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dintrospection=enabled \
-Dcolord=enabled \
-Dcloudproviders=disabled \
-Dvulkan=enabled \
# -Df16c=disabled \ # Chimera patch?
# -Dmedia-ffmpeg=enabled \ # fails to build
-Dbuild-demos=false -Dgtk_doc=false BUILD &&
ninja -C BUILD -j2 &&
sudo -S DESTDIR=${BUILD} ninja -C BUILD install &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
gtk+4: GTK+ version 4 (multi-platform GUI toolkit)
gtk+4:
gtk+4: This is GTK+, a multi-platform toolkit for creating graphical user
gtk+4: interfaces. Offering a complete set of widgets, GTK+ is suitable for
gtk+4: projects ranging from small one-off projects to complete application
gtk+4: suites.
gtk+4:
gtk+4: GTK+ 4 is the successor to GTK+ 3 and GTK+ 2
gtk+4:
gtk+4:
gtk+4:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
# pkgconf wont find gtk4. Fix:
sudo ln -sv gtk4.pc usr/lib/pkgconfig/gtk+-4.0.pc &&
sudo -S makepkg -l y -c n $PKGS/gtk+4-4.12.5-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*