Files
BMLFS/build-scripts/libdrm.build
dslm4515 056de0cfae Upgraded libdrm from 2.4.120 to 2.4.125
Build not tested again CMLFS-based system, therefore not removing patch from CHimera Linux just yet.
2025-07-23 11:21:15 -05:00

78 lines
2.8 KiB
Bash

#! /bin/bash
# Libdrm
# Source: https://dri.freedesktop.org/libdrm/libdrm-2.4.125.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: libpciacess (for drm_intel)
# Recommended: NONE
# Optional: Cairo, CMake, docbook-xml, docbook-xsl, libxslt, libatomic_ops, valgrind, CUNIT
# If optimizing:
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 "
export CFLAGS+="-ffat-lto-objects -flto=4 "
export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
export PVER="2.4.125"
# Fix tests
#patch -Np1 -i ../patches/libdrm-chimera/tests.patch
case $(uname -m) in
i686|x86_64) export MARGS+=" -Dnouveau=enabled -Dradeon=enabled -Damdgpu=enabled "
export MARGS+=" -Dexynos=disabled -Dvc4=disabled -Dtegra=disabled "
export MARGS+=" -Dfreedreno=disabled -Dvmwgfx=disabled -Domap=disabled " ;;
arm*) export MARGS+=" -Dexynos=true Dvc4=enabled -Dtegra=enabled -Dfreedreno=disabled "
export MARGS+=" -Dnouveau=enabled -Dradeon=disabled -Damdgpu=disabled "
export MARGS+=" -Dvmwgfx=disabled -Domap=disabled "
;;
esac
# OR for intel only machines (i.e. laptops with intel iGPU)
export MARGS="-Dnouveau=disabled -Dradeon=disabled -Damdgpu=disabled "
export MARGS+="-Dexynos=disabled -Dvc4=disabled -Dtegra=disabled "
export MARGS+="-Dfreedreno=disabled -Dvmwgfx=disabled -Domap=disabled "
# OR for machines with AMD GPU:
export MARGS="-Dnouveau=disabled -Dradeon=enabled -Damdgpu=enabled "
export MARGS+="-Dexynos=disabled -Dvc4=disabled -Dtegra=disabled "
export MARGS+="-Dfreedreno=disabled -Dvmwgfx=disabled -Domap=disabled "
meson setup --prefix=/usr -Dudev=true ${MARGS} OUT
unset MARGS
read -p "Compile?" && ninja -C OUT -j2 &&
sudo -S DESTDIR=$BUILD ninja -C OUT 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------------------------------------------------------|
libdrm: libdrm (A library to support Direct Rendering)
libdrm:
libdrm: This library implements an interface to the kernel's DRM services.
libdrm: It is used to support hardware accelerated 3D rendering.
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libdrm-$PVER-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*