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"
|
2022-02-27 23:34:12 +00:00
|
|
|
PKG_VERSION="5adc2ab"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="OSS"
|
|
|
|
PKG_SITE="https://github.com/gvalkov/python-evdev"
|
|
|
|
PKG_URL="$PKG_SITE.git"
|
2022-02-27 23:34:12 +00:00
|
|
|
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/python3.8/site-packages/evdev/${so}.cpython-38-x86_64-linux-gnu.so ${INSTALL}/usr/lib/python3.8/site-packages/evdev/${so}.cpython-38-aarch64-linux-gnu.so
|
|
|
|
done
|
|
|
|
}
|