distribution/packages/tools/python-evdev/package.mk
2023-12-15 16:33:23 +00:00

38 lines
1.6 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 0riginally created by Escalade (https://github.com/escalade)
# Copyright (C) 2018-present 5schatten (https://github.com/5schatten)
PKG_NAME="python-evdev"
PKG_VERSION="c688c9e63c535f3a9e0fae4930315ef432d09384"
PKG_LICENSE="OSS"
PKG_SITE="https://github.com/gvalkov/python-evdev"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain Python3:host Python3 distutilscross:host"
PKG_LONGDESC="Userspace evdev events"
PKG_TOOLCHAIN="manual"
GET_HANDLER_SUPPORT="git"
pre_make_target() {
export PYTHONXCPREFIX="${SYSROOT_PREFIX}/usr"
export LDFLAGS="${LDFLAGS} -L${SYSROOT_PREFIX}/usr/lib -L${SYSROOT_PREFIX}/lib"
export LDSHARED="${CC} -shared"
find . -name setup.py -exec sed -i "s:/usr/include/linux/input.h :${SYSROOT_PREFIX}/usr/include/linux/input.h:g" \{} \;
find . -name setup.py -exec sed -i "s:/usr/include/linux/input-event-codes.h :${SYSROOT_PREFIX}/usr/include/linux/input-event-codes.h:g" \{} \;
}
make_target() {
python3 setup.py build_ext \
build_ecodes --evdev-headers ${SYSROOT_PREFIX}/usr/include/linux/input.h:${SYSROOT_PREFIX}/usr/include/linux/input-event-codes.h \
build_ext --include-dirs ${SYSROOT_PREFIX}/usr/include/
}
makeinstall_target() {
python3 setup.py install --root=${INSTALL} --prefix=/usr
}
post_makeinstall_target() {
for so in _ecodes _input _uinput
do
mv ${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}/site-packages/evdev/${so}.cpython-311-x86_64-linux-gnu.so ${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}/site-packages/evdev/${so}.cpython-311-aarch64-linux-gnu.so
done
}