distribution/packages/tools/python-evdev/package.mk

39 lines
1.6 KiB
Makefile
Raw Normal View History

2022-02-05 14:23:32 +00:00
# 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"
2023-03-14 21:59:38 +00:00
PKG_VERSION="2dd6ce6364bb67eedb209f6aa0bace0c18a3a40a"
2022-02-05 14:23:32 +00:00
PKG_LICENSE="OSS"
PKG_SITE="https://github.com/gvalkov/python-evdev"
2023-02-24 13:53:43 +00:00
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain Python3:host Python3 distutilscross:host"
2022-02-05 14:23:32 +00:00
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
2022-02-05 14:23:32 +00:00
done
}