57 lines
1.7 KiB
Bash
57 lines
1.7 KiB
Bash
# Template file for 'i2c-tools'
|
|
pkgname=i2c-tools
|
|
version=4.3
|
|
revision=2
|
|
build_style=gnu-makefile
|
|
make_build_args="EXTRA=py-smbus"
|
|
make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
|
|
hostmakedepends="python3 python3-setuptools"
|
|
makedepends="python3-devel"
|
|
depends="perl"
|
|
short_desc="Heterogeneous set of I2C tools"
|
|
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
|
license="GPL-2.0-or-later"
|
|
homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
|
|
distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
|
|
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
|
|
system_groups="i2c"
|
|
|
|
|
|
if [ -n "$CROSS_BUILD" ]; then
|
|
export PYPREFIX="$XBPS_CROSS_BASE"
|
|
export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
|
|
export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
|
export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
|
export LDSHARED="${CC} -shared $LDFLAGS"
|
|
export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
|
|
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
|
f=${f##*/}
|
|
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
|
done
|
|
export _PYTHON_SYSCONFIGDATA_NAME
|
|
fi
|
|
|
|
post_install() {
|
|
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
|
|
}
|
|
|
|
i2c-tools-devel_package() {
|
|
short_desc+=" - development files"
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/include
|
|
vmove usr/share/man/man3
|
|
vmove "usr/lib/*.a"
|
|
vmove "usr/lib/*.so"
|
|
}
|
|
}
|
|
|
|
python3-smbus_package() {
|
|
short_desc+="Python 3 bindings for libi2c from i2c-tools"
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
lib32disabled=yes
|
|
pkg_install() {
|
|
vmove "usr/lib/python3.*"
|
|
}
|
|
}
|