aboutsummaryrefslogtreecommitdiffstats
path: root/community/wiringpi/APKBUILD
blob: 7d835344afed8c2c8a8d5675b2dcd39380cc2e0f (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
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=wiringpi
pkgver=2.46
_commitid=8d188fa0e00bb8c6ff6eddd07bf92857e9bd533a
pkgrel=2
pkgdesc="command line interface for Raspberry Pi gpio"
url="http://wiringpi.com/the-gpio-utility/"
arch="aarch64 armhf armv7"
license="LGPL-3.0"
options="!check" # no testsuite
depends=""
makedepends="linux-headers"
install=""
subpackages="$pkgname-dev"
source="wiringpi-$pkgver.tar.gz::https://github.com/WiringPi/WiringPi/archive/$_commitid.tar.gz
	"

builddir="$srcdir"/WiringPi-$_commitid

build() {
	cd "$builddir"
	make -C wiringPi CFLAGS="$CFLAGS -fpic -I." LDFLAGS="$LDFLAGS" WIRINGPI_SONAME_SUFFIX=".$pkgver"
	ln -sf libwiringPi.so.$pkgver wiringPi/libwiringPi.so
	make -C devLib CFLAGS="$CFLAGS -fpic -I../wiringPi" LDFLAGS="$LDFLAGS" WIRINGPI_SONAME_SUFFIX=".$pkgver"
	ln -sf libwiringPiDev.so.$pkgver devLib/libwiringPiDev.so
	make -C gpio CFLAGS="$CFLAGS -I../wiringPi -I../devLib" LDFLAGS="$LDFLAGS -L../wiringPi -L../devLib"
}

package() {
	cd "$builddir"
	install -d -m755 "$pkgdir"/usr/include
	install -D -m644 wiringPi/*.h devLib/*.h "$pkgdir"/usr/include
	install -D -m755 wiringPi/libwiringPi.so."$pkgver" "$pkgdir"/usr/lib/libwiringPi.so."$pkgver"
	ln -s libwiringPi.so."$pkgver" "$pkgdir"/usr/lib/libwiringPi.so
	install -D -m755 devLib/libwiringPiDev.so."$pkgver" "$pkgdir"/usr/lib/libwiringPiDev.so."$pkgver"
	ln -s libwiringPiDev.so."$pkgver" "$pkgdir"/usr/lib/libwiringPiDev.so
	install -D -m755 gpio/gpio "$pkgdir"/usr/bin/gpio
}

sha512sums="eae4868a25a08ab9b7207548111f3a50dbd3b8ab85dd4d1b8c1da567253cbafa260ffdfc6bef78795dbce1c1c46f27d998a0c3f8302a7765d26519120cf306d1  wiringpi-2.46.tar.gz"