Last active
January 20, 2021 21:39
-
-
Save Hi-Angel/45030ab89a2378b42511612cbe48d247 to your computer and use it in GitHub Desktop.
A script to package built libinput as a deb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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