Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Hi-Angel
Last active January 20, 2021 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hi-Angel/45030ab89a2378b42511612cbe48d247 to your computer and use it in GitHub Desktop.
Save Hi-Angel/45030ab89a2378b42511612cbe48d247 to your computer and use it in GitHub Desktop.
A script to package built libinput as a deb.
#!/bin/bash
# NOTE: make sure the libinput build is configured with --prefix=/usr/. It is
# important, so libraries upon installation end up in correct locations.
set -e
if [ "$#" -ne 1 ]; then
echo "Wrong number of parameters.
Usage: $(basename $0) build_dir"
exit 1
fi
MESON_BUILD_ROOT=$(readlink -f $1)
PACKAGE_VERSION=$(grep -Po 'LIBINPUT_GIT_VERSION.*"\K.+(?=")' "$MESON_BUILD_ROOT"/libinput-git-version.h)
PKG_DIR="$MESON_BUILD_ROOT"/deb
mkdir -p $PKG_DIR/DEBIAN/
cat > $PKG_DIR/DEBIAN/control <<- END_OF_TEXT
PACKAGE: libinput-git
Version: $PACKAGE_VERSION
Architecture: amd64
Maintainer: Mystique Packager
Description: input device management and event handling library
Depends: libevdev2, libmtdev1, libudev1, libwacom2
Conflicts: libinput10, libinput-bin, libinput-dev, libinput-tools
Provides: libinput10, libinput-bin, libinput-dev, libinput-tools
Homepage: https://gitlab.freedesktop.org/libinput/libinput
END_OF_TEXT
cd "$MESON_BUILD_ROOT"
DESTDIR=$PKG_DIR ninja install
fakeroot dpkg-deb --build $PKG_DIR/ libinput_$PACKAGE_VERSION.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment