Files
BMLFS/build-scripts/libepoxy.build
2022-04-02 19:48:15 -05:00

67 lines
2.1 KiB
Bash

#! /bin/bash
# libepoxy
# Source: https://ftp.acc.umu.se/pub/gnome/sources/libepoxy/1.5/libepoxy-1.5.10.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: Mesa
# Recommended: NONE
# Optional: Doxygen
# If optimizing, use flags with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 "
export CFLAGS+="-ffat-lto-objects -flto=auto -fno-semantic-interposition "
export CFLAGS+="-mprefer-vector-width=256 "
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
mkdir build &&
cd build &&
# If GL is not missing from mesa set -Dglx=yes
# if building on a pure wayland system, add these flags:
export CFLAGS="-DEGL_NO_X11 -DMESA_EGL_NO_X11_HEADERS"
export CXXFLAGS="-DEGL_NO_X11 -DMESA_EGL_NO_X11_HEADERS"
# ... and apply patch:
patch -Np1 -i ../patches/libepoxy-mlfs/fallback-to-libOpenGL-when-GLX-is-disabled.patch
meson --prefix=/usr \
-Ddocs=false \
-Degl=yes \
-Dx11=false \
-Dtests=true \
-Dglx=no .. &&
read -p "Compile?" && ninja -j2 &&
sudo -S DESTDIR=$BUILD ninja 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------------------------------------------------------|
libepoxy: libepoxy (OpenGL function pointer management library)
libepoxy:
libepoxy: Epoxy is a library for handling OpenGL function pointer management.
libepoxy:
libepoxy: Homepage: https://github.com/anholt/libepoxy
libepoxy:
libepoxy:
libepoxy:
libepoxy:
libepoxy:
libepoxy:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libepoxy-1.5.10-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*