Files
BMLFS/build-scripts/libinput.build
2025-07-26 17:25:57 -05:00

74 lines
2.5 KiB
Bash

#! /bin/bash
# libinput
# Source: https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.28.1/libinput-1.28.1.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: mtdev, libevdev
# Recommended: NONE
# Optional: libwacom
# If optimizing, use flags with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=auto "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
export PVER=1.28.1
meson setup --prefix=/usr \
-Dudev-dir=/usr/lib/udev \
-Ddebug-gui=false \
-Dtests=false \
-Ddocumentation=false \
-Dlibwacom=false \
OUT &&
read -p "Compile?" && ninja -C OUT -j2 &&
sudo -S DESTDIR=$BUILD ninja -C OUT install && \
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr/share
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/
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------------------------------------------------------|
libinput: libinput (Input device library)
libinput:
libinput: libinput is a library that handles input devices for display servers
libinput: and other applications that need to directly deal with input devices.
libinput:
libinput:
libinput:
libinput:
libinput:
libinput: Homepage: http://www.freedesktop.org/wiki/Software/libinput/
libinput:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libinput-$PVER-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
libinput-doc: Manuals for libinput (Input device library)
libinput-doc:
libinput-doc: libinput is a library that handles input devices for display servers
libinput-doc: and other applications that need to directly deal with input devices.
libinput-doc:
libinput-doc: Homepage: http://www.freedesktop.org/wiki/Software/libinput/
libinput-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libinput-doc-$PVER-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*