distribution/packages/tools/pyudev/package.mk

30 lines
1 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)
# Copyright (C) 2023-present Fewtarius
PKG_NAME="pyudev"
PKG_VERSION="96df1bd"
PKG_LICENSE="OSS"
PKG_SITE="https://github.com/pyudev/pyudev"
PKG_URL="https://github.com/pyudev/pyudev/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="pyudev is a LGPL licenced, pure Python 2/3 binding to libudev, the device and hardware management and information library of Linux."
pre_make_target() {
export PYTHONXCPREFIX="${SYSROOT_PREFIX}/usr"
export LDFLAGS="${LDFLAGS} -L${SYSROOT_PREFIX}/usr/lib -L${SYSROOT_PREFIX}/lib"
export LDSHARED="${CC} -shared"
}
make_target() {
python3 setup.py build --cross-compile
}
makeinstall_target() {
python3 setup.py install --root=${INSTALL} --prefix=/usr
}
post_makeinstall_target() {
find ${INSTALL}/usr/lib/python*/site-packages/ -name "*.py" -exec rm -rf {} ";"
}