wok annotate wiringpi/receipt @ rev 18010
Up: tazpanel(472), tazpkg(795).
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Apr 30 02:29:34 2015 +0300 (2015-04-30) |
parents | ebe935a13106 |
children | 535c806240cc |
rev | line source |
---|---|
pankso@16466 | 1 # SliTaz package receipt. |
pankso@16466 | 2 |
pankso@16466 | 3 PACKAGE="wiringpi" |
pankso@16466 | 4 GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" |
pankso@16466 | 5 VERSION="${GITHASH:0:7}" |
pankso@16466 | 6 CATEGORY="system-tools" |
pankso@16466 | 7 SHORT_DESC="GPIO access library written in C for the Raspberry Pi/BCM2835." |
pankso@16466 | 8 MAINTAINER="pankso@slitaz.org" |
pankso@16466 | 9 LICENSE="LGPL" |
pascal@16632 | 10 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pankso@16466 | 11 WEB_SITE="http://wiringpi.com/" |
pankso@16631 | 12 WGET_URL="https://git.drogon.net/?p=wiringPi;a=snapshot;h=${GITHASH};sf=tgz" |
pankso@16512 | 13 TAGS="raspberrypi rpi" |
pankso@16466 | 14 HOST_ARCH="arm" |
pankso@16466 | 15 |
pankso@16631 | 16 RELATED="wiringpi-dev wiringpi-piglow wiringpi-piface" |
pankso@16512 | 17 |
pankso@16466 | 18 # Rules to configure and make the package. |
pankso@16466 | 19 compile_rules() |
pankso@16466 | 20 { |
pankso@16466 | 21 # Fixes: fancy paths in Makefile and do sym link manually |
pankso@16466 | 22 sed -i \ |
pankso@16466 | 23 -e s"#CC = gcc#CC = ${HOST_SYSTEM}-gcc#" \ |
pankso@16466 | 24 -e s"#DESTDIR=.*#DESTDIR=$DESTDIR#" \ |
pankso@16466 | 25 -e s"#PREFIX=.*#PREFIX=/usr#" */Makefile |
pankso@16466 | 26 |
pankso@16466 | 27 # First: WiringPi Library |
pankso@16466 | 28 cd ${src}/wiringPi |
pankso@16466 | 29 make || return 1 |
pankso@16466 | 30 sed -i '/libwiringPi.so$/'d Makefile |
pankso@16466 | 31 make install && cd ${DESTDIR}/usr/lib |
pankso@16466 | 32 ln -s libwiringPi.so.2.0 libwiringPi.so |
pankso@16466 | 33 |
pankso@16466 | 34 # Second: Devices Library |
pankso@16466 | 35 cd ${src}/devLib |
pankso@16466 | 36 sed -i \ |
pankso@16466 | 37 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ |
pankso@16466 | 38 -e '/libwiringPiDev.so$/'d Makefile |
pankso@16466 | 39 make || return 1 |
pankso@16466 | 40 make install && cd ${DESTDIR}/usr/lib |
pankso@16466 | 41 ln -s libwiringPiDev.so.2.0 libwiringPiDev.so |
pankso@16466 | 42 |
pankso@16466 | 43 # Last: GPIO Utility |
pankso@16466 | 44 cd ${src}/gpio |
pankso@16466 | 45 patch -p0 < ${stuff}/gpio-decodePin.patch |
pankso@16466 | 46 mkdir -p ${DESTDIR}/usr/bin |
pankso@16466 | 47 make && make install |
pankso@16512 | 48 |
pankso@16512 | 49 # Extra: PiGlow --> wiringpi-piglow |
pankso@16631 | 50 echo "Compiling PiGlow example..." |
pankso@16512 | 51 cd ${src}/examples/PiGlow |
pankso@16512 | 52 sed -i \ |
pankso@16512 | 53 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ |
pankso@16512 | 54 -e s'#^LDFLAGS.*#LDFLAGS= -L${DESTDIR}/usr/lib#' \ |
pankso@16512 | 55 -e s"#^CC.*#CC = ${HOST_SYSTEM}-gcc#" Makefile |
pankso@16512 | 56 make |
pankso@16631 | 57 |
pankso@16631 | 58 # Extra: PiFace --> wiringpi-piface |
pankso@16631 | 59 cd ${src}/examples/PiFace |
pankso@16631 | 60 sed -i \ |
pankso@16631 | 61 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ |
pankso@16631 | 62 -e s'#^LDFLAGS.*#LDFLAGS= -L${DESTDIR}/usr/lib#' \ |
pankso@16631 | 63 -e s"#^CC.*#CC = ${HOST_SYSTEM}-gcc#" Makefile |
pankso@16631 | 64 make |
pankso@16466 | 65 } |
pankso@16466 | 66 |
pankso@16466 | 67 # SliTaz package testsuite |
pankso@16466 | 68 testsuite() { |
pankso@16466 | 69 readelf -Ah ${install}/usr/bin/gpio || return 1 |
pankso@16466 | 70 } |
pankso@16466 | 71 |
pankso@16466 | 72 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@16466 | 73 genpkg_rules() |
pankso@16466 | 74 { |
pankso@16466 | 75 mkdir -p $fs/usr/lib |
pankso@16466 | 76 cp -a ${install}/usr/lib/*.so* $fs/usr/lib |
pankso@16466 | 77 cp -a ${install}/usr/bin $fs/usr |
pankso@16466 | 78 } |