From 3898e282f6290b65320eeb1493cfa020dd44859f Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Sat, 7 Apr 2018 22:30:20 +0200 Subject: [PATCH] dev-python/pifacecommon: Set the SPI clock speed to a fixed value. Package-Manager: Portage-2.3.28, Repoman-2.3.9 Manifest-Sign-Key: 766B8122134269123401492A8B54D7A3FF3CDB17 --- .../files/pifacecommon-4.2.1-fix_speed.patch | 19 +++++++++++++ .../pifacecommon/pifacecommon-4.2.1-r1.ebuild | 28 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 dev-python/pifacecommon/files/pifacecommon-4.2.1-fix_speed.patch create mode 100644 dev-python/pifacecommon/pifacecommon-4.2.1-r1.ebuild diff --git a/dev-python/pifacecommon/files/pifacecommon-4.2.1-fix_speed.patch b/dev-python/pifacecommon/files/pifacecommon-4.2.1-fix_speed.patch new file mode 100644 index 0000000..c3f1ddc --- /dev/null +++ b/dev-python/pifacecommon/files/pifacecommon-4.2.1-fix_speed.patch @@ -0,0 +1,19 @@ +Author: Nils Freydank +Date: Sat Apr 07 22:00:01 2018 +0100 + +Set speed_hz to a limited value as it might otherwise be default +to a system clock depending value. + +--- a/pifacecommon/spi.py 2015-05-26 12:24:06.000000000 +0200 ++++ b/pifacecommon/spi.py 2018-04-07 22:00:00.000000000 +0200 +@@ -65,7 +65,8 @@ + transfer = spi_ioc_transfer( + tx_buf=ctypes.addressof(wbuffer), + rx_buf=ctypes.addressof(rbuffer), +- len=ctypes.sizeof(wbuffer) ++ len=ctypes.sizeof(wbuffer), ++ speed_hz=ctypes.c_uint32(15000) + ) + + if self.spi_callback is not None: + diff --git a/dev-python/pifacecommon/pifacecommon-4.2.1-r1.ebuild b/dev-python/pifacecommon/pifacecommon-4.2.1-r1.ebuild new file mode 100644 index 0000000..64d06dc --- /dev/null +++ b/dev-python/pifacecommon/pifacecommon-4.2.1-r1.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_5 ) + +inherit distutils-r1 + +DESCRIPTION="Common functions for interacting with PiFace products" +HOMEPAGE="https://github.com/piface/pifacecommon" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/piface/pifacecommon.git" +else + SRC_URI="https://github.com/piface/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~arm" +fi + +LICENSE="GPL-3" +SLOT="0" +IUSE="" + +PATCHES=( "${FILESDIR}"/${PN}-4.2.1-fix_speed.patch ) + +DEPEND="dev-libs/libpifacedigital" +RDEPEND="${DEPEND}"