# HG changeset patch # User Christophe Lincoln # Date 1398125154 -7200 # Node ID 84d4534a5de3a06fd3131336997487c959906a31 # Parent 4c9e6fbf820715979c88558a4203f15100201d66 R-Pi: add wiringpi (GPIO tool and library) diff -r 4c9e6fbf8207 -r 84d4534a5de3 wiringpi-dev/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wiringpi-dev/receipt Tue Apr 22 02:05:54 2014 +0200 @@ -0,0 +1,20 @@ +# SliTaz package receipt. + +PACKAGE="wiringpi-dev" +GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" +VERSION="${GITHASH:0:7}" +CATEGORY="system-tools" +SHORT_DESC="The WiringPi headers files." +MAINTAINER="pankso@slitaz.org" +LICENSE="LGPL" +WEB_SITE="http://wiringpi.com/" +HOST_ARCH="arm" + +WANTED="wiringpi" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr + cp -a ${install}/usr/include $fs/usr +} diff -r 4c9e6fbf8207 -r 84d4534a5de3 wiringpi/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wiringpi/receipt Tue Apr 22 02:05:54 2014 +0200 @@ -0,0 +1,58 @@ +# SliTaz package receipt. + +PACKAGE="wiringpi" +GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" +VERSION="${GITHASH:0:7}" +CATEGORY="system-tools" +SHORT_DESC="GPIO access library written in C for the Raspberry Pi/BCM2835." +MAINTAINER="pankso@slitaz.org" +LICENSE="LGPL" +TARBALL="$PACKAGE-$VERSION.tar.bz2" +WEB_SITE="http://wiringpi.com/" +WGET_URL="git|git://git.drogon.net/wiringPi" +HOST_ARCH="arm" + +# Rules to configure and make the package. +compile_rules() +{ + # Fixes: fancy paths in Makefile and do sym link manually + sed -i \ + -e s"#CC = gcc#CC = ${HOST_SYSTEM}-gcc#" \ + -e s"#DESTDIR=.*#DESTDIR=$DESTDIR#" \ + -e s"#PREFIX=.*#PREFIX=/usr#" */Makefile + + # First: WiringPi Library + cd ${src}/wiringPi + make || return 1 + sed -i '/libwiringPi.so$/'d Makefile + make install && cd ${DESTDIR}/usr/lib + ln -s libwiringPi.so.2.0 libwiringPi.so + + # Second: Devices Library + cd ${src}/devLib + sed -i \ + -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ + -e '/libwiringPiDev.so$/'d Makefile + make || return 1 + make install && cd ${DESTDIR}/usr/lib + ln -s libwiringPiDev.so.2.0 libwiringPiDev.so + + # Last: GPIO Utility + cd ${src}/gpio + patch -p0 < ${stuff}/gpio-decodePin.patch + mkdir -p ${DESTDIR}/usr/bin + make && make install +} + +# SliTaz package testsuite +testsuite() { + readelf -Ah ${install}/usr/bin/gpio || return 1 +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib + cp -a ${install}/usr/lib/*.so* $fs/usr/lib + cp -a ${install}/usr/bin $fs/usr +} diff -r 4c9e6fbf8207 -r 84d4534a5de3 wiringpi/stuff/gpio-decodePin.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wiringpi/stuff/gpio-decodePin.patch Tue Apr 22 02:05:54 2014 +0200 @@ -0,0 +1,29 @@ +--- gpio.c ++++ gpio.slitaz.c +@@ -74,26 +74,6 @@ + " gpio gbr \n" + " gpio gbw " ; // No trailing newline needed here. + +- +-/* +- * decodePin: +- * Decode a pin "number" which can actually be a pin name to represent +- * one of the Pi's on-board pins. +- ********************************************************************************* +- */ +- +-static int decodePin (const char *str) +-{ +- +-// The first case - see if it's a number: +- +- if (isdigit (str [0])) +- return atoi (str) ; +- +- return 0 ; +-} +- +- + /* + * changeOwner: + * Change the ownership of the file to the real userId of the calling