aboutsummaryrefslogtreecommitdiffstats
path: root/community/wiringpi/APKBUILD
blob: 66bcc736367e02951cf43f6cfe97042b53452ca4 (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=8d188fa
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://git.drogon.net/?p=wiringPi;a=snapshot;h=$_commitid;sf=tgz
	"

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="ef46522557968b84534b407670217102bea3e83cff941dfa049220b439923231e3bfd99ec8b93fef0951a019322855afd55c4a5c30f9e07b449b0623669f1efb  wiringpi-2.46.tar.gz"