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