wok-6.x view wiringpi/receipt @ rev 25506

memtest, pack: cleanup
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 09 16:28:01 2023 +0000 (22 months ago)
parents 819e017f397d
children
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 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - $WEB_SITE 2>/dev/null | \
22 sed '/updated/!d;s|.* to ||;s|[ <].*||;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 # Fixes: fancy paths in Makefile and do sym link manually
29 sed -i \
30 -e s"#CC = gcc#CC = ${HOST_SYSTEM}-gcc#" \
31 -e s"#DESTDIR=.*#DESTDIR=$DESTDIR#" \
32 -e s"#PREFIX=.*#PREFIX=/usr#" */Makefile
34 # First: WiringPi Library
35 cd ${src}/wiringPi
36 make || return 1
37 sed -i '/libwiringPi.so$/'d Makefile
38 make install && cd ${DESTDIR}/usr/lib
39 ln -s libwiringPi.so.2.0 libwiringPi.so
41 # Second: Devices Library
42 cd ${src}/devLib
43 sed -i \
44 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \
45 -e '/libwiringPiDev.so$/'d Makefile
46 make || return 1
47 make install && cd ${DESTDIR}/usr/lib
48 ln -s libwiringPiDev.so.2.0 libwiringPiDev.so
50 # Last: GPIO Utility
51 cd ${src}/gpio
52 patch -p0 < ${stuff}/gpio-decodePin.patch
53 mkdir -p ${DESTDIR}/usr/bin
54 make && make install
56 # Extra: PiGlow --> wiringpi-piglow
57 echo "Compiling PiGlow example..."
58 cd ${src}/examples/PiGlow
59 sed -i \
60 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \
61 -e s'#^LDFLAGS.*#LDFLAGS= -L${DESTDIR}/usr/lib#' \
62 -e s"#^CC.*#CC = ${HOST_SYSTEM}-gcc#" Makefile
63 make
65 # Extra: PiFace --> wiringpi-piface
66 cd ${src}/examples/PiFace
67 sed -i \
68 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \
69 -e s'#^LDFLAGS.*#LDFLAGS= -L${DESTDIR}/usr/lib#' \
70 -e s"#^CC.*#CC = ${HOST_SYSTEM}-gcc#" Makefile
71 make
72 }
74 # SliTaz package testsuite
75 testsuite() {
76 readelf -Ah ${install}/usr/bin/gpio || return 1
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 mkdir -p $fs/usr/lib
83 cp -a ${install}/usr/lib/*.so* $fs/usr/lib
84 cp -a ${install}/usr/bin $fs/usr
85 }