wok-next rev 16466
R-Pi: add wiringpi (GPIO tool and library)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 22 02:05:54 2014 +0200 (2014-04-22) |
parents | 4c9e6fbf8207 |
children | 3ab4ece3450e |
files | wiringpi-dev/receipt wiringpi/receipt wiringpi/stuff/gpio-decodePin.patch |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/wiringpi-dev/receipt Tue Apr 22 02:05:54 2014 +0200 1.3 @@ -0,0 +1,20 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="wiringpi-dev" 1.7 +GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" 1.8 +VERSION="${GITHASH:0:7}" 1.9 +CATEGORY="system-tools" 1.10 +SHORT_DESC="The WiringPi headers files." 1.11 +MAINTAINER="pankso@slitaz.org" 1.12 +LICENSE="LGPL" 1.13 +WEB_SITE="http://wiringpi.com/" 1.14 +HOST_ARCH="arm" 1.15 + 1.16 +WANTED="wiringpi" 1.17 + 1.18 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.19 +genpkg_rules() 1.20 +{ 1.21 + mkdir -p $fs/usr 1.22 + cp -a ${install}/usr/include $fs/usr 1.23 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/wiringpi/receipt Tue Apr 22 02:05:54 2014 +0200 2.3 @@ -0,0 +1,58 @@ 2.4 +# SliTaz package receipt. 2.5 + 2.6 +PACKAGE="wiringpi" 2.7 +GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" 2.8 +VERSION="${GITHASH:0:7}" 2.9 +CATEGORY="system-tools" 2.10 +SHORT_DESC="GPIO access library written in C for the Raspberry Pi/BCM2835." 2.11 +MAINTAINER="pankso@slitaz.org" 2.12 +LICENSE="LGPL" 2.13 +TARBALL="$PACKAGE-$VERSION.tar.bz2" 2.14 +WEB_SITE="http://wiringpi.com/" 2.15 +WGET_URL="git|git://git.drogon.net/wiringPi" 2.16 +HOST_ARCH="arm" 2.17 + 2.18 +# Rules to configure and make the package. 2.19 +compile_rules() 2.20 +{ 2.21 + # Fixes: fancy paths in Makefile and do sym link manually 2.22 + sed -i \ 2.23 + -e s"#CC = gcc#CC = ${HOST_SYSTEM}-gcc#" \ 2.24 + -e s"#DESTDIR=.*#DESTDIR=$DESTDIR#" \ 2.25 + -e s"#PREFIX=.*#PREFIX=/usr#" */Makefile 2.26 + 2.27 + # First: WiringPi Library 2.28 + cd ${src}/wiringPi 2.29 + make || return 1 2.30 + sed -i '/libwiringPi.so$/'d Makefile 2.31 + make install && cd ${DESTDIR}/usr/lib 2.32 + ln -s libwiringPi.so.2.0 libwiringPi.so 2.33 + 2.34 + # Second: Devices Library 2.35 + cd ${src}/devLib 2.36 + sed -i \ 2.37 + -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ 2.38 + -e '/libwiringPiDev.so$/'d Makefile 2.39 + make || return 1 2.40 + make install && cd ${DESTDIR}/usr/lib 2.41 + ln -s libwiringPiDev.so.2.0 libwiringPiDev.so 2.42 + 2.43 + # Last: GPIO Utility 2.44 + cd ${src}/gpio 2.45 + patch -p0 < ${stuff}/gpio-decodePin.patch 2.46 + mkdir -p ${DESTDIR}/usr/bin 2.47 + make && make install 2.48 +} 2.49 + 2.50 +# SliTaz package testsuite 2.51 +testsuite() { 2.52 + readelf -Ah ${install}/usr/bin/gpio || return 1 2.53 +} 2.54 + 2.55 +# Rules to gen a SliTaz package suitable for Tazpkg. 2.56 +genpkg_rules() 2.57 +{ 2.58 + mkdir -p $fs/usr/lib 2.59 + cp -a ${install}/usr/lib/*.so* $fs/usr/lib 2.60 + cp -a ${install}/usr/bin $fs/usr 2.61 +}
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/wiringpi/stuff/gpio-decodePin.patch Tue Apr 22 02:05:54 2014 +0200 3.3 @@ -0,0 +1,29 @@ 3.4 +--- gpio.c 3.5 ++++ gpio.slitaz.c 3.6 +@@ -74,26 +74,6 @@ 3.7 + " gpio gbr <channel>\n" 3.8 + " gpio gbw <channel> <value>" ; // No trailing newline needed here. 3.9 + 3.10 +- 3.11 +-/* 3.12 +- * decodePin: 3.13 +- * Decode a pin "number" which can actually be a pin name to represent 3.14 +- * one of the Pi's on-board pins. 3.15 +- ********************************************************************************* 3.16 +- */ 3.17 +- 3.18 +-static int decodePin (const char *str) 3.19 +-{ 3.20 +- 3.21 +-// The first case - see if it's a number: 3.22 +- 3.23 +- if (isdigit (str [0])) 3.24 +- return atoi (str) ; 3.25 +- 3.26 +- return 0 ; 3.27 +-} 3.28 +- 3.29 +- 3.30 + /* 3.31 + * changeOwner: 3.32 + * Change the ownership of the file to the real userId of the calling