wok-next view wiringpi/receipt @ rev 20690
add missing SHA256sums
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Mon May 21 19:36:47 2018 +0000 (2018-05-21) |
parents | 819e017f397d |
children |
line source
1 # SliTaz package receipt v2.
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 SPLIT="wiringpi 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 case $PACKAGE in
76 wiringpi)
77 mkdir -p $fs/usr/lib
78 cp -a ${install}/usr/lib/*.so* $fs/usr/lib
79 cp -a ${install}/usr/bin $fs/usr
80 ;;
81 wiringpi-dev)
82 CAT="system-tools|The WiringPi headers files."
83 TAGS="raspberrypi rpi"
84 HOST_ARCH="arm"
85 mkdir -p $fs/usr
86 cp -a ${install}/usr/include $fs/usr
87 ;;
88 wiringpi-piface)
89 CAT="system-tools|The WiringPi PiFace examples."
90 TAGS="raspberrypi rpi"
91 HOST_ARCH="arm"
92 mkdir -p $fs/usr/lib/wiringpi/piface
93 cd ${src}/examples/PiFace
94 for ex in $(ls *.c)
95 do
96 cp -a ${ex%.c} $fs/usr/lib/wiringpi/piface/${ex%.c}
97 done
98 ;;
99 wiringpi-piglow)
100 CAT="system-tools|The WiringPi Piglow utility (useful for SHell scripts)."
101 WEB_SITE="http://wiringpi.com/"
102 TAGS="raspberrypi rpi"
103 HOST_ARCH="arm"
104 mkdir -p $fs/usr/bin
105 cp -a ${src}/examples/PiGlow/piglow $fs/usr/bin
106 ;;
107 esac
108 }