summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD19
-rw-r--r--read-pin-base_new.patch (renamed from read-pin-base.patch)33
3 files changed, 38 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a4ec8170a695..32aff98ab0d4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Thu Apr 19 04:18:10 UTC 2018
pkgbase = python-rpi.gpio
pkgdesc = A module to control Raspberry Pi GPIO channels
- pkgver = 0.6.3
- pkgrel = 3
+ pkgver = 0.7.0
+ pkgrel = 1
url = http://sourceforge.net/projects/raspberry-gpio-python/
arch = i686
arch = x86_64
@@ -14,12 +12,12 @@ pkgbase = python-rpi.gpio
license = MIT
makedepends = python-setuptools
depends = python
- source = https://pypi.python.org/packages/e2/58/6e1b775606da6439fa3fd1550e7f714ac62aa75e162eed29dbec684ecb3e/RPi.GPIO-0.6.3.tar.gz
- source = read-pin-base.patch
+ source = https://files.pythonhosted.org/packages/cb/88/d3817eb11fc77a8d9a63abeab8fe303266b1e3b85e2952238f0da43fed4e/RPi.GPIO-0.7.0.tar.gz
+ source = read-pin-base_new.patch
source = cpuinfo-from-devicetree.patch
- sha256sums = a5fc0eb5e401963b6c0a03650da6b42c4005f02d962b81241d96c98d0a578516
- sha256sums = 72539b6246f8f6b1c792052c5d7078e3d171f0a7a3a01d81b59431fed7058fda
- sha256sums = 436825c6601e9ba873092d0be3d76693570e610479523abd3e9b821ff42ea83c
+ sha512sums = db838914a26dbc2083af16d5e5780b2f9b5c5e8c43a083556157964b032654e0f4942173ee933afa7169d1eca26e123410518328ae5729b6aaf8ac8f41996b01
+ sha512sums = f0f9ae1ad760c667a1fa3e42fbcc46963bf8653a3f45c3c6a457c39cb35135f00a261214c4c8f009c81cc1336252fe8338e4e7e67828b0488f99c9718f0dc744
+ sha512sums = 93c8516a268b00639cf49555a74b8760a8103e549da8ecf65081d74add937111bf7d79b4d73f4f97f3f0b3acea3f410f2b6cc0d94e9c4c3a9b1e6a69cfe77c1c
pkgname = python-rpi.gpio
diff --git a/PKGBUILD b/PKGBUILD
index bd9e9ce49342..9cf4d923dbfa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,18 +1,21 @@
+# Maintainer: Jonas Heinrich <onny@project-insanity.org>
+# Contributor: Jonas Heinrich <onny@project-insanity.org>
+
pkgname=python-rpi.gpio
-pkgver=0.6.3
-pkgrel=3
+pkgver=0.7.0
+pkgrel=1
pkgdesc="A module to control Raspberry Pi GPIO channels"
url="http://sourceforge.net/projects/raspberry-gpio-python/"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
license=('MIT')
depends=('python')
makedepends=('python-setuptools')
-source=("https://pypi.python.org/packages/e2/58/6e1b775606da6439fa3fd1550e7f714ac62aa75e162eed29dbec684ecb3e/RPi.GPIO-0.6.3.tar.gz"
- read-pin-base.patch
+source=("https://files.pythonhosted.org/packages/cb/88/d3817eb11fc77a8d9a63abeab8fe303266b1e3b85e2952238f0da43fed4e/RPi.GPIO-0.7.0.tar.gz"
+ read-pin-base_new.patch
cpuinfo-from-devicetree.patch)
-sha256sums=('a5fc0eb5e401963b6c0a03650da6b42c4005f02d962b81241d96c98d0a578516'
- '72539b6246f8f6b1c792052c5d7078e3d171f0a7a3a01d81b59431fed7058fda'
- '436825c6601e9ba873092d0be3d76693570e610479523abd3e9b821ff42ea83c')
+sha512sums=('db838914a26dbc2083af16d5e5780b2f9b5c5e8c43a083556157964b032654e0f4942173ee933afa7169d1eca26e123410518328ae5729b6aaf8ac8f41996b01'
+ 'f0f9ae1ad760c667a1fa3e42fbcc46963bf8653a3f45c3c6a457c39cb35135f00a261214c4c8f009c81cc1336252fe8338e4e7e67828b0488f99c9718f0dc744'
+ '93c8516a268b00639cf49555a74b8760a8103e549da8ecf65081d74add937111bf7d79b4d73f4f97f3f0b3acea3f410f2b6cc0d94e9c4c3a9b1e6a69cfe77c1c')
prepare () {
cd "${srcdir}/RPi.GPIO-${pkgver}"
@@ -21,7 +24,7 @@ prepare () {
patch -p1 -i "${srcdir}/cpuinfo-from-devicetree.patch"
# https://sourceforge.net/p/raspberry-gpio-python/tickets/150/
- patch -p1 -i "${srcdir}/read-pin-base.patch"
+ patch -p1 -i "${srcdir}/read-pin-base_new.patch"
}
build() {
diff --git a/read-pin-base.patch b/read-pin-base_new.patch
index 0e527c97336a..ccf9021ad01b 100644
--- a/read-pin-base.patch
+++ b/read-pin-base_new.patch
@@ -1,6 +1,5 @@
-diff -r c53985209d09 source/event_gpio.c
---- a/source/event_gpio.c Sun Oct 30 22:41:09 2016 +0000
-+++ b/source/event_gpio.c Thu Feb 23 18:22:28 2017 +0100
+--- a/source/event_gpio.c 2019-11-08 19:58:16.496007561 +0100
++++ b/source/event_gpio.c 2019-11-08 19:59:57.682280245 +0100
@@ -24,6 +24,7 @@
#include <sys/epoll.h>
#include <stdio.h>
@@ -9,13 +8,18 @@ diff -r c53985209d09 source/event_gpio.c
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
-@@ -62,17 +63,64 @@
+@@ -62,6 +63,7 @@
int thread_running = 0;
int epfd_thread = -1;
int epfd_blocking = -1;
+int pin_base = -1;
/************* /sys/class/gpio functions ************/
+ #define x_write(fd, buf, len) do { \
+@@ -73,10 +75,54 @@
+ } \
+ } while (/* CONSTCOND */ 0)
+
+void gpio_find_chip_base()
+{
+ DIR *gpio_dir;
@@ -65,18 +69,21 @@ diff -r c53985209d09 source/event_gpio.c
int fd, len;
- char str_gpio[3];
+ char str_gpio[64];
+ char filename[33];
- if ((fd = open("/sys/class/gpio/export", O_WRONLY)) < 0)
+ snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d", gpio);
+@@ -90,7 +136,9 @@
return -1;
+ }
- len = snprintf(str_gpio, sizeof(str_gpio), "%d", gpio);
+ gpio_find_chip_base();
+
+ len = snprintf(str_gpio, sizeof(str_gpio), "%d", pin_base + gpio);
- write(fd, str_gpio, len);
+ x_write(fd, str_gpio, len);
close(fd);
-@@ -82,12 +130,14 @@
+@@ -100,12 +148,14 @@
int gpio_unexport(unsigned int gpio)
{
int fd, len;
@@ -90,24 +97,24 @@ diff -r c53985209d09 source/event_gpio.c
+ gpio_find_chip_base();
+
+ len = snprintf(str_gpio, sizeof(str_gpio), "%d", pin_base + gpio);
- write(fd, str_gpio, len);
+ x_write(fd, str_gpio, len);
close(fd);
-@@ -99,9 +149,11 @@
+@@ -117,9 +167,11 @@
int retry;
struct timespec delay;
int fd;
- char filename[33];
+ char filename[64];
++
++ gpio_find_chip_base();
- snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d/direction", gpio);
-+ gpio_find_chip_base();
-+
+ snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d/direction", pin_base + gpio);
// retry waiting for udev to set correct file permissions
delay.tv_sec = 0;
-@@ -126,9 +178,11 @@
+@@ -144,9 +196,11 @@
int gpio_set_edge(unsigned int gpio, unsigned int edge)
{
int fd;
@@ -121,7 +128,7 @@ diff -r c53985209d09 source/event_gpio.c
if ((fd = open(filename, O_WRONLY)) < 0)
return -1;
-@@ -141,10 +195,12 @@
+@@ -159,10 +213,12 @@
int open_value_file(unsigned int gpio)
{
int fd;