aboutsummaryrefslogtreecommitdiffstats
path: root/community/wiringpi/APKBUILD
blob: e0187a478c2b5d332ef9bde8ef1526fc75f50288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=wiringpi
pkgver=2.32
_commitid=5edd177
pkgrel=0
pkgdesc="command line interface for Raspberry Pi gpio"
url="http://wiringpi.com/the-gpio-utility/"
arch="armhf"
license="LGPLv3"
depends=""
makedepends="linux-headers"
install=""
subpackages=""
source="wiringpi-$pkgver.tar.gz::https://git.drogon.net/?p=wiringPi;a=snapshot;h=$_commitid;sf=tgz
	"

_srcdir="$srcdir"/wiringPi-$_commitid

prepare() {
	local i
	cd "$_srcdir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	sed -i -e '/sys\/ioctl/i#include <asm/ioctl.h>' wiringPi/wiringPiSPI.c
}

build() {
	cd "$_srcdir"
	make -C wiringPi static CFLAGS="$CFLAGS -I." LDFLAGS="$LDFLAGS" || return 1
	make -C devLib static CFLAGS="$CFLAGS -I../wiringPi" LDFLAGS="$LDFLAGS" || return 1
	make -C gpio CFLAGS="$CFLAGS -I../wiringPi -I../devLib" LDFLAGS="$LDFLAGS -L../wiringPi -L../devLib" || return 1
}

package() {
	cd "$_srcdir"
	install -D -m755 gpio/gpio "$pkgdir"/usr/bin/gpio || return 1
}

md5sums="8c156806f2a7c2bf5573ef54955f0cda  wiringpi-2.32.tar.gz"
sha256sums="c5f7b4807317eb74d81212337b893cb5a27981d01f6037e6be8a3a6d6e58a540  wiringpi-2.32.tar.gz"
sha512sums="6891ea57e5829772c4567502f6ed93e40e46e0263913df6dd59977016668ebc7457955e34524c1b1838e7ffd64ddf6c5e7d18c16a26b4799d6255cdb32783801  wiringpi-2.32.tar.gz"